summaryrefslogtreecommitdiffstats
path: root/drivers/amba/bus.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-09-22 12:20:55 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-09-27 09:25:51 +0100
commitac3e2fa6770052a82d42fc4db194a27317518c97 (patch)
treeeb7ebc48ec1e1a7df9e4808903c621468be6ac41 /drivers/amba/bus.c
parent40d3e0f4942ec12c4521fe1b2a2b774164cd2c80 (diff)
downloadlinux-ac3e2fa6770052a82d42fc4db194a27317518c97.tar.bz2
clk: amba bus: convert to clk_prepare()/clk_unprepare()
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/amba/bus.c')
-rw-r--r--drivers/amba/bus.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index 84bdaace56c8..bd230e801131 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -460,9 +460,17 @@ static int amba_get_enable_pclk(struct amba_device *pcdev)
if (IS_ERR(pclk))
return PTR_ERR(pclk);
+ ret = clk_prepare(pclk);
+ if (ret) {
+ clk_put(pclk);
+ return ret;
+ }
+
ret = clk_enable(pclk);
- if (ret)
+ if (ret) {
+ clk_unprepare(pclk);
clk_put(pclk);
+ }
return ret;
}
@@ -472,6 +480,7 @@ static void amba_put_disable_pclk(struct amba_device *pcdev)
struct clk *pclk = pcdev->pclk;
clk_disable(pclk);
+ clk_unprepare(pclk);
clk_put(pclk);
}