]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/watchdog/smsc37b787_wdt.c
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / watchdog / smsc37b787_wdt.c
index b7c6394b7d70ca6abe3e79c1909e5c96031b7a06..2e56cad77d19ae3e1cd0124eb45830f728407bbb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     SMsC 37B787 Watchdog Timer driver for Linux 2.6.x.x
  *
- *      Based on acquirewdt.c by Alan Cox <alan@redhat.com>
+ *     Based on acquirewdt.c by Alan Cox <alan@lxorguk.ukuu.org.uk>
  *       and some other existing drivers
  *
  *     This program is free software; you can redistribute it and/or
@@ -408,7 +408,7 @@ static ssize_t wb_smsc_wdt_write(struct file *file, const char __user *data,
                           magic character */
                        for (i = 0; i != len; i++) {
                                char c;
-                               if (get_user(c, data+i))
+                               if (get_user(c, data + i))
                                        return -EFAULT;
                                if (c == 'V')
                                        expect_close = 42;
@@ -438,7 +438,7 @@ static long wb_smsc_wdt_ioctl(struct file *file,
                                        WDIOF_SETTIMEOUT |
                                        WDIOF_MAGICCLOSE,
                .firmware_version =     0,
-               .identity =             "SMsC 37B787 Watchdog"
+               .identity =             "SMsC 37B787 Watchdog",
        };
 
        uarg.i = (int __user *)arg;
@@ -451,6 +451,23 @@ static long wb_smsc_wdt_ioctl(struct file *file,
                return put_user(wb_smsc_wdt_status(), uarg.i);
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, uarg.i);
+       case WDIOC_SETOPTIONS:
+       {
+               int options, retval = -EINVAL;
+
+               if (get_user(options, uarg.i))
+                       return -EFAULT;
+
+               if (options & WDIOS_DISABLECARD) {
+                       wb_smsc_wdt_disable();
+                       retval = 0;
+               }
+               if (options & WDIOS_ENABLECARD) {
+                       wb_smsc_wdt_enable();
+                       retval = 0;
+               }
+               return retval;
+       }
        case WDIOC_KEEPALIVE:
                wb_smsc_wdt_reset_timer();
                return 0;
@@ -470,23 +487,6 @@ static long wb_smsc_wdt_ioctl(struct file *file,
                if (unit == UNIT_MINUTE)
                          new_timeout *= 60;
                return put_user(new_timeout, uarg.i);
-       case WDIOC_SETOPTIONS:
-       {
-               int options, retval = -EINVAL;
-
-               if (get_user(options, uarg.i))
-                       return -EFAULT;
-
-               if (options & WDIOS_DISABLECARD) {
-                       wb_smsc_wdt_disable();
-                       retval = 0;
-               }
-               if (options & WDIOS_ENABLECARD) {
-                       wb_smsc_wdt_enable();
-                       retval = 0;
-               }
-               return retval;
-       }
        default:
                return -ENOTTY;
        }