Commit c1a67643 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[WATCHDOG] More alim7101 cleanups

parent 04315f20
...@@ -258,7 +258,9 @@ static struct miscdevice wdt_miscdev = { ...@@ -258,7 +258,9 @@ static struct miscdevice wdt_miscdev = {
static int wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused) static int wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
{ {
if (code==SYS_DOWN || code==SYS_HALT) wdt_turnoff(); if (code==SYS_DOWN || code==SYS_HALT)
wdt_turnoff();
if (code==SYS_RESTART) { if (code==SYS_RESTART) {
/* /*
* Cobalt devices have no way of rebooting themselves other than * Cobalt devices have no way of rebooting themselves other than
...@@ -267,7 +269,7 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code, void ...@@ -267,7 +269,7 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code, void
*/ */
wdt_change(WDT_ENABLE); wdt_change(WDT_ENABLE);
printk(OUR_NAME ": Watchdog timer is now enabled with no heartbeat - should reboot in ~1 second.\n"); printk(OUR_NAME ": Watchdog timer is now enabled with no heartbeat - should reboot in ~1 second.\n");
}; }
return NOTIFY_DONE; return NOTIFY_DONE;
} }
...@@ -278,9 +280,9 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code, void ...@@ -278,9 +280,9 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code, void
static struct notifier_block wdt_notifier= static struct notifier_block wdt_notifier=
{ {
wdt_notify_sys, .notifier_call = wdt_notify_sys,
0, .next = 0,
0 .priority = 0
}; };
static void __exit alim7101_wdt_unload(void) static void __exit alim7101_wdt_unload(void)
...@@ -302,7 +304,7 @@ static int __init alim7101_wdt_init(void) ...@@ -302,7 +304,7 @@ static int __init alim7101_wdt_init(void)
if (!alim7101_pmu) { if (!alim7101_pmu) {
printk(KERN_INFO OUR_NAME ": ALi M7101 PMU not present - WDT not set\n"); printk(KERN_INFO OUR_NAME ": ALi M7101 PMU not present - WDT not set\n");
return -EBUSY; return -EBUSY;
}; }
/* Set the WDT in the PMU to 1 second */ /* Set the WDT in the PMU to 1 second */
pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, 0x02); pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, 0x02);
...@@ -311,12 +313,12 @@ static int __init alim7101_wdt_init(void) ...@@ -311,12 +313,12 @@ static int __init alim7101_wdt_init(void)
if (!ali1543_south) { if (!ali1543_south) {
printk(KERN_INFO OUR_NAME ": ALi 1543 South-Bridge not present - WDT not set\n"); printk(KERN_INFO OUR_NAME ": ALi 1543 South-Bridge not present - WDT not set\n");
return -EBUSY; return -EBUSY;
}; }
pci_read_config_byte(ali1543_south, 0x5e, &tmp); pci_read_config_byte(ali1543_south, 0x5e, &tmp);
if ((tmp & 0x1e) != 0x12) { if ((tmp & 0x1e) != 0x12) {
printk(KERN_INFO OUR_NAME ": ALi 1543 South-Bridge does not have the correct revision number (???1001?) - WDT not set\n"); printk(KERN_INFO OUR_NAME ": ALi 1543 South-Bridge does not have the correct revision number (???1001?) - WDT not set\n");
return -EBUSY; return -EBUSY;
}; }
init_timer(&timer); init_timer(&timer);
timer.function = wdt_timer_ping; timer.function = wdt_timer_ping;
...@@ -330,7 +332,7 @@ static int __init alim7101_wdt_init(void) ...@@ -330,7 +332,7 @@ static int __init alim7101_wdt_init(void)
if (rc) { if (rc) {
misc_deregister(&wdt_miscdev); misc_deregister(&wdt_miscdev);
return rc; return rc;
}; }
printk(KERN_INFO OUR_NAME ": WDT driver for ALi M7101 initialised.\n"); printk(KERN_INFO OUR_NAME ": WDT driver for ALi M7101 initialised.\n");
return 0; return 0;
...@@ -339,6 +341,5 @@ static int __init alim7101_wdt_init(void) ...@@ -339,6 +341,5 @@ static int __init alim7101_wdt_init(void)
module_init(alim7101_wdt_init); module_init(alim7101_wdt_init);
module_exit(alim7101_wdt_unload); module_exit(alim7101_wdt_unload);
EXPORT_NO_SYMBOLS;
MODULE_AUTHOR("Steve Hill"); MODULE_AUTHOR("Steve Hill");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment