Skip to content

Commit

Permalink
clk: amba bus: convert to clk_prepare()/clk_unprepare()
Browse files Browse the repository at this point in the history
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Sep 27, 2011
1 parent 40d3e0f commit ac3e2fa
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/amba/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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);
}

Expand Down

0 comments on commit ac3e2fa

Please sign in to comment.