drm: fix irq naming for kms drivers.
[safe/jmp/linux-2.6] / drivers / watchdog / at91rm9200_wdt.c
index bb79f64..29e52c2 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/init.h>
+#include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/miscdevice.h>
 #include <linux/module.h>
@@ -21,8 +22,7 @@
 #include <linux/types.h>
 #include <linux/watchdog.h>
 #include <linux/uaccess.h>
-#include <asm/arch/at91_st.h>
-
+#include <mach/at91_st.h>
 
 #define WDT_DEFAULT_TIME       5       /* seconds */
 #define WDT_MAX_TIME           256     /* seconds */
@@ -107,10 +107,10 @@ static int at91_wdt_close(struct inode *inode, struct file *file)
 static int at91_wdt_settimeout(int new_time)
 {
        /*
-        * All counting occurs at SLOW_CLOCK / 128 = 0.256 Hz
+        * All counting occurs at SLOW_CLOCK / 128 = 256 Hz
         *
         * Since WDV is a 16-bit counter, the maximum period is
-        * 65536 / 0.256 = 256 seconds.
+        * 65536 / 256 = 256 seconds.
         */
        if ((new_time <= 0) || (new_time > WDT_MAX_TIME))
                return -EINVAL;
@@ -129,7 +129,7 @@ static struct watchdog_info at91_wdt_info = {
 /*
  * Handle commands from user-space.
  */
-static long at91_wdt_ioct(struct file *file,
+static long at91_wdt_ioctl(struct file *file,
                                        unsigned int cmd, unsigned long arg)
 {
        void __user *argp = (void __user *)arg;
@@ -137,23 +137,9 @@ static long at91_wdt_ioct(struct file *file,
        int new_value;
 
        switch (cmd) {
-       case WDIOC_KEEPALIVE:
-               at91_wdt_reload();      /* pat the watchdog */
-               return 0;
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &at91_wdt_info,
                                sizeof(at91_wdt_info)) ? -EFAULT : 0;
-       case WDIOC_SETTIMEOUT:
-               if (get_user(new_value, p))
-                       return -EFAULT;
-               if (at91_wdt_settimeout(new_value))
-                       return -EINVAL;
-               /* Enable new time value */
-               at91_wdt_start();
-               /* Return current value */
-               return put_user(wdt_time, p);
-       case WDIOC_GETTIMEOUT:
-               return put_user(wdt_time, p);
        case WDIOC_GETSTATUS:
        case WDIOC_GETBOOTSTATUS:
                return put_user(0, p);
@@ -165,6 +151,20 @@ static long at91_wdt_ioct(struct file *file,
                if (new_value & WDIOS_ENABLECARD)
                        at91_wdt_start();
                return 0;
+       case WDIOC_KEEPALIVE:
+               at91_wdt_reload();      /* pat the watchdog */
+               return 0;
+       case WDIOC_SETTIMEOUT:
+               if (get_user(new_value, p))
+                       return -EFAULT;
+               if (at91_wdt_settimeout(new_value))
+                       return -EINVAL;
+               /* Enable new time value */
+               at91_wdt_start();
+               /* Return current value */
+               return put_user(wdt_time, p);
+       case WDIOC_GETTIMEOUT:
+               return put_user(wdt_time, p);
        default:
                return -ENOTTY;
        }
@@ -197,7 +197,7 @@ static struct miscdevice at91wdt_miscdev = {
        .fops           = &at91wdt_fops,
 };
 
-static int __init at91wdt_probe(struct platform_device *pdev)
+static int __devinit at91wdt_probe(struct platform_device *pdev)
 {
        int res;
 
@@ -214,7 +214,7 @@ static int __init at91wdt_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int __exit at91wdt_remove(struct platform_device *pdev)
+static int __devexit at91wdt_remove(struct platform_device *pdev)
 {
        int res;
 
@@ -242,7 +242,7 @@ static int at91wdt_resume(struct platform_device *pdev)
 {
        if (at91wdt_busy)
                at91_wdt_start();
-               return 0;
+       return 0;
 }
 
 #else
@@ -252,7 +252,7 @@ static int at91wdt_resume(struct platform_device *pdev)
 
 static struct platform_driver at91wdt_driver = {
        .probe          = at91wdt_probe,
-       .remove         = __exit_p(at91wdt_remove),
+       .remove         = __devexit_p(at91wdt_remove),
        .shutdown       = at91wdt_shutdown,
        .suspend        = at91wdt_suspend,
        .resume         = at91wdt_resume,