[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1352882265.12579.2.camel@phoenix>
Date: Wed, 14 Nov 2012 16:37:45 +0800
From: Axel Lin <axel.lin@...ics.com>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Viresh Kumar <viresh.kumar@...aro.org>, spear-devel@...t.st.com,
linux-kernel@...r.kernel.org
Subject: [PATCH] pinctrl: plgpio: Call clk_disable_unprepare only if
clk_prepare_enable is called
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@...ics.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists