[ixp4xx] fix avila-wdt compilation failure (#6948)
[openwrt-10.03/.git] / package / avila-wdt / src / avila-wdt.c
index 6b3b42b092af7abd6a2c1839fe04c6bebd268c58..981f3857ad1b7b77e2dbb0cc1d7c64a23cf196ff 100644 (file)
@@ -21,6 +21,8 @@
 #include <linux/moduleparam.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
+#include <linux/jiffies.h>
+#include <linux/timer.h>
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
@@ -74,10 +76,8 @@ static void wdt_enable(void)
 
 static void wdt_disable(void)
 {
-       /* NB: we can't turn off the watchdog anymore, so we
-        * have to keep running the strobe timer without decrementing
-        * the counter */
-       clear_bit(WDT_RUNNING, &wdt_status);
+       /* Re-enable clock generator output on GPIO 14/15 */
+       *IXP4XX_GPIO_GPCLKR |= (1 << 8);
 }
 
 static int avila_wdt_open(struct inode *inode, struct file *file)
@@ -209,6 +209,8 @@ static int __init avila_wdt_init(void)
 static void __exit avila_wdt_exit(void)
 {
        misc_deregister(&avila_wdt_miscdev);
+       del_timer(&wdt_timer);
+       wdt_disable();
 }