watchdog: sbc_fitpc2_wdt: fixed I/O operations order
[safe/jmp/linux-2.6] / drivers / watchdog / mpcore_wdt.c
index 1512ab8..016c6a7 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
 #include <linux/uaccess.h>
+#include <linux/slab.h>
 
 #include <asm/hardware/arm_twd.h>
 
@@ -61,7 +62,9 @@ MODULE_PARM_DESC(nowayout,
 #define ONLY_TESTING   0
 static int mpcore_noboot = ONLY_TESTING;
 module_param(mpcore_noboot, int, 0);
-MODULE_PARM_DESC(mpcore_noboot, "MPcore watchdog action, set to 1 to ignore reboots, 0 to reboot (default=" __MODULE_STRING(ONLY_TESTING) ")");
+MODULE_PARM_DESC(mpcore_noboot, "MPcore watchdog action, "
+       "set to 1 to ignore reboots, 0 to reboot (default="
+                                       __MODULE_STRING(ONLY_TESTING) ")");
 
 /*
  *     This is the interrupt handler.  Note that we only use this
@@ -211,7 +214,7 @@ static ssize_t mpcore_wdt_write(struct file *file, const char *data,
        return len;
 }
 
-static struct watchdog_info ident = {
+static const struct watchdog_info ident = {
        .options                = WDIOF_SETTIMEOUT |
                                  WDIOF_KEEPALIVEPING |
                                  WDIOF_MAGICCLOSE,
@@ -348,7 +351,7 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev)
                ret = -ENXIO;
                goto err_free;
        }
-       wdt->base = ioremap(res->start, res->end - res->start + 1);
+       wdt->base = ioremap(res->start, resource_size(res));
        if (!wdt->base) {
                ret = -ENOMEM;
                goto err_free;
@@ -416,7 +419,8 @@ static struct platform_driver mpcore_wdt_driver = {
        },
 };
 
-static char banner[] __initdata = KERN_INFO "MPcore Watchdog Timer: 0.1. mpcore_noboot=%d mpcore_margin=%d sec (nowayout= %d)\n";
+static char banner[] __initdata = KERN_INFO "MPcore Watchdog Timer: 0.1. "
+               "mpcore_noboot=%d mpcore_margin=%d sec (nowayout= %d)\n";
 
 static int __init mpcore_wdt_init(void)
 {