2013-05-23 09:32:17

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH -next] pinctrl: sunxi: fix error return code in sunxi_pinctrl_probe()

From: Wei Yongjun <[email protected]>

Fix to return a negative error code from the devm_clk_get() error
handling case instead of 0, as done elsewhere in this function.

Introduced by commit 950707c0eb5c7aeaa2c446a04c824f4be686d2f6
(pinctrl: sunxi: add clock support)

Signed-off-by: Wei Yongjun <[email protected]>
---
drivers/pinctrl/pinctrl-sunxi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c
index c058529..b7d8c89 100644
--- a/drivers/pinctrl/pinctrl-sunxi.c
+++ b/drivers/pinctrl/pinctrl-sunxi.c
@@ -1990,8 +1990,10 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev)
}

clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(clk))
+ if (IS_ERR(clk)) {
+ ret = PTR_ERR(clk);
goto gpiochip_error;
+ }

clk_prepare_enable(clk);


2013-05-24 09:23:07

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH -next] pinctrl: sunxi: fix error return code in sunxi_pinctrl_probe()

On Thu, May 23, 2013 at 11:32 AM, Wei Yongjun <[email protected]> wrote:

> From: Wei Yongjun <[email protected]>
>
> Fix to return a negative error code from the devm_clk_get() error
> handling case instead of 0, as done elsewhere in this function.
>
> Introduced by commit 950707c0eb5c7aeaa2c446a04c824f4be686d2f6
> (pinctrl: sunxi: add clock support)
>
> Signed-off-by: Wei Yongjun <[email protected]>

Patch applied for fixes, thanks!

Maxime: OK?

Yours,
Linus Walleij

2013-05-24 09:34:48

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH -next] pinctrl: sunxi: fix error return code in sunxi_pinctrl_probe()

Hi Linus,

On Fri, May 24, 2013 at 11:23:04AM +0200, Linus Walleij wrote:
> On Thu, May 23, 2013 at 11:32 AM, Wei Yongjun <[email protected]> wrote:
>
> > From: Wei Yongjun <[email protected]>
> >
> > Fix to return a negative error code from the devm_clk_get() error
> > handling case instead of 0, as done elsewhere in this function.
> >
> > Introduced by commit 950707c0eb5c7aeaa2c446a04c824f4be686d2f6
> > (pinctrl: sunxi: add clock support)
> >
> > Signed-off-by: Wei Yongjun <[email protected]>
>
> Patch applied for fixes, thanks!
>
> Maxime: OK?

Yes, everything's fine for me.

Thanks!
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com