Skip to content

Commit

Permalink
clocksource/drivers/fttmr010: Fix the clock handling
Browse files Browse the repository at this point in the history
We need to also prepare and enable the clock we are using to get
the right reference count and avoid it being shut off.

Tested-by: Jonas Jensen <jonas.jensen@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
  • Loading branch information
Linus Walleij authored and Daniel Lezcano committed Jun 12, 2017
1 parent 164a1a9 commit 2a55e98
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/clocksource/timer-fttmr010.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,18 @@ static int __init fttmr010_timer_of_init(struct device_node *np)
* and using EXTCLK is not supported in the driver.
*/
struct clk *clk;
int ret;

clk = of_clk_get_by_name(np, "PCLK");
if (IS_ERR(clk)) {
pr_err("could not get PCLK");
pr_err("could not get PCLK\n");
return PTR_ERR(clk);
}
ret = clk_prepare_enable(clk);
if (ret) {
pr_err("failed to enable PCLK\n");
return ret;
}
tick_rate = clk_get_rate(clk);

return fttmr010_timer_common_init(np);
Expand Down

0 comments on commit 2a55e98

Please sign in to comment.