Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

watchdog: sirf: don't depend on dummy value of CLOCK_TICK_RATE

As CSR SiRF is converted to multi platform CLOCK_TICK_RATE is a dummy
value that seems to match the right value is used.
(arch/arm/mach-prima2/include/mach/timex.h which defined CLOCK_TICK_RATE
to 1000000 was removed in commit cf82e0e (ARM: sirf: enable
multiplatform support); marco used the same file.)

To not depend on that dummy value use a local #define instead.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

authored by

Uwe Kleine-König and committed by
Wim Van Sebroeck
b0df38dd ab5bbdc7

+4 -2
+4 -2
drivers/watchdog/sirfsoc_wdt.c
··· 14 14 #include <linux/io.h> 15 15 #include <linux/uaccess.h> 16 16 17 + #define CLOCK_FREQ 1000000 18 + 17 19 #define SIRFSOC_TIMER_COUNTER_LO 0x0000 18 20 #define SIRFSOC_TIMER_MATCH_0 0x0008 19 21 #define SIRFSOC_TIMER_INT_EN 0x0024 ··· 52 50 53 51 time_left = match - counter; 54 52 55 - return time_left / CLOCK_TICK_RATE; 53 + return time_left / CLOCK_FREQ; 56 54 } 57 55 58 56 static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd) ··· 60 58 u32 counter, timeout_ticks; 61 59 void __iomem *wdt_base; 62 60 63 - timeout_ticks = wdd->timeout * CLOCK_TICK_RATE; 61 + timeout_ticks = wdd->timeout * CLOCK_FREQ; 64 62 wdt_base = watchdog_get_drvdata(wdd); 65 63 66 64 /* Enable the latch before reading the LATCH_LO register */