All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] watchdog: sirf: don't depend on dummy value of CLOCK_TICK_RATE
@ 2013-11-11 20:33 Uwe Kleine-König
  0 siblings, 0 replies; only message in thread
From: Uwe Kleine-König @ 2013-11-11 20:33 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
 drivers/watchdog/sirfsoc_wdt.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c
index 3b8d739..ced3edc 100644
--- a/drivers/watchdog/sirfsoc_wdt.c
+++ b/drivers/watchdog/sirfsoc_wdt.c
@@ -14,6 +14,8 @@
 #include <linux/io.h>
 #include <linux/uaccess.h>
 
+#define CLOCK_FREQ	1000000
+
 #define SIRFSOC_TIMER_COUNTER_LO	0x0000
 #define SIRFSOC_TIMER_MATCH_0		0x0008
 #define SIRFSOC_TIMER_INT_EN		0x0024
@@ -50,7 +52,7 @@ static unsigned int sirfsoc_wdt_gettimeleft(struct watchdog_device *wdd)
 
 	time_left = match - counter;
 
-	return time_left / CLOCK_TICK_RATE;
+	return time_left / CLOCK_FREQ;
 }
 
 static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd)
@@ -58,7 +60,7 @@ static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd)
 	u32 counter, timeout_ticks;
 	void __iomem *wdt_base;
 
-	timeout_ticks = wdd->timeout * CLOCK_TICK_RATE;
+	timeout_ticks = wdd->timeout * CLOCK_FREQ;
 	wdt_base = watchdog_get_drvdata(wdd);
 
 	/* Enable the latch before reading the LATCH_LO register */
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-11 20:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-11 20:33 [PATCH] watchdog: sirf: don't depend on dummy value of CLOCK_TICK_RATE Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.