diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2017-05-18 22:16:58 +0200 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2017-06-12 10:13:57 +0200 |
commit | 2a55e98f9f76825d78a4e6ef315c35fccabf5212 (patch) | |
tree | 73ced736a2116c123797a5434f0e07dbc0272f62 /drivers/clocksource/timer-fttmr010.c | |
parent | arm: aspeed: Add clock-names property to timer node (diff) | |
download | linux-2a55e98f9f76825d78a4e6ef315c35fccabf5212.tar.xz linux-2a55e98f9f76825d78a4e6ef315c35fccabf5212.zip |
clocksource/drivers/fttmr010: Fix the clock handling
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>
Diffstat (limited to 'drivers/clocksource/timer-fttmr010.c')
-rw-r--r-- | drivers/clocksource/timer-fttmr010.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/timer-fttmr010.c index b4a6f1e4bc54..58ce017e4a65 100644 --- a/drivers/clocksource/timer-fttmr010.c +++ b/drivers/clocksource/timer-fttmr010.c @@ -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); |