Permalink
Browse files

clk: amba bus: convert to clk_prepare()/clk_unprepare()

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information...
Russell King
Russell King committed Sep 22, 2011
1 parent 40d3e0f commit ac3e2fa6770052a82d42fc4db194a27317518c97
Showing with 10 additions and 1 deletion.
  1. +10 −1 drivers/amba/bus.c
View
@@ -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);
}

0 comments on commit ac3e2fa

Please sign in to comment.