Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 14 Feb 2007 00:10:08 +0000 (16:10 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 14 Feb 2007 00:10:08 +0000 (16:10 -0800)
* master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog: (23 commits)
  [WATCHDOG] timers cleanup
  [WATCHDOG] ib700wdt.c - convert to platform_device part 2
  [WATCHDOG] ib700wdt.c - convert to platform_device
  [WATCHDOG] ib700wdt.c spinlock/WDIOC_SETOPTIONS changes
  [WATCHDOG] ib700wdt.c small clean-up's
  [WATCHDOG] ib700wdt.c clean-up init and exit routines
  [WATCHDOG] ib700_wdt.c stop + set_heartbeat operations
  [WATCHDOG] show default value for nowayout in module parameter
  [WATCHDOG] advantechwdt.c - convert to platform_device part 2
  [WATCHDOG] advantechwdt.c - convert to platform_device
  [WATCHDOG] advantechwdt.c - move set_heartbeat to a seperate function
  [WATCHDOG] advantechwdt.c - cleanup before platform_device patches
  [WATCHDOG] acquirewdt.c - convert to platform_device part 2
  [WATCHDOG] acquirewdt.c - convert to platform_device
  [WATCHDOG] acquirewdt.c - clean before platform_device patches
  [WATCHDOG] pcwd_usb.c - get heartbeat from dip switches
  [WATCHDOG] pcwd.c - e-mail adres update
  [WATCHDOG] pcwd_usb.c - get heartbeat from dip switches
  [WATCHDOG] pcwd_usb.c - document includes
  [WATCHDOG] pcwd_pci.c - spinlock fixes
  ...

1  2 
drivers/char/watchdog/alim7101_wdt.c
drivers/char/watchdog/iTCO_wdt.c
drivers/char/watchdog/machzwd.c
drivers/char/watchdog/pc87413_wdt.c
drivers/char/watchdog/pnx4008_wdt.c
drivers/char/watchdog/smsc37b787_wdt.c
drivers/char/watchdog/w83697hf_wdt.c

index e5b2c2ee292cb810470a55f71253fcdcb92c7a57,c195078688de7f80118ecc90aa14db6b7f6aaa38..67aed9f8c362e7a9f87f50aedf93717bad7c345b
@@@ -69,7 -69,7 +69,7 @@@ module_param(use_gpio, int, 0)
  MODULE_PARM_DESC(use_gpio, "Use the gpio watchdog.  (required by old cobalt boards)");
  
  static void wdt_timer_ping(unsigned long);
- static struct timer_list timer;
+ static DEFINE_TIMER(timer, wdt_timer_ping, 0, 1);
  static unsigned long next_heartbeat;
  static unsigned long wdt_is_open;
  static char wdt_expect_close;
@@@ -78,7 -78,7 +78,7 @@@ static struct pci_dev *alim7101_pmu
  static int nowayout = WATCHDOG_NOWAYOUT;
  module_param(nowayout, int, 0);
  MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
-                __stringify(CONFIG_WATCHDOG_NOWAYOUT) ")");
+                __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
  
  /*
   *    Whack the dog
@@@ -108,8 -108,7 +108,7 @@@ static void wdt_timer_ping(unsigned lon
                printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n");
        }
        /* Re-set the timer interval */
-       timer.expires = jiffies + WDT_INTERVAL;
-       add_timer(&timer);
+       mod_timer(&timer, jiffies + WDT_INTERVAL);
  }
  
  /*
@@@ -147,9 -146,7 +146,7 @@@ static void wdt_startup(void
        wdt_change(WDT_ENABLE);
  
        /* Start the timer */
-       timer.expires = jiffies + WDT_INTERVAL;
-       add_timer(&timer);
+       mod_timer(&timer, jiffies + WDT_INTERVAL);
  
        printk(KERN_INFO PFX "Watchdog timer is now enabled.\n");
  }
@@@ -380,10 -377,6 +377,6 @@@ static int __init alim7101_wdt_init(voi
                        timeout);
        }
  
-       init_timer(&timer);
-       timer.function = wdt_timer_ping;
-       timer.data = 1;
        rc = misc_register(&wdt_miscdev);
        if (rc) {
                printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
@@@ -417,8 -410,10 +410,8 @@@ module_init(alim7101_wdt_init)
  module_exit(alim7101_wdt_unload);
  
  static struct pci_device_id alim7101_pci_tbl[] __devinitdata = {
 -      { PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
 -        PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 -      { PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,
 -        PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 +      { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533) },
 +      { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) },
        { }
  };
  
index fd8a44a08cd3604c07d70d8cd4cef8cd7f757cd9,8b13dfab687f0407097b2baebc26d5241cca1561..3c9684ccd2f936ff248c6efc69abdb6025d90b03
@@@ -1,7 -1,7 +1,7 @@@
  /*
   *    intel TCO Watchdog Driver (Used in i82801 and i6300ESB chipsets)
   *
-  *    (c) Copyright 2006 Wim Van Sebroeck <wim@iguana.be>.
+  *    (c) Copyright 2006-2007 Wim Van Sebroeck <wim@iguana.be>.
   *
   *    This program is free software; you can redistribute it and/or
   *    modify it under the terms of the GNU General Public License
@@@ -49,7 -49,7 +49,7 @@@
  /* Module and version information */
  #define DRV_NAME        "iTCO_wdt"
  #define DRV_VERSION     "1.01"
- #define DRV_RELDATE     "11-Nov-2006"
+ #define DRV_RELDATE     "21-Jan-2007"
  #define PFX           DRV_NAME ": "
  
  /* Includes */
@@@ -187,7 -187,7 +187,7 @@@ MODULE_PARM_DESC(heartbeat, "Watchdog h
  
  static int nowayout = WATCHDOG_NOWAYOUT;
  module_param(nowayout, int, 0);
- MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
+ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
  
  /* iTCO Vendor Specific Support hooks */
  #ifdef CONFIG_ITCO_VENDOR_SUPPORT
@@@ -539,7 -539,7 +539,7 @@@ static int iTCO_wdt_ioctl (struct inod
   *    Kernel Interfaces
   */
  
 -static struct file_operations iTCO_wdt_fops = {
 +static const struct file_operations iTCO_wdt_fops = {
        .owner =        THIS_MODULE,
        .llseek =       no_llseek,
        .write =        iTCO_wdt_write,
index 4d730fdbd528cac4f84d78997045771a930d7b7b,4a328ba0d262279baaec50eda6430c926461fc0d..81fb3dec180f5be0b5076568b3c140caa6393d4f
@@@ -95,7 -95,7 +95,7 @@@ MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR)
  
  static int nowayout = WATCHDOG_NOWAYOUT;
  module_param(nowayout, int, 0);
- MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
+ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
  
  #define PFX "machzwd"
  
@@@ -118,12 -118,14 +118,14 @@@ static int action = 0
  module_param(action, int, 0);
  MODULE_PARM_DESC(action, "after watchdog resets, generate: 0 = RESET(*)  1 = SMI  2 = NMI  3 = SCI");
  
+ static void zf_ping(unsigned long data);
  static int zf_action = GEN_RESET;
  static unsigned long zf_is_open;
  static char zf_expect_close;
  static spinlock_t zf_lock;
  static spinlock_t zf_port_lock;
- static struct timer_list zf_timer;
+ static DEFINE_TIMER(zf_timer, zf_ping, 0, 0);
  static unsigned long next_heartbeat = 0;
  
  
@@@ -220,9 -222,7 +222,7 @@@ static void zf_timer_on(void
        next_heartbeat = jiffies + ZF_USER_TIMEO;
  
        /* start the timer for internal ping */
-       zf_timer.expires = jiffies + ZF_HW_TIMEO;
-       add_timer(&zf_timer);
+       mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO);
  
        /* start watchdog timer */
        ctrl_reg = zf_get_control();
@@@ -260,8 -260,7 +260,7 @@@ static void zf_ping(unsigned long data
                zf_set_control(ctrl_reg);
                spin_unlock_irqrestore(&zf_port_lock, flags);
  
-               zf_timer.expires = jiffies + ZF_HW_TIMEO;
-               add_timer(&zf_timer);
+               mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO);
        }else{
                printk(KERN_CRIT PFX ": I will reset your machine\n");
        }
@@@ -325,7 -324,7 +324,7 @@@ static int zf_ioctl(struct inode *inode
                        return put_user(0, p);
  
                case WDIOC_KEEPALIVE:
 -                      zf_ping(0);
 +                      zf_ping(NULL);
                        break;
  
                default:
@@@ -465,11 -464,6 +464,6 @@@ static int __init zf_init(void
        zf_set_status(0);
        zf_set_control(0);
  
-       /* this is the timer that will do the hard work */
-       init_timer(&zf_timer);
-       zf_timer.function = zf_ping;
-       zf_timer.data = 0;
        return 0;
  
  no_reboot:
index a77a90717ad21cca1f2c553c4cbc2d3bac7f14ec,4faea2fec0a32e3311f685c280399ea2638ab8bc..3d3deae0d64ba0668f28fb275a082531a7e62e1c
@@@ -526,7 -526,7 +526,7 @@@ static int pc87413_notify_sys(struct no
  
  /* -- Module's structures ---------------------------------------*/
  
 -static struct file_operations pc87413_fops = {
 +static const struct file_operations pc87413_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = pc87413_write,
@@@ -631,5 -631,5 +631,5 @@@ module_param(timeout, int, 0)
  MODULE_PARM_DESC(timeout, "Watchdog timeout in minutes (default=" __MODULE_STRING(timeout) ").");
  
  module_param(nowayout, int, 0);
- MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
+ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
  
index ff6f1ca1e5e7119b48ace7d55843b0b6871367c6,0e3d589d6332316b84d57cb80ce7376f787fb0aa..5991add702b00e32efaf83711ebdb2a60dc8b832
@@@ -238,7 -238,7 +238,7 @@@ static int pnx4008_wdt_release(struct i
        return 0;
  }
  
 -static struct file_operations pnx4008_wdt_fops = {
 +static const struct file_operations pnx4008_wdt_fops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .write = pnx4008_wdt_write,
@@@ -283,7 -283,8 +283,8 @@@ static int pnx4008_wdt_probe(struct pla
        wdt_base = (void __iomem *)IO_ADDRESS(res->start);
  
        wdt_clk = clk_get(&pdev->dev, "wdt_ck");
-       if (!wdt_clk) {
+       if (IS_ERR(wdt_clk)) {
+               ret = PTR_ERR(wdt_clk);
                release_resource(wdt_mem);
                kfree(wdt_mem);
                goto out;
index a9681d580dd355dbb2753202fead86fec358e695,aa977f129e39a26c9656cb56699a113cc3cbadcc..d3cb0a76602036a679e5f242ecaffb026bc93f51
@@@ -510,7 -510,7 +510,7 @@@ static int wb_smsc_wdt_notify_sys(struc
  
  /* -- Module's structures ---------------------------------------*/
  
 -static struct file_operations wb_smsc_wdt_fops =
 +static const struct file_operations wb_smsc_wdt_fops =
  {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
@@@ -624,4 -624,4 +624,4 @@@ module_param(timeout, int, 0)
  MODULE_PARM_DESC(timeout, "range is 1-255 units, default is 60");
  
  module_param(nowayout, int, 0);
- MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
+ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
index c960ec110dd7c07c0464c840234f1f4957eb81da,f9f6f543825fd912c55973cc55009aea1ec24f75..d9e821d08deb3b7ea21b36be0ec4682389e807e5
@@@ -60,7 -60,7 +60,7 @@@ MODULE_PARM_DESC(timeout, "Watchdog tim
  
  static int nowayout = WATCHDOG_NOWAYOUT;
  module_param(nowayout, int, 0);
- MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
+ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
  
  /*
   *    Kernel methods.
@@@ -323,7 -323,7 +323,7 @@@ wdt_notify_sys(struct notifier_block *t
   *    Kernel Interfaces
   */
  
 -static struct file_operations wdt_fops = {
 +static const struct file_operations wdt_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .write          = wdt_write,