summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authordann frazier <dannf@hp.com>2010-06-02 16:23:39 -0600
committerWim Van Sebroeck <wim@iguana.be>2010-08-13 20:54:39 +0000
commite802e32d2b42ce1384baf4e150f444477729aad2 (patch)
treeabbbd57b0fdc0cac171bd68878ab8788915fced4 /drivers/watchdog
parent6b7f3d5321fef4c050073ae08ed9db6c83bb85f1 (diff)
downloadop-kernel-dev-e802e32d2b42ce1384baf4e150f444477729aad2.zip
op-kernel-dev-e802e32d2b42ce1384baf4e150f444477729aad2.tar.gz
watchdog: hpwdt (6/12): Introduce SECS_TO_TICKS() macro
Define a macro to convert from seconds to timer ticks. Signed-off-by: dann frazier <dannf@hp.com> Acked-by: Thomas Mingarelli <Thomas.Mingarelli@hp.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/hpwdt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 77ca72c..a5d36ae 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -35,6 +35,7 @@
#include <asm/cacheflush.h>
#define HPWDT_VERSION "1.1.1"
+#define SECS_TO_TICKS(secs) ((secs) * 1000 / 128)
#define DEFAULT_MARGIN 30
static unsigned int soft_margin = DEFAULT_MARGIN; /* in seconds */
@@ -410,7 +411,7 @@ static int __devinit detect_cru_service(void)
*/
static void hpwdt_start(void)
{
- reload = (soft_margin * 1000) / 128;
+ reload = SECS_TO_TICKS(soft_margin);
iowrite16(reload, hpwdt_timer_reg);
iowrite16(0x85, hpwdt_timer_con);
}
@@ -443,7 +444,7 @@ static int hpwdt_change_timer(int new_margin)
printk(KERN_DEBUG
"hpwdt: New timer passed in is %d seconds.\n",
new_margin);
- reload = (soft_margin * 1000) / 128;
+ reload = SECS_TO_TICKS(soft_margin);
return 0;
}
OpenPOWER on IntegriCloud