Commit dca54f8c authored by Kefeng Wang's avatar Kefeng Wang Committed by Daniel Lezcano
Browse files

clocksource/drivers/sp804: Correct clk_get_rate handle



clk_get_rate won't return negative value, correct clk_get_rate handle.

Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20201029123317.90286-4-wangkefeng.wang@huawei.com
parent 9d4965eb
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -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)