X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fwatchdog%2Fmachzwd.c;h=276577d08fba2f0f2791c1c1a03de69ad8feb5c2;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=3782930e6f1f075565e318b10b83b612cb1f92ae;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c index 3782930e6..276577d08 100644 --- a/drivers/char/watchdog/machzwd.c +++ b/drivers/char/watchdog/machzwd.c @@ -28,7 +28,6 @@ * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT */ -#include #include #include #include @@ -88,24 +87,13 @@ static unsigned short zf_readw(unsigned char port) return inw(DATA_W); } -static unsigned short zf_readb(unsigned char port) -{ - outb(port, INDEX); - return inb(DATA_B); -} - MODULE_AUTHOR("Fernando Fuganti "); MODULE_DESCRIPTION("MachZ ZF-Logic Watchdog driver"); MODULE_LICENSE("GPL"); MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); -#ifdef CONFIG_WATCHDOG_NOWAYOUT -static int nowayout = 1; -#else -static int nowayout = 0; -#endif - +static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); @@ -155,13 +143,6 @@ static unsigned long next_heartbeat = 0; #endif -/* STATUS register functions */ - -static inline unsigned char zf_get_status(void) -{ - return zf_readb(STATUS); -} - static inline void zf_set_status(unsigned char new) { zf_writeb(STATUS, new); @@ -182,22 +163,6 @@ static inline void zf_set_control(unsigned short new) /* WD#? counter functions */ -/* - * Just get current counter value - */ - -static inline unsigned short zf_get_timer(unsigned char n) -{ - switch(n){ - case WD1: - return zf_readw(COUNTER_1); - case WD2: - return zf_readb(COUNTER_2); - default: - return 0; - } -} - /* * Just set counter value */ @@ -364,7 +329,7 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, break; default: - return -ENOIOCTLCMD; + return -ENOTTY; } return 0; @@ -423,8 +388,9 @@ static int zf_notify_sys(struct notifier_block *this, unsigned long code, -static struct file_operations zf_fops = { +static const struct file_operations zf_fops = { .owner = THIS_MODULE, + .llseek = no_llseek, .write = zf_write, .ioctl = zf_ioctl, .open = zf_open, @@ -460,8 +426,7 @@ static int __init zf_init(void) printk(KERN_INFO PFX ": MachZ ZF-Logic Watchdog driver initializing.\n"); ret = zf_get_ZFL_version(); - printk("%#x\n", ret); - if((!ret) || (ret != 0xffff)){ + if ((!ret) || (ret == 0xffff)) { printk(KERN_WARNING PFX ": no ZF-Logic found\n"); return -ENODEV; } @@ -516,7 +481,7 @@ out: } -void __exit zf_exit(void) +static void __exit zf_exit(void) { zf_timer_off();