All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: plgpio: Call clk_disable_unprepare only if clk_prepare_enable is called
@ 2012-11-14  8:37 Axel Lin
  2012-11-14  9:06 ` Viresh Kumar
  2012-11-15 11:34 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2012-11-14  8:37 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Viresh Kumar, spear-devel, linux-kernel

This driver allows clk_get() failure, and still work without it.
This patch adds !IS_ERR(plgpio->clk) checking in plgpio_request() error path
so we only call clk_disable_unprepare() if clk_prepare_enable() is called.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/pinctrl/spear/pinctrl-plgpio.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c
index 1044ad3..cf6d9c2 100644
--- a/drivers/pinctrl/spear/pinctrl-plgpio.c
+++ b/drivers/pinctrl/spear/pinctrl-plgpio.c
@@ -243,7 +243,8 @@ static int plgpio_request(struct gpio_chip *chip, unsigned offset)
 	return 0;
 
 err1:
-	clk_disable_unprepare(plgpio->clk);
+	if (!IS_ERR(plgpio->clk))
+		clk_disable_unprepare(plgpio->clk);
 err0:
 	pinctrl_free_gpio(gpio);
 	return ret;
-- 
1.7.9.5




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

* Re: [PATCH] pinctrl: plgpio: Call clk_disable_unprepare only if clk_prepare_enable is called
  2012-11-14  8:37 [PATCH] pinctrl: plgpio: Call clk_disable_unprepare only if clk_prepare_enable is called Axel Lin
@ 2012-11-14  9:06 ` Viresh Kumar
  2012-11-15 11:34 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2012-11-14  9:06 UTC (permalink / raw)
  To: Axel Lin; +Cc: Linus Walleij, spear-devel, linux-kernel

On 14 November 2012 14:07, Axel Lin <axel.lin@ingics.com> wrote:
> This driver allows clk_get() failure, and still work without it.
> This patch adds !IS_ERR(plgpio->clk) checking in plgpio_request() error path
> so we only call clk_disable_unprepare() if clk_prepare_enable() is called.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

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

* Re: [PATCH] pinctrl: plgpio: Call clk_disable_unprepare only if clk_prepare_enable is called
  2012-11-14  8:37 [PATCH] pinctrl: plgpio: Call clk_disable_unprepare only if clk_prepare_enable is called Axel Lin
  2012-11-14  9:06 ` Viresh Kumar
@ 2012-11-15 11:34 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2012-11-15 11:34 UTC (permalink / raw)
  To: Axel Lin; +Cc: Viresh Kumar, spear-devel, linux-kernel

On Wed, Nov 14, 2012 at 9:37 AM, Axel Lin <axel.lin@ingics.com> wrote:

> This driver allows clk_get() failure, and still work without it.
> This patch adds !IS_ERR(plgpio->clk) checking in plgpio_request() error path
> so we only call clk_disable_unprepare() if clk_prepare_enable() is called.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Applied with Viresh's ACK, thanks!

Yours,
Linus Walleij

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

end of thread, other threads:[~2012-11-15 11:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-14  8:37 [PATCH] pinctrl: plgpio: Call clk_disable_unprepare only if clk_prepare_enable is called Axel Lin
2012-11-14  9:06 ` Viresh Kumar
2012-11-15 11:34 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.