PM / Sleep: Add more wakeup source initialization routines
[linux-2.6.git] / drivers / watchdog / alim7101_wdt.c
index c495f36..46f4b85 100644 (file)
@@ -31,9 +31,9 @@
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/pci.h>
-
 #include <linux/io.h>
 #include <linux/uaccess.h>
+
 #include <asm/system.h>
 
 #define OUR_NAME "alim7101_wdt"
@@ -125,7 +125,7 @@ static void wdt_timer_ping(unsigned long data)
 
 static void wdt_change(int writeval)
 {
-       char    tmp;
+       char tmp;
 
        pci_read_config_byte(alim7101_pmu, ALI_7101_WDT, &tmp);
        if (writeval == WDT_ENABLE) {
@@ -198,7 +198,7 @@ static ssize_t fop_write(struct file *file, const char __user *buf,
                        /* now scan */
                        for (ofs = 0; ofs != count; ofs++) {
                                char c;
-                               if (get_user(c, buf+ofs))
+                               if (get_user(c, buf + ofs))
                                        return -EFAULT;
                                if (c == 'V')
                                        wdt_expect_close = 42;
@@ -238,7 +238,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
-       static struct watchdog_info ident = {
+       static const struct watchdog_info ident = {
                .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT
                                                        | WDIOF_MAGICCLOSE,
                .firmware_version = 1,
@@ -251,9 +251,6 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        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;
@@ -270,6 +267,9 @@ static long 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;
@@ -322,7 +322,8 @@ static int wdt_notify_sys(struct notifier_block *this,
                 * watchdog on reboot with no heartbeat
                 */
                wdt_change(WDT_ENABLE);
-               printk(KERN_INFO PFX "Watchdog timer is now enabled with no heartbeat - should reboot in ~1 second.\n");
+               printk(KERN_INFO PFX "Watchdog timer is now enabled "
+                       "with no heartbeat - should reboot in ~1 second.\n");
        }
        return NOTIFY_DONE;
 }
@@ -355,7 +356,8 @@ static int __init alim7101_wdt_init(void)
        alim7101_pmu = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,
                NULL);
        if (!alim7101_pmu) {
-               printk(KERN_INFO PFX "ALi M7101 PMU not present - WDT not set\n");
+               printk(KERN_INFO PFX
+                       "ALi M7101 PMU not present - WDT not set\n");
                return -EBUSY;
        }
 
@@ -373,12 +375,17 @@ static int __init alim7101_wdt_init(void)
        pci_dev_put(ali1543_south);
        if ((tmp & 0x1e) == 0x00) {
                if (!use_gpio) {
-                       printk(KERN_INFO PFX "Detected old alim7101 revision 'a1d'.  If this is a cobalt board, set the 'use_gpio' module parameter.\n");
+                       printk(KERN_INFO PFX
+                               "Detected old alim7101 revision 'a1d'.  "
+                               "If this is a cobalt board, set the 'use_gpio' "
+                               "module parameter.\n");
                        goto err_out;
                }
                nowayout = 1;
        } else if ((tmp & 0x1e) != 0x12 && (tmp & 0x1e) != 0x00) {
-               printk(KERN_INFO PFX "ALi 1543 South-Bridge does not have the correct revision number (???1001?) - WDT not set\n");
+               printk(KERN_INFO PFX
+                       "ALi 1543 South-Bridge does not have the correct "
+                       "revision number (???1001?) - WDT not set\n");
                goto err_out;
        }
 
@@ -399,7 +406,8 @@ static int __init alim7101_wdt_init(void)
 
        rc = misc_register(&wdt_miscdev);
        if (rc) {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+               printk(KERN_ERR PFX
+                       "cannot register miscdev on minor=%d (err=%d)\n",
                        wdt_miscdev.minor, rc);
                goto err_out_reboot;
        }
@@ -407,7 +415,8 @@ static int __init alim7101_wdt_init(void)
        if (nowayout)
                __module_get(THIS_MODULE);
 
-       printk(KERN_INFO PFX "WDT driver for ALi M7101 initialised. timeout=%d sec (nowayout=%d)\n",
+       printk(KERN_INFO PFX "WDT driver for ALi M7101 initialised. "
+                                       "timeout=%d sec (nowayout=%d)\n",
                timeout, nowayout);
        return 0;
 
@@ -421,7 +430,7 @@ err_out:
 module_init(alim7101_wdt_init);
 module_exit(alim7101_wdt_unload);
 
-static struct pci_device_id alim7101_pci_tbl[] __devinitdata = {
+static DEFINE_PCI_DEVICE_TABLE(alim7101_pci_tbl) __used = {
        { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533) },
        { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) },
        { }