From patchwork Mon Nov 11 20:33:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 290486 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 728972C008E for ; Tue, 12 Nov 2013 07:34:40 +1100 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VfyBj-0003WB-Bg; Mon, 11 Nov 2013 20:34:23 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VfyBg-00044D-Uu; Mon, 11 Nov 2013 20:34:20 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VfyBd-00043W-Kt for linux-arm-kernel@lists.infradead.org; Mon, 11 Nov 2013 20:34:18 +0000 Received: from dude.hi.pengutronix.de ([2001:6f8:1178:2:21e:67ff:fe11:9c5c]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1VfyBB-0007Gh-WA; Mon, 11 Nov 2013 21:33:50 +0100 Received: from ukl by dude.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1VfyBB-0007ip-0f; Mon, 11 Nov 2013 21:33:49 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Wim Van Sebroeck , Barry Song Subject: [PATCH] watchdog: sirf: don't depend on dummy value of CLOCK_TICK_RATE Date: Mon, 11 Nov 2013 21:33:44 +0100 Message-Id: <1384202024-16811-1-git-send-email-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 1.8.4.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:6f8:1178:2:21e:67ff:fe11:9c5c X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131111_153418_008850_C410548D X-CRM114-Status: GOOD ( 15.45 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Russell King , kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org 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 --- 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 #include +#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 */