]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/watchdog/w83877f_wdt.c
[ARM] Fix SMP booting with non-zero PHYS_OFFSET
[linux-2.6-omap-h63xx.git] / drivers / watchdog / w83877f_wdt.c
index 3c88fe18f4f437e01e88264e340ddea12fe0d207..f510a3a595e65e1900799ced068e7e3eaa8389df 100644 (file)
@@ -94,7 +94,7 @@ static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
 static unsigned long next_heartbeat;
 static unsigned long wdt_is_open;
 static char wdt_expect_close;
-static spinlock_t wdt_spinlock;
+static DEFINE_SPINLOCK(wdt_spinlock);
 
 /*
  *     Whack the dog
@@ -350,8 +350,6 @@ static int __init w83877f_wdt_init(void)
 {
        int rc = -EBUSY;
 
-       spin_lock_init(&wdt_spinlock);
-
        if(timeout < 1 || timeout > 3600) /* arbitrary upper limit */
        {
                timeout = WATCHDOG_TIMEOUT;
@@ -375,20 +373,20 @@ static int __init w83877f_wdt_init(void)
                goto err_out_region1;
        }
 
-       rc = misc_register(&wdt_miscdev);
+       rc = register_reboot_notifier(&wdt_notifier);
        if (rc)
        {
-               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
-                       wdt_miscdev.minor, rc);
+               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
+                       rc);
                goto err_out_region2;
        }
 
-       rc = register_reboot_notifier(&wdt_notifier);
+       rc = misc_register(&wdt_miscdev);
        if (rc)
        {
-               printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
-                       rc);
-               goto err_out_miscdev;
+               printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
+                       wdt_miscdev.minor, rc);
+               goto err_out_reboot;
        }
 
        printk(KERN_INFO PFX "WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n",
@@ -396,8 +394,8 @@ static int __init w83877f_wdt_init(void)
 
        return 0;
 
-err_out_miscdev:
-       misc_deregister(&wdt_miscdev);
+err_out_reboot:
+       unregister_reboot_notifier(&wdt_notifier);
 err_out_region2:
        release_region(WDT_PING,1);
 err_out_region1: