]> err.no Git - linux-2.6/blobdiff - drivers/watchdog/sc520_wdt.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6] / drivers / watchdog / sc520_wdt.c
index 525555a8779caa96c5636db2abbbd41a9b8c71d1..a2b6c1067ec573a7cca41a66c7d28ef8e9f789e4 100644 (file)
@@ -279,7 +279,7 @@ static int fop_close(struct inode *inode, struct file *file)
        return 0;
 }
 
-static int fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
@@ -290,18 +290,12 @@ static int fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                .identity = "SC520",
        };
 
-       switch (cmd)
-       {
-       default:
-               return -ENOTTY;
+       switch (cmd) {
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
-       case WDIOC_KEEPALIVE:
-               wdt_keepalive();
-               return 0;
        case WDIOC_SETOPTIONS:
        {
                int new_options, retval = -EINVAL;
@@ -321,6 +315,9 @@ static int fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               wdt_keepalive();
+               return 0;
        case WDIOC_SETTIMEOUT:
        {
                int new_timeout;
@@ -336,6 +333,8 @@ static int fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        }
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
+       default:
+               return -ENOTTY;
        }
 }
 
@@ -345,7 +344,7 @@ static const struct file_operations wdt_fops = {
        .write          = fop_write,
        .open           = fop_open,
        .release        = fop_close,
-       .ioctl          = fop_ioctl,
+       .unlocked_ioctl = fop_ioctl,
 };
 
 static struct miscdevice wdt_miscdev = {