Patchwork [08/17] ARM: davinci: dm644x: WARN() if clk_get() fails

login
register
mail settings
Submitter Bartosz Golaszewski
Date Jan. 11, 2019, 5:21 p.m.
Message ID <20190111172134.30147-9-brgl@bgdev.pl>
Download mbox | patch
Permalink /patch/697927/
State New
Headers show

Comments

Bartosz Golaszewski - Jan. 11, 2019, 5:21 p.m.
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Currently the timer code checks if the clock pointer passed to it is
good (!IS_ERR(clk)). The new clocksource driver expects the clock to
be functional and doesn't perform any checks so emit a warning if
clk_get() fails.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/dm644x.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 38f92b7d413e..85d69ac1bd70 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -681,6 +681,7 @@  void __init dm644x_init_time(void)
 	dm644x_psc_init(NULL, psc);
 
 	clk = clk_get(NULL, "timer0");
+	WARN(IS_ERR(clk), "Unable to get the timer clock\n");
 
 	davinci_timer_init(clk);
 }