summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2020-10-29 20:33:16 +0800
committerDaniel Lezcano <daniel.lezcano@linaro.org>2020-12-03 19:16:17 +0100
commitdca54f8ce1c3c979caf06cfdcdf8eab05a00f5ff (patch)
treea09e3302c2fcc0bc95c17fe1e227ab56d084d0e9
parent9d4965eb438f0c9f93e91ce6bfec72bbb8def988 (diff)
clocksource/drivers/sp804: Correct clk_get_rate handle
clk_get_rate won't return negative value, correct clk_get_rate handle. 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-4-wangkefeng.wang@huawei.com
-rw-r--r--drivers/clocksource/timer-sp804.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/clocksource/timer-sp804.c b/drivers/clocksource/timer-sp804.c
index d74788b47802..fcce839670cb 100644
--- a/drivers/clocksource/timer-sp804.c
+++ b/drivers/clocksource/timer-sp804.c
@@ -58,7 +58,6 @@ static struct sp804_clkevt sp804_clkevt[NR_TIMERS];
static long __init sp804_get_clock_rate(struct clk *clk, const char *name)
{
- long rate;
int err;
if (!clk)
@@ -75,14 +74,7 @@ static long __init sp804_get_clock_rate(struct clk *clk, const char *name)
return err;
}
- rate = clk_get_rate(clk);
- if (rate < 0) {
- pr_err("sp804: clock failed to get rate: %ld\n", rate);
- clk_disable_unprepare(clk);
- clk_put(clk);
- }
-
- return rate;
+ return clk_get_rate(clk);
}
static struct sp804_clkevt * __init sp804_clkevt_get(void __iomem *base)