# \[PATCH\] pinctrl: stm32: remove useless check

- Subsystems: PIN CONTROL SUBSYSTEM, ST STM32 PINCTRL DRIVER, THE REST
- Maintainers: Linus Walleij, Antonio Borneo, Linus Torvalds
- List: linux-devicetree
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-devicetree/2017/05/5008708/t

## \[PATCH\] pinctrl: stm32: remove useless check

- From: Alexandre TORGUE \<hidden\>
- Date: 2017-05-31 09:11:22 
- Message: https://ratatoskr.run/linux-devicetree/2017/05/5008708.md

```text
There is no link between the number of elements of tab which contains all
pin desc (located in each pinctrl-stm32xxxx.c files) and the pin number
(defined in the tab).

Signed-off-by: Alexandre TORGUE <redacted>

diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index d3c5f5d..8be7ebd 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -411,11 +411,6 @@ static int stm32_pctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
 		pin = STM32_GET_PIN_NO(pinfunc);
 		func = STM32_GET_PIN_FUNC(pinfunc);
 
-		if (pin >= pctl->match_data->npins) {
-			dev_err(pctl->dev, "invalid pin number.\n");
-			return -EINVAL;
-		}
-
 		if (!stm32_pctrl_is_function_valid(pctl, pin, func)) {
 			dev_err(pctl->dev, "invalid function.\n");
 			return -EINVAL;
-- 
1.9.1
```

## Re: \[PATCH\] pinctrl: stm32: remove useless check

- From: Linus Walleij \<hidden\>
- Date: 2017-06-09 08:03:49 
- Message: https://ratatoskr.run/linux-devicetree/2017/06/5016992.md

```text
On Wed, May 31, 2017 at 11:10 AM, Alexandre TORGUE
[ref] wrote:

> There is no link between the number of elements of tab which contains all
> pin desc (located in each pinctrl-stm32xxxx.c files) and the pin number
> (defined in the tab).
>
> Signed-off-by: Alexandre TORGUE <redacted>

Patch applied.

Yours,
Linus Walleij
```
