Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1644893

[PATCH 1/8 v2] clocksource/drivers/fttmr010: Fix the clock handling

From Linus Walleij <linus.walleij@linaro.org>
Newsgroups linux.kernel
Subject [PATCH 1/8 v2] clocksource/drivers/fttmr010: Fix the clock handling
Date 2017-05-18 22:20 +0200
Message-ID <tIA3T-8ln-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
ChangeLog v1->v2:
- Added Jonas' Tested-by, no functional changes.
---
 drivers/clocksource/timer-fttmr010.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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);
-- 
2.9.3

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 1/8 v2] clocksource/drivers/fttmr010: Fix the clock handling Linus Walleij <linus.walleij@linaro.org> - 2017-05-18 22:20 +0200
  [PATCH 6/8 v2] clocksource/drivers/fttmr010: Switch to use TIMER2 src Linus Walleij <linus.walleij@linaro.org> - 2017-05-18 22:20 +0200
  [PATCH 2/8 v2] clocksource/drivers/fttmr010: Merge FTTMR010 DT bindings Linus Walleij <linus.walleij@linaro.org> - 2017-05-18 22:20 +0200
    Re: [PATCH 2/8 v2] clocksource/drivers/fttmr010: Merge FTTMR010 DT bindings Joel Stanley <joel@jms.id.au> - 2017-05-19 07:20 +0200
  [PATCH 3/8 v2] clocksource/drivers/fttmr010: Drop Gemini specifics Linus Walleij <linus.walleij@linaro.org> - 2017-05-18 22:20 +0200

csiph-web