watchdog: sbc_fitpc2_wdt: fixed "scheduling while atomic" bug.
[safe/jmp/linux-2.6] / drivers / watchdog / cpu5wdt.c
index ec324e5..edd3475 100644 (file)
@@ -154,14 +154,15 @@ static long cpu5wdt_ioctl(struct file *file, unsigned int cmd,
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
        unsigned int value;
-       static struct watchdog_info ident = {
+       static const struct watchdog_info ident = {
                .options = WDIOF_CARDRESET,
                .identity = "CPU5 WDT",
        };
 
        switch (cmd) {
-       case WDIOC_KEEPALIVE:
-               cpu5wdt_reset();
+       case WDIOC_GETSUPPORT:
+               if (copy_to_user(argp, &ident, sizeof(ident)))
+                       return -EFAULT;
                break;
        case WDIOC_GETSTATUS:
                value = inb(port + CPU5WDT_STATUS_REG);
@@ -169,10 +170,6 @@ static long cpu5wdt_ioctl(struct file *file, unsigned int cmd,
                return put_user(value, p);
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
-       case WDIOC_GETSUPPORT:
-               if (copy_to_user(argp, &ident, sizeof(ident)))
-                       return -EFAULT;
-               break;
        case WDIOC_SETOPTIONS:
                if (get_user(value, p))
                        return -EFAULT;
@@ -181,6 +178,9 @@ static long cpu5wdt_ioctl(struct file *file, unsigned int cmd,
                if (value & WDIOS_DISABLECARD)
                        cpu5wdt_stop();
                break;
+       case WDIOC_KEEPALIVE:
+               cpu5wdt_reset();
+               break;
        default:
                return -ENOTTY;
        }