linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio: mb86s7x: Handle return value of clk_prepare_enable.
@ 2017-08-01  6:43 Arvind Yadav
  2017-08-01  6:44 ` [PATCH 2/2] gpio: omap : Add missing clk_unprepare() Arvind Yadav
  2017-08-07  9:08 ` [PATCH 1/2] gpio: mb86s7x: Handle return value of clk_prepare_enable Linus Walleij
  0 siblings, 2 replies; 5+ messages in thread
From: Arvind Yadav @ 2017-08-01  6:43 UTC (permalink / raw)
  To: linus.walleij; +Cc: linux-gpio, linux-kernel

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

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] gpio: omap : Add missing clk_unprepare().
  2017-08-01  6:43 [PATCH 1/2] gpio: mb86s7x: Handle return value of clk_prepare_enable Arvind Yadav
@ 2017-08-01  6:44 ` Arvind Yadav
  2017-08-01 19:40   ` Grygorii Strashko
  2017-08-07 11:58   ` Linus Walleij
  2017-08-07  9:08 ` [PATCH 1/2] gpio: mb86s7x: Handle return value of clk_prepare_enable Linus Walleij
  1 sibling, 2 replies; 5+ messages in thread
From: Arvind Yadav @ 2017-08-01  6:44 UTC (permalink / raw)
  To: grygorii.strashko, ssantosh, khilman, linus.walleij
  Cc: linux-omap, linux-gpio, linux-kernel

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

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] gpio: omap : Add missing clk_unprepare().
  2017-08-01  6:44 ` [PATCH 2/2] gpio: omap : Add missing clk_unprepare() Arvind Yadav
@ 2017-08-01 19:40   ` Grygorii Strashko
  2017-08-07 11:58   ` Linus Walleij
  1 sibling, 0 replies; 5+ messages in thread
From: Grygorii Strashko @ 2017-08-01 19:40 UTC (permalink / raw)
  To: Arvind Yadav, ssantosh, khilman, linus.walleij
  Cc: linux-omap, linux-gpio, linux-kernel



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 <arvind.yadav.cs@gmail.com>
> ---
>   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 <grygorii.strashko@ti.com>

-- 
regards,
-grygorii

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] gpio: mb86s7x: Handle return value of clk_prepare_enable.
  2017-08-01  6:43 [PATCH 1/2] gpio: mb86s7x: Handle return value of clk_prepare_enable Arvind Yadav
  2017-08-01  6:44 ` [PATCH 2/2] gpio: omap : Add missing clk_unprepare() Arvind Yadav
@ 2017-08-07  9:08 ` Linus Walleij
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2017-08-07  9:08 UTC (permalink / raw)
  To: Arvind Yadav; +Cc: linux-gpio, linux-kernel

On Tue, Aug 1, 2017 at 8:43 AM, Arvind Yadav <arvind.yadav.cs@gmail.com> wrote:

> clk_prepare_enable() can fail here and we must check its return value.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] gpio: omap : Add missing clk_unprepare().
  2017-08-01  6:44 ` [PATCH 2/2] gpio: omap : Add missing clk_unprepare() Arvind Yadav
  2017-08-01 19:40   ` Grygorii Strashko
@ 2017-08-07 11:58   ` Linus Walleij
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2017-08-07 11:58 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: Grygorii Strashko, Santosh Shilimkar, Kevin Hilman, Linux-OMAP,
	linux-gpio, linux-kernel

On Tue, Aug 1, 2017 at 8:44 AM, Arvind Yadav <arvind.yadav.cs@gmail.com> wrote:

> omap_gpio_probe() can fail here and we must disable clock.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Patch applied with Grygorii's ACK.

yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-08-07 11:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-01  6:43 [PATCH 1/2] gpio: mb86s7x: Handle return value of clk_prepare_enable Arvind Yadav
2017-08-01  6:44 ` [PATCH 2/2] gpio: omap : Add missing clk_unprepare() Arvind Yadav
2017-08-01 19:40   ` Grygorii Strashko
2017-08-07 11:58   ` Linus Walleij
2017-08-07  9:08 ` [PATCH 1/2] gpio: mb86s7x: Handle return value of clk_prepare_enable Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).