]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/watchdog/advantechwdt.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 / advantechwdt.c
index 220d238ee4277cdb61f56402c8eac1a6e437d5e9..a1d7856ea6e0adaccfd974b5aaddd52225fc2e6a 100644 (file)
@@ -6,8 +6,8 @@
  *     Based on acquirewdt.c which is based on wdt.c.
  *     Original copyright messages:
  *
- *     (c) Copyright 1996 Alan Cox <alan@redhat.com>, All Rights Reserved.
- *                             http://www.redhat.com
+ *     (c) Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>,
+ *                                             All Rights Reserved.
  *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
@@ -18,7 +18,7 @@
  *     warranty for any of this software. This material is provided
  *     "AS-IS" and at no charge.
  *
- *     (c) Copyright 1995    Alan Cox <alan@redhat.com>
+ *     (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>
  *
  *     14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
  *         Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
@@ -37,9 +37,9 @@
 #include <linux/ioport.h>
 #include <linux/platform_device.h>
 #include <linux/init.h>
+#include <linux/io.h>
+#include <linux/uaccess.h>
 
-#include <asm/io.h>
-#include <asm/uaccess.h>
 #include <asm/system.h>
 
 #define DRV_NAME "advantechwdt"
@@ -47,7 +47,8 @@
 #define WATCHDOG_NAME "Advantech WDT"
 #define WATCHDOG_TIMEOUT 60            /* 60 sec default timeout */
 
-static struct platform_device *advwdt_platform_device; /* the watchdog platform device */
+/* the watchdog platform device */
+static struct platform_device *advwdt_platform_device;
 static unsigned long advwdt_is_open;
 static char adv_expect_close;
 
@@ -120,7 +121,7 @@ static ssize_t advwdt_write(struct file *file, const char __user *buf,
 
                        for (i = 0; i != count; i++) {
                                char c;
-                               if (get_user(c, buf+i))
+                               if (get_user(c, buf + i))
                                        return -EFAULT;
                                if (c == 'V')
                                        adv_expect_close = 42;
@@ -152,19 +153,6 @@ static long advwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
 
-       case WDIOC_KEEPALIVE:
-               advwdt_ping();
-               break;
-
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_timeout, p))
-                       return -EFAULT;
-               if (advwdt_set_heartbeat(new_timeout))
-                       return -EINVAL;
-               advwdt_ping();
-               /* Fall */
-       case WDIOC_GETTIMEOUT:
-               return put_user(timeout, p);
        case WDIOC_SETOPTIONS:
        {
                int options, retval = -EINVAL;
@@ -181,6 +169,19 @@ static long advwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                }
                return retval;
        }
+       case WDIOC_KEEPALIVE:
+               advwdt_ping();
+               break;
+
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_timeout, p))
+                       return -EFAULT;
+               if (advwdt_set_heartbeat(new_timeout))
+                       return -EINVAL;
+               advwdt_ping();
+               /* Fall */
+       case WDIOC_GETTIMEOUT:
+               return put_user(timeout, p);
        default:
                return -ENOTTY;
        }
@@ -199,8 +200,7 @@ static int advwdt_open(struct inode *inode, struct file *file)
        return nonseekable_open(inode, file);
 }
 
-static int
-advwdt_close(struct inode *inode, struct file *file)
+static int advwdt_close(struct inode *inode, struct file *file)
 {
        if (adv_expect_close == 42) {
                advwdt_disable();
@@ -288,9 +288,9 @@ unreg_stop:
 static int __devexit advwdt_remove(struct platform_device *dev)
 {
        misc_deregister(&advwdt_miscdev);
-       release_region(wdt_start,1);
-       if(wdt_stop != wdt_start)
-               release_region(wdt_stop,1);
+       release_region(wdt_start, 1);
+       if (wdt_stop != wdt_start)
+               release_region(wdt_stop, 1);
 
        return 0;
 }
@@ -315,7 +315,8 @@ static int __init advwdt_init(void)
 {
        int err;
 
-       printk(KERN_INFO "WDT driver for Advantech single board computer initialising.\n");
+       printk(KERN_INFO
+            "WDT driver for Advantech single board computer initialising.\n");
 
        err = platform_driver_register(&advwdt_driver);
        if (err)