Skip to content

Commit

Permalink
clk: timer-sp: 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 72ae00c commit 6f5ad96
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/arm/common/timer-sp.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,17 @@ static long __init sp804_get_clock_rate(const char *name)
return PTR_ERR(clk);
}

err = clk_prepare(clk);
if (err) {
pr_err("sp804: %s clock failed to prepare: %d\n", name, err);
clk_put(clk);
return err;
}

err = clk_enable(clk);
if (err) {
pr_err("sp804: %s clock failed to enable: %d\n", name, err);
clk_unprepare(clk);
clk_put(clk);
return err;
}
Expand All @@ -52,6 +60,7 @@ static long __init sp804_get_clock_rate(const char *name)
if (rate < 0) {
pr_err("sp804: %s clock failed to get rate: %ld\n", name, rate);
clk_disable(clk);
clk_unprepare(clk);
clk_put(clk);
}

Expand Down

0 comments on commit 6f5ad96

Please sign in to comment.