]> err.no Git - linux-2.6/blobdiff - drivers/watchdog/geodewdt.c
[WATCHDOG] sbc8360.c - move stop code into a function
[linux-2.6] / drivers / watchdog / geodewdt.c
index 30d09cbbad949beeeee573bc0a31724dc38d8619..04b861cfdf0c9249a544bf2ac7059eebb7f521eb 100644 (file)
@@ -17,8 +17,8 @@
 #include <linux/fs.h>
 #include <linux/platform_device.h>
 #include <linux/reboot.h>
+#include <linux/uaccess.h>
 
-#include <asm/uaccess.h>
 #include <asm/geode.h>
 
 #define GEODEWDT_HZ 500
@@ -149,7 +149,7 @@ geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                .identity =             WATCHDOG_NAME,
         };
 
-       switch(cmd) {
+       switch (cmd) {
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &ident,
                                    sizeof(ident)) ? -EFAULT : 0;
@@ -159,22 +159,6 @@ geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
 
-       case WDIOC_KEEPALIVE:
-               geodewdt_ping();
-               return 0;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(interval, p))
-                       return -EFAULT;
-
-               if (geodewdt_set_heartbeat(interval))
-                       return -EINVAL;
-
-/* Fall through */
-
-       case WDIOC_GETTIMEOUT:
-               return put_user(timeout, p);
-
        case WDIOC_SETOPTIONS:
        {
                int options, ret = -EINVAL;
@@ -194,6 +178,20 @@ geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
                return ret;
        }
+       case WDIOC_KEEPALIVE:
+               geodewdt_ping();
+               return 0;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(interval, p))
+                       return -EFAULT;
+
+               if (geodewdt_set_heartbeat(interval))
+                       return -EINVAL;
+       /* Fall through */
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout, p);
+
        default:
                return -ENOTTY;
        }