Commit 7898d62c authored by Dimitry Andric's avatar Dimitry Andric Committed by Linus Torvalds

[WATCHDOG] s3c2410_wdt.c-wdog-fix4.patch

This patch moves the tmr_margin assignment until after the check for a
correct timeout value. (Plus another minor cosmetic thing.)
parent fc5c13fc
...@@ -159,8 +159,6 @@ static int s3c2410wdt_set_heartbeat(int timeout) ...@@ -159,8 +159,6 @@ static int s3c2410wdt_set_heartbeat(int timeout)
if (timeout < 1) if (timeout < 1)
return -EINVAL; return -EINVAL;
tmr_margin = timeout;
/* I think someone must have missed a divide-by-2 in the 2410, /* I think someone must have missed a divide-by-2 in the 2410,
* as a divisor of 128 gives half the calculated delay... * as a divisor of 128 gives half the calculated delay...
*/ */
...@@ -188,6 +186,8 @@ static int s3c2410wdt_set_heartbeat(int timeout) ...@@ -188,6 +186,8 @@ static int s3c2410wdt_set_heartbeat(int timeout)
} }
} }
tmr_margin = timeout;
DBG("%s: timeout=%d, divisor=%d, count=%d (%08x)\n", DBG("%s: timeout=%d, divisor=%d, count=%d (%08x)\n",
__FUNCTION__, timeout, divisor, count, count/divisor); __FUNCTION__, timeout, divisor, count, count/divisor);
...@@ -396,7 +396,7 @@ static int s3c2410wdt_probe(struct device *dev) ...@@ -396,7 +396,7 @@ static int s3c2410wdt_probe(struct device *dev)
return -EINVAL; return -EINVAL;
} }
DBG("probe: mapped wdt_base=%px\n", wdt_base); DBG("probe: mapped wdt_base=%p\n", wdt_base);
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res == NULL) { if (res == NULL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment