diff mbox series

[2/2] pinctrl: th1520: Fix return value for unknown pin error

Message ID 20241005-th1520-pinctrl-fixes-v1-2-5c65dffa0d00@tenstorrent.com (mailing list archive)
State Superseded
Headers show
Series pinctrl: th1520: Improve code quality | expand

Checks

Context Check Description
conchuod/vmtest-fixes-PR fail merge-conflict

Commit Message

Drew Fustini Oct. 5, 2024, 7:35 p.m. UTC
Fix th1520_pinctrl_dt_node_to_map() to a return value upon an unknown
pin error before jumping to free_configs.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202410022336.xyWlV0Tf-lkp@intel.com/
Signed-off-by: Drew Fustini <dfustini@tenstorrent.com>
---
 drivers/pinctrl/pinctrl-th1520.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Markus Elfring Oct. 6, 2024, 6:09 a.m. UTC | #1
> Fix th1520_pinctrl_dt_node_to_map() to a return value upon an unknown

                                      to return an error code?


> pin error before jumping to free_configs.> +++ b/drivers/pinctrl/pinctrl-th1520.c
> @@ -499,6 +499,7 @@ static int th1520_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
>  				nmaps = rollback;
>  				dev_err(thp->pctl->dev, "%pOFn.%pOFn: unknown pin '%s'\n",
>  					np, child, pinname);
> +				ret = -EINVAL;
>  				goto free_configs;
>  			}
…

Would you dare to support another jump target for this assignment statement?

Regards,
Markus
diff mbox series

Patch

diff --git a/drivers/pinctrl/pinctrl-th1520.c b/drivers/pinctrl/pinctrl-th1520.c
index d03a0a34220a..92834b6718b3 100644
--- a/drivers/pinctrl/pinctrl-th1520.c
+++ b/drivers/pinctrl/pinctrl-th1520.c
@@ -499,6 +499,7 @@  static int th1520_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
 				nmaps = rollback;
 				dev_err(thp->pctl->dev, "%pOFn.%pOFn: unknown pin '%s'\n",
 					np, child, pinname);
+				ret = -EINVAL;
 				goto free_configs;
 			}