X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fwatchdog%2Fw83977f_wdt.c;h=b209bcd7f78945aaf64726201295984384bd4161;hb=7a76d89232f20411f32e7a79ccc1e2f95e9f826b;hp=15796844289121d9ed3bc2833a6cd6eecb2c9b81;hpb=a9e82d3a02247af6b729be0a963862d70cb25bf9;p=linux-2.6 diff --git a/drivers/watchdog/w83977f_wdt.c b/drivers/watchdog/w83977f_wdt.c index 1579684428..b209bcd7f7 100644 --- a/drivers/watchdog/w83977f_wdt.c +++ b/drivers/watchdog/w83977f_wdt.c @@ -50,7 +50,7 @@ static int timeoutW; /* timeout in watchdog counter units */ static unsigned long timer_alive; static int testmode; static char expect_close; -static spinlock_t spinlock; +static DEFINE_SPINLOCK(spinlock); module_param(timeout, int, 0); MODULE_PARM_DESC(timeout,"Watchdog timeout in seconds (15..7635), default=" __MODULE_STRING(DEFAULT_TIMEOUT) ")"); @@ -476,8 +476,6 @@ static int __init w83977f_wdt_init(void) printk(KERN_INFO PFX DRIVER_VERSION); - spin_lock_init(&spinlock); - /* * Check that the timeout value is within it's range ; * if not reset to the default @@ -496,20 +494,20 @@ static int __init w83977f_wdt_init(void) goto err_out; } - 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_region; } - 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 "initialized. timeout=%d sec (nowayout=%d testmode=%d)\n", @@ -517,8 +515,8 @@ static int __init w83977f_wdt_init(void) return 0; -err_out_miscdev: - misc_deregister(&wdt_miscdev); +err_out_reboot: + unregister_reboot_notifier(&wdt_notifier); err_out_region: release_region(IO_INDEX_PORT,2); err_out: