vserver 1.9.5.x5
[linux-2.6.git] / drivers / char / ipmi / ipmi_watchdog.c
index db2cf9c..fd70938 100644 (file)
@@ -157,7 +157,7 @@ static char preaction[16] = "pre_none";
 static unsigned char preop_val = WDOG_PREOP_NONE;
 
 static char preop[16] = "preop_none";
-static spinlock_t ipmi_read_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(ipmi_read_lock);
 static char data_to_read = 0;
 static DECLARE_WAIT_QUEUE_HEAD(read_q);
 static struct fasync_struct *fasync_q = NULL;
@@ -366,20 +366,6 @@ static void panic_halt_ipmi_set_timeout(void)
        }
 }
 
-/* Do a delayed shutdown, with the delay in milliseconds.  If power_off is
-   false, do a reset.  If power_off is true, do a power down.  This is
-   primarily for the IMB code's shutdown. */
-void ipmi_delayed_shutdown(long delay, int power_off)
-{
-       ipmi_ignore_heartbeat = 1;
-       if (power_off) 
-               ipmi_watchdog_state = WDOG_TIMEOUT_POWER_DOWN;
-       else
-               ipmi_watchdog_state = WDOG_TIMEOUT_RESET;
-       timeout = delay;
-       ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY);
-}
-
 /* We use a semaphore to make sure that only one thing can send a
    heartbeat at one time, because we only have one copy of the data.
    The semaphore is claimed when the set_timeout is sent and freed
@@ -518,9 +504,9 @@ static void panic_halt_ipmi_heartbeat(void)
 
 static struct watchdog_info ident=
 {
-       0, /* WDIOF_SETTIMEOUT, */
-       1,
-       "IPMI"
+       .options        = 0,    /* WDIOF_SETTIMEOUT, */
+       .firmware_version = 1,
+       .identity       = "IPMI"
 };
 
 static int ipmi_ioctl(struct inode *inode, struct file *file,
@@ -748,9 +734,9 @@ static struct file_operations ipmi_wdog_fops = {
 };
 
 static struct miscdevice ipmi_wdog_miscdev = {
-       WATCHDOG_MINOR,
-       "watchdog",
-       &ipmi_wdog_fops
+       .minor          = WATCHDOG_MINOR,
+       .name           = "watchdog",
+       .fops           = &ipmi_wdog_fops
 };
 
 static DECLARE_RWSEM(register_sem);
@@ -885,13 +871,11 @@ static int wdog_reboot_handler(struct notifier_block *this,
 }
 
 static struct notifier_block wdog_reboot_notifier = {
-       wdog_reboot_handler,
-       NULL,
-       0
+       .notifier_call  = wdog_reboot_handler,
+       .next           = NULL,
+       .priority       = 0
 };
 
-extern int panic_timeout; /* Why isn't this defined anywhere? */
-
 static int wdog_panic_handler(struct notifier_block *this,
                              unsigned long         event,
                              void                  *unused)
@@ -915,9 +899,9 @@ static int wdog_panic_handler(struct notifier_block *this,
 }
 
 static struct notifier_block wdog_panic_notifier = {
-       wdog_panic_handler,
-       NULL,
-       150   /* priority: INT_MAX >= x >= 0 */
+       .notifier_call  = wdog_panic_handler,
+       .next           = NULL,
+       .priority       = 150   /* priority: INT_MAX >= x >= 0 */
 };
 
 
@@ -1054,10 +1038,6 @@ static __exit void ipmi_unregister_watchdog(void)
        /* Make sure no one can call us any more. */
        misc_deregister(&ipmi_wdog_miscdev);
 
-       /*  Disable the timer. */
-       ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
-       ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB);
-
        /* Wait to make sure the message makes it out.  The lower layer has
           pointers to our buffers, we want to make sure they are done before
           we release our memory. */
@@ -1084,8 +1064,5 @@ static void __exit ipmi_wdog_exit(void)
        ipmi_unregister_watchdog();
 }
 module_exit(ipmi_wdog_exit);
-
-EXPORT_SYMBOL(ipmi_delayed_shutdown);
-
 module_init(ipmi_wdog_init);
 MODULE_LICENSE("GPL");