diff mbox series

pinctrl: stm32: Fix up errorpath after merge

Message ID 20220505142837.165499-1-linus.walleij@linaro.org
State Accepted
Commit f4b09d8d67efcc0620a9395b7a180bbd44066939
Headers show
Series pinctrl: stm32: Fix up errorpath after merge | expand

Commit Message

Linus Walleij May 5, 2022, 2:28 p.m. UTC
When merging the for_each_gpiochip_node() changes, I made
some mistakes by not disabling the clocks on the errorpath,
fix it up.

Fixes: a0912083086d ("Merge tag 'intel-gpio-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into devel")
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Fabien Dessenne <fabien.dessenne@foss.st.com>
Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/pinctrl/stm32/pinctrl-stm32.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Andy Shevchenko May 5, 2022, 6:08 p.m. UTC | #1
On Thu, May 05, 2022 at 04:28:37PM +0200, Linus Walleij wrote:
> When merging the for_each_gpiochip_node() changes, I made
> some mistakes by not disabling the clocks on the errorpath,
> fix it up.

At least this is what I found,

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

but I might have missed something, it would be nice if ST guys can look into
this as well.

> Fixes: a0912083086d ("Merge tag 'intel-gpio-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into devel")
> Cc: Stephen Rothwell <sfr@canb.auug.org.au>
> Cc: Fabien Dessenne <fabien.dessenne@foss.st.com>
> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/pinctrl/stm32/pinctrl-stm32.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
> index 0f7d608151ff..88da8ac0b252 100644
> --- a/drivers/pinctrl/stm32/pinctrl-stm32.c
> +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
> @@ -1614,6 +1614,10 @@ int stm32_pctl_probe(struct platform_device *pdev)
>  		ret = stm32_gpiolib_register_bank(pctl, child);
>  		if (ret) {
>  			fwnode_handle_put(child);
> +
> +			for (i = 0; i < pctl->nbanks; i++)
> +				clk_disable_unprepare(pctl->banks[i].clk);
> +
>  			return ret;
>  		}
>  
> -- 
> 2.35.1
>
Fabien DESSENNE May 6, 2022, 12:16 p.m. UTC | #2
Hi Andy & Linus,

I confirm that the merge fix is OK.

Fabien


ST Restricted

> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Sent: jeudi 5 mai 2022 20:09
> To: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-gpio@vger.kernel.org; Stephen Rothwell <sfr@canb.auug.org.au>;
> Fabien Dessenne <fabien.dessenne@foss.st.com>
> Subject: Re: [PATCH] pinctrl: stm32: Fix up errorpath after merge
> 
> On Thu, May 05, 2022 at 04:28:37PM +0200, Linus Walleij wrote:
> > When merging the for_each_gpiochip_node() changes, I made some
> > mistakes by not disabling the clocks on the errorpath, fix it up.
> 
> At least this is what I found,
> 
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> but I might have missed something, it would be nice if ST guys can look
into this
> as well.
> 
> > Fixes: a0912083086d ("Merge tag 'intel-gpio-v5.19-1' of
> > git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel
> > into devel")
> > Cc: Stephen Rothwell <sfr@canb.auug.org.au>
> > Cc: Fabien Dessenne <fabien.dessenne@foss.st.com>
> > Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> > ---
> >  drivers/pinctrl/stm32/pinctrl-stm32.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c
> > b/drivers/pinctrl/stm32/pinctrl-stm32.c
> > index 0f7d608151ff..88da8ac0b252 100644
> > --- a/drivers/pinctrl/stm32/pinctrl-stm32.c
> > +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
> > @@ -1614,6 +1614,10 @@ int stm32_pctl_probe(struct platform_device
> *pdev)
> >  		ret = stm32_gpiolib_register_bank(pctl, child);
> >  		if (ret) {
> >  			fwnode_handle_put(child);
> > +
> > +			for (i = 0; i < pctl->nbanks; i++)
> > +				clk_disable_unprepare(pctl->banks[i].clk);
> > +
> >  			return ret;
> >  		}
> >
> > --
> > 2.35.1
> >
> 
> --
> With Best Regards,
> Andy Shevchenko
>
diff mbox series

Patch

diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index 0f7d608151ff..88da8ac0b252 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -1614,6 +1614,10 @@  int stm32_pctl_probe(struct platform_device *pdev)
 		ret = stm32_gpiolib_register_bank(pctl, child);
 		if (ret) {
 			fwnode_handle_put(child);
+
+			for (i = 0; i < pctl->nbanks; i++)
+				clk_disable_unprepare(pctl->banks[i].clk);
+
 			return ret;
 		}