summaryrefslogtreecommitdiff
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2020-10-29 15:33:15 +0300
committerDaniel Lezcano <daniel.lezcano@linaro.org>2020-12-03 21:16:17 +0300
commit9d4965eb438f0c9f93e91ce6bfec72bbb8def988 (patch)
treeabc9c0b39d7d74945742fcbc1c1aa264ca883cfe /drivers/clocksource
parent3c07bf0fc3558f680374f8ac6d148b0082aa08c6 (diff)
downloadlinux-9d4965eb438f0c9f93e91ce6bfec72bbb8def988.tar.xz
clocksource/drivers/sp804: Use clk_prepare_enable and clk_disable_unprepare
Directly use clk_prepare_enable and clk_disable_unprepare. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20201029123317.90286-3-wangkefeng.wang@huawei.com
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/timer-sp804.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/clocksource/timer-sp804.c b/drivers/clocksource/timer-sp804.c
index 22a68cb83cf3..d74788b47802 100644
--- a/drivers/clocksource/timer-sp804.c
+++ b/drivers/clocksource/timer-sp804.c
@@ -68,17 +68,9 @@ static long __init sp804_get_clock_rate(struct clk *clk, const char *name)
return PTR_ERR(clk);
}
- err = clk_prepare(clk);
- if (err) {
- pr_err("sp804: clock failed to prepare: %d\n", err);
- clk_put(clk);
- return err;
- }
-
- err = clk_enable(clk);
+ err = clk_prepare_enable(clk);
if (err) {
pr_err("sp804: clock failed to enable: %d\n", err);
- clk_unprepare(clk);
clk_put(clk);
return err;
}
@@ -86,8 +78,7 @@ static long __init sp804_get_clock_rate(struct clk *clk, const char *name)
rate = clk_get_rate(clk);
if (rate < 0) {
pr_err("sp804: clock failed to get rate: %ld\n", rate);
- clk_disable(clk);
- clk_unprepare(clk);
+ clk_disable_unprepare(clk);
clk_put(clk);
}