2017-08-01 06:43:32

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 1/2] gpio: mb86s7x: Handle return value of clk_prepare_enable.

clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/gpio/gpio-mb86s7x.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mb86s7x.c b/drivers/gpio/gpio-mb86s7x.c
index ffb73f6..94d7726 100644
--- a/drivers/gpio/gpio-mb86s7x.c
+++ b/drivers/gpio/gpio-mb86s7x.c
@@ -168,7 +168,9 @@ static int mb86s70_gpio_probe(struct platform_device *pdev)
if (IS_ERR(gchip->clk))
return PTR_ERR(gchip->clk);

- clk_prepare_enable(gchip->clk);
+ ret = clk_prepare_enable(gchip->clk);
+ if (ret)
+ return ret;

spin_lock_init(&gchip->lock);

--
1.9.1


2017-08-01 06:44:49

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 2/2] gpio: omap : Add missing clk_unprepare().

omap_gpio_probe() can fail here and we must disable clock.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/gpio/gpio-omap.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index f8c550de..dbf869f 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1247,6 +1247,8 @@ static int omap_gpio_probe(struct platform_device *pdev)
if (ret) {
pm_runtime_put_sync(dev);
pm_runtime_disable(dev);
+ if (bank->dbck_flag)
+ clk_unprepare(bank->dbck);
return ret;
}

--
1.9.1

2017-08-01 19:40:15

by Grygorii Strashko

[permalink] [raw]
Subject: Re: [PATCH 2/2] gpio: omap : Add missing clk_unprepare().



On 08/01/2017 01:44 AM, Arvind Yadav wrote:
> omap_gpio_probe() can fail here and we must disable clock.
>
> Signed-off-by: Arvind Yadav <[email protected]>
> ---
> drivers/gpio/gpio-omap.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index f8c550de..dbf869f 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -1247,6 +1247,8 @@ static int omap_gpio_probe(struct platform_device *pdev)
> if (ret) {
> pm_runtime_put_sync(dev);
> pm_runtime_disable(dev);
> + if (bank->dbck_flag)
> + clk_unprepare(bank->dbck);
> return ret;
> }
>
>

Reviewed-by: Grygorii Strashko <[email protected]>

--
regards,
-grygorii

2017-08-07 09:08:48

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 1/2] gpio: mb86s7x: Handle return value of clk_prepare_enable.

On Tue, Aug 1, 2017 at 8:43 AM, Arvind Yadav <[email protected]> wrote:

> clk_prepare_enable() can fail here and we must check its return value.
>
> Signed-off-by: Arvind Yadav <[email protected]>

Patch applied.

Yours,
Linus Walleij

2017-08-07 11:58:14

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 2/2] gpio: omap : Add missing clk_unprepare().

On Tue, Aug 1, 2017 at 8:44 AM, Arvind Yadav <[email protected]> wrote:

> omap_gpio_probe() can fail here and we must disable clock.
>
> Signed-off-by: Arvind Yadav <[email protected]>

Patch applied with Grygorii's ACK.

yours,
Linus Walleij