[WATCHDOG] more coding style clean-up's

More coding style clean-up's.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
This commit is contained in:
Wim Van Sebroeck
2008-08-06 20:19:41 +00:00
parent 12b7a1523e
commit 7944d3a5a7
40 changed files with 199 additions and 227 deletions

View File

@@ -126,7 +126,7 @@ static ssize_t acq_write(struct file *file, const char __user *buf,
if (!nowayout) { if (!nowayout) {
size_t i; size_t i;
/* note: just in case someone wrote the magic character /* note: just in case someone wrote the magic character
* five months ago... */ five months ago... */
expect_close = 0; expect_close = 0;
/* scan to see whether or not we got the /* scan to see whether or not we got the
magic character */ magic character */

View File

@@ -47,7 +47,8 @@
#define WATCHDOG_NAME "Advantech WDT" #define WATCHDOG_NAME "Advantech WDT"
#define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */
static struct platform_device *advwdt_platform_device; /* the watchdog platform device */ /* the watchdog platform device */
static struct platform_device *advwdt_platform_device;
static unsigned long advwdt_is_open; static unsigned long advwdt_is_open;
static char adv_expect_close; static char adv_expect_close;
@@ -199,8 +200,7 @@ static int advwdt_open(struct inode *inode, struct file *file)
return nonseekable_open(inode, file); return nonseekable_open(inode, file);
} }
static int static int advwdt_close(struct inode *inode, struct file *file)
advwdt_close(struct inode *inode, struct file *file)
{ {
if (adv_expect_close == 42) { if (adv_expect_close == 42) {
advwdt_disable(); advwdt_disable();
@@ -315,7 +315,8 @@ static int __init advwdt_init(void)
{ {
int err; int err;
printk(KERN_INFO "WDT driver for Advantech single board computer initialising.\n"); printk(KERN_INFO
"WDT driver for Advantech single board computer initialising.\n");
err = platform_driver_register(&advwdt_driver); err = platform_driver_register(&advwdt_driver);
if (err) if (err)

View File

@@ -213,7 +213,7 @@ static int ar7_wdt_notify_sys(struct notifier_block *this,
} }
static struct notifier_block ar7_wdt_notifier = { static struct notifier_block ar7_wdt_notifier = {
.notifier_call = ar7_wdt_notify_sys .notifier_call = ar7_wdt_notify_sys,
}; };
static ssize_t ar7_wdt_write(struct file *file, const char *data, static ssize_t ar7_wdt_write(struct file *file, const char *data,

View File

@@ -360,10 +360,8 @@ static int eurwdt_release(struct inode *inode, struct file *file)
static int eurwdt_notify_sys(struct notifier_block *this, unsigned long code, static int eurwdt_notify_sys(struct notifier_block *this, unsigned long code,
void *unused) void *unused)
{ {
if (code == SYS_DOWN || code == SYS_HALT) { if (code == SYS_DOWN || code == SYS_HALT)
/* Turn the card off */ eurwdt_disable_timer(); /* Turn the card off */
eurwdt_disable_timer();
}
return NOTIFY_DONE; return NOTIFY_DONE;
} }

View File

@@ -77,8 +77,7 @@ static int geodewdt_set_heartbeat(int val)
return 0; return 0;
} }
static int static int geodewdt_open(struct inode *inode, struct file *file)
geodewdt_open(struct inode *inode, struct file *file)
{ {
if (test_and_set_bit(WDT_FLAGS_OPEN, &wdt_flags)) if (test_and_set_bit(WDT_FLAGS_OPEN, &wdt_flags))
return -EBUSY; return -EBUSY;
@@ -90,14 +89,12 @@ geodewdt_open(struct inode *inode, struct file *file)
return nonseekable_open(inode, file); return nonseekable_open(inode, file);
} }
static int static int geodewdt_release(struct inode *inode, struct file *file)
geodewdt_release(struct inode *inode, struct file *file)
{ {
if (safe_close) { if (safe_close) {
geodewdt_disable(); geodewdt_disable();
module_put(THIS_MODULE); module_put(THIS_MODULE);
} } else {
else {
printk(KERN_CRIT "Unexpected close - watchdog is not stopping.\n"); printk(KERN_CRIT "Unexpected close - watchdog is not stopping.\n");
geodewdt_ping(); geodewdt_ping();
@@ -109,9 +106,8 @@ geodewdt_release(struct inode *inode, struct file *file)
return 0; return 0;
} }
static ssize_t static ssize_t geodewdt_write(struct file *file, const char __user *data,
geodewdt_write(struct file *file, const char __user *data, size_t len, size_t len, loff_t *ppos)
loff_t *ppos)
{ {
if (len) { if (len) {
if (!nowayout) { if (!nowayout) {
@@ -134,9 +130,8 @@ geodewdt_write(struct file *file, const char __user *data, size_t len,
return len; return len;
} }
static int static int geodewdt_ioctl(struct inode *inode, struct file *file,
geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned int cmd, unsigned long arg)
unsigned long arg)
{ {
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
int __user *p = argp; int __user *p = argp;
@@ -211,11 +206,10 @@ static const struct file_operations geodewdt_fops = {
static struct miscdevice geodewdt_miscdev = { static struct miscdevice geodewdt_miscdev = {
.minor = WATCHDOG_MINOR, .minor = WATCHDOG_MINOR,
.name = "watchdog", .name = "watchdog",
.fops = &geodewdt_fops .fops = &geodewdt_fops,
}; };
static int __devinit static int __devinit geodewdt_probe(struct platform_device *dev)
geodewdt_probe(struct platform_device *dev)
{ {
int ret, timer; int ret, timer;
@@ -246,15 +240,13 @@ geodewdt_probe(struct platform_device *dev)
return ret; return ret;
} }
static int __devexit static int __devexit geodewdt_remove(struct platform_device *dev)
geodewdt_remove(struct platform_device *dev)
{ {
misc_deregister(&geodewdt_miscdev); misc_deregister(&geodewdt_miscdev);
return 0; return 0;
} }
static void static void geodewdt_shutdown(struct platform_device *dev)
geodewdt_shutdown(struct platform_device *dev)
{ {
geodewdt_disable(); geodewdt_disable();
} }
@@ -269,8 +261,7 @@ static struct platform_driver geodewdt_driver = {
}, },
}; };
static int __init static int __init geodewdt_init(void)
geodewdt_init(void)
{ {
int ret; int ret;
@@ -290,8 +281,7 @@ err:
return ret; return ret;
} }
static void __exit static void __exit geodewdt_exit(void)
geodewdt_exit(void)
{ {
platform_device_unregister(geodewdt_platform_device); platform_device_unregister(geodewdt_platform_device);
platform_driver_unregister(&geodewdt_driver); platform_driver_unregister(&geodewdt_driver);

View File

@@ -108,7 +108,8 @@ MODULE_PARM_DESC(nowayout,
* reload register. After this the appropriate registers can be written * reload register. After this the appropriate registers can be written
* to once before they need to be unlocked again. * to once before they need to be unlocked again.
*/ */
static inline void esb_unlock_registers(void) { static inline void esb_unlock_registers(void)
{
writeb(ESB_UNLOCK1, ESB_RELOAD_REG); writeb(ESB_UNLOCK1, ESB_RELOAD_REG);
writeb(ESB_UNLOCK2, ESB_RELOAD_REG); writeb(ESB_UNLOCK2, ESB_RELOAD_REG);
} }
@@ -324,10 +325,9 @@ static long esb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
static int esb_notify_sys(struct notifier_block *this, static int esb_notify_sys(struct notifier_block *this,
unsigned long code, void *unused) unsigned long code, void *unused)
{ {
if (code == SYS_DOWN || code == SYS_HALT) { if (code == SYS_DOWN || code == SYS_HALT)
/* Turn the WDT off */ esb_timer_stop(); /* Turn the WDT off */
esb_timer_stop();
}
return NOTIFY_DONE; return NOTIFY_DONE;
} }

View File

@@ -129,8 +129,7 @@ MODULE_PARM_DESC(nowayout,
* Watchdog Operations * Watchdog Operations
*/ */
static void static void ibwdt_ping(void)
ibwdt_ping(void)
{ {
spin_lock(&ibwdt_lock); spin_lock(&ibwdt_lock);
@@ -140,16 +139,14 @@ ibwdt_ping(void)
spin_unlock(&ibwdt_lock); spin_unlock(&ibwdt_lock);
} }
static void static void ibwdt_disable(void)
ibwdt_disable(void)
{ {
spin_lock(&ibwdt_lock); spin_lock(&ibwdt_lock);
outb_p(0, WDT_STOP); outb_p(0, WDT_STOP);
spin_unlock(&ibwdt_lock); spin_unlock(&ibwdt_lock);
} }
static int static int ibwdt_set_heartbeat(int t)
ibwdt_set_heartbeat(int t)
{ {
int i; int i;
@@ -263,8 +260,7 @@ static int ibwdt_open(struct inode *inode, struct file *file)
return nonseekable_open(inode, file); return nonseekable_open(inode, file);
} }
static int static int ibwdt_close(struct inode *inode, struct file *file)
ibwdt_close(struct inode *inode, struct file *file)
{ {
if (expect_close == 42) { if (expect_close == 42) {
ibwdt_disable(); ibwdt_disable();

View File

@@ -275,7 +275,7 @@ static long asr_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
static const struct watchdog_info ident = { static const struct watchdog_info ident = {
.options = WDIOF_KEEPALIVEPING | .options = WDIOF_KEEPALIVEPING |
WDIOF_MAGICCLOSE, WDIOF_MAGICCLOSE,
.identity = "IBM ASR" .identity = "IBM ASR",
}; };
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
int __user *p = argp; int __user *p = argp;

View File

@@ -241,7 +241,7 @@ static int __init iop_wdt_init(void)
with an open */ with an open */
ret = misc_register(&iop_wdt_miscdev); ret = misc_register(&iop_wdt_miscdev);
if (ret == 0) if (ret == 0)
printk("iop watchdog timer: timeout %lu sec\n", printk(KERN_INFO "iop watchdog timer: timeout %lu sec\n",
iop_watchdog_timeout()); iop_watchdog_timeout());
return ret; return ret;

View File

@@ -157,8 +157,7 @@ static int ixp4xx_wdt_release(struct inode *inode, struct file *file)
} }
static const struct file_operations ixp4xx_wdt_fops = static const struct file_operations ixp4xx_wdt_fops = {
{
.owner = THIS_MODULE, .owner = THIS_MODULE,
.llseek = no_llseek, .llseek = no_llseek,
.write = ixp4xx_wdt_write, .write = ixp4xx_wdt_write,
@@ -167,8 +166,7 @@ static const struct file_operations ixp4xx_wdt_fops =
.release = ixp4xx_wdt_release, .release = ixp4xx_wdt_release,
}; };
static struct miscdevice ixp4xx_wdt_miscdev = static struct miscdevice ixp4xx_wdt_miscdev = {
{
.minor = WATCHDOG_MINOR, .minor = WATCHDOG_MINOR,
.name = "watchdog", .name = "watchdog",
.fops = &ixp4xx_wdt_fops, .fops = &ixp4xx_wdt_fops,
@@ -181,8 +179,8 @@ static int __init ixp4xx_wdt_init(void)
asm("mrc p15, 0, %0, cr0, cr0, 0;" : "=r"(processor_id) :); asm("mrc p15, 0, %0, cr0, cr0, 0;" : "=r"(processor_id) :);
if (!(processor_id & 0xf) && !cpu_is_ixp46x()) { if (!(processor_id & 0xf) && !cpu_is_ixp46x()) {
printk("IXP4XXX Watchdog: Rev. A0 IXP42x CPU detected - " printk(KERN_ERR "IXP4XXX Watchdog: Rev. A0 IXP42x CPU detected"
"watchdog disabled\n"); " - watchdog disabled\n");
return -ENODEV; return -ENODEV;
} }
@@ -191,7 +189,8 @@ static int __init ixp4xx_wdt_init(void)
WDIOF_CARDRESET : 0; WDIOF_CARDRESET : 0;
ret = misc_register(&ixp4xx_wdt_miscdev); ret = misc_register(&ixp4xx_wdt_miscdev);
if (ret == 0) if (ret == 0)
printk("IXP4xx Watchdog Timer: heartbeat %d sec\n", heartbeat); printk(KERN_INFO "IXP4xx Watchdog Timer: heartbeat %d sec\n",
heartbeat);
return ret; return ret;
} }

View File

@@ -164,7 +164,7 @@ static int mpc5200_wdt_release(struct inode *inode, struct file *file)
static const struct file_operations mpc5200_wdt_fops = { static const struct file_operations mpc5200_wdt_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.write = mpc5200_wdt_write, .write = mpc5200_wdt_write,
.ioctl = mpc5200_wdt_ioctl, .unlocked_ioctl = mpc5200_wdt_ioctl,
.open = mpc5200_wdt_open, .open = mpc5200_wdt_open,
.release = mpc5200_wdt_release, .release = mpc5200_wdt_release,
}; };

View File

@@ -191,14 +191,14 @@ static const struct file_operations mtx1_wdt_fops = {
.unlocked_ioctl = mtx1_wdt_ioctl, .unlocked_ioctl = mtx1_wdt_ioctl,
.open = mtx1_wdt_open, .open = mtx1_wdt_open,
.write = mtx1_wdt_write, .write = mtx1_wdt_write,
.release = mtx1_wdt_release .release = mtx1_wdt_release,
}; };
static struct miscdevice mtx1_wdt_misc = { static struct miscdevice mtx1_wdt_misc = {
.minor = WATCHDOG_MINOR, .minor = WATCHDOG_MINOR,
.name = "watchdog", .name = "watchdog",
.fops = &mtx1_wdt_fops .fops = &mtx1_wdt_fops,
}; };

View File

@@ -245,7 +245,7 @@ static const struct file_operations omap_wdt_fops = {
static struct miscdevice omap_wdt_miscdev = { static struct miscdevice omap_wdt_miscdev = {
.minor = WATCHDOG_MINOR, .minor = WATCHDOG_MINOR,
.name = "watchdog", .name = "watchdog",
.fops = &omap_wdt_fops .fops = &omap_wdt_fops,
}; };
static int __init omap_wdt_probe(struct platform_device *pdev) static int __init omap_wdt_probe(struct platform_device *pdev)

View File

@@ -413,7 +413,7 @@ static long pc87413_ioctl(struct file *file, unsigned int cmd,
WDIOF_SETTIMEOUT | WDIOF_SETTIMEOUT |
WDIOF_MAGICCLOSE, WDIOF_MAGICCLOSE,
.firmware_version = 1, .firmware_version = 1,
.identity = "PC87413(HF/F) watchdog" .identity = "PC87413(HF/F) watchdog",
}; };
uarg.i = (int __user *)arg; uarg.i = (int __user *)arg;
@@ -507,7 +507,7 @@ static struct notifier_block pc87413_notifier = {
static struct miscdevice pc87413_miscdev = { static struct miscdevice pc87413_miscdev = {
.minor = WATCHDOG_MINOR, .minor = WATCHDOG_MINOR,
.name = "watchdog", .name = "watchdog",
.fops = &pc87413_fops .fops = &pc87413_fops,
}; };
/* -- Module init functions -------------------------------------*/ /* -- Module init functions -------------------------------------*/
@@ -569,7 +569,7 @@ static void __exit pc87413_exit(void)
unregister_reboot_notifier(&pc87413_notifier); unregister_reboot_notifier(&pc87413_notifier);
/* release_region(io, 2); */ /* release_region(io, 2); */
printk(MODNAME " watchdog component driver removed.\n"); printk(KERN_INFO MODNAME " watchdog component driver removed.\n");
} }
module_init(pc87413_init); module_init(pc87413_init);

View File

@@ -272,7 +272,7 @@ static int set_command_mode(void)
printk(KERN_DEBUG PFX "command_mode=%d\n", printk(KERN_DEBUG PFX "command_mode=%d\n",
pcwd_private.command_mode); pcwd_private.command_mode);
return(found); return found;
} }
static void unset_command_mode(void) static void unset_command_mode(void)
@@ -325,7 +325,7 @@ static inline int pcwd_get_option_switches(void)
} }
unset_command_mode(); unset_command_mode();
return(option_switches); return option_switches;
} }
static void pcwd_show_card_info(void) static void pcwd_show_card_info(void)

View File

@@ -219,11 +219,10 @@ static void pcipcwd_show_card_info(void)
int option_switches; int option_switches;
got_fw_rev = send_command(CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor); got_fw_rev = send_command(CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor);
if (got_fw_rev) { if (got_fw_rev)
sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor); sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor);
} else { else
sprintf(fw_ver_str, "<card no answer>"); sprintf(fw_ver_str, "<card no answer>");
}
/* Get switch settings */ /* Get switch settings */
option_switches = pcipcwd_get_option_switches(); option_switches = pcipcwd_get_option_switches();
@@ -471,8 +470,7 @@ static long pcipcwd_ioctl(struct file *file, unsigned int cmd,
switch (cmd) { switch (cmd) {
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
return copy_to_user(argp, &ident, return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
sizeof (ident)) ? -EFAULT : 0;
case WDIOC_GETSTATUS: case WDIOC_GETSTATUS:
{ {
@@ -625,10 +623,8 @@ static int pcipcwd_temp_release(struct inode *inode, struct file *file)
static int pcipcwd_notify_sys(struct notifier_block *this, unsigned long code, void *unused) static int pcipcwd_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
{ {
if (code==SYS_DOWN || code==SYS_HALT) { if (code == SYS_DOWN || code == SYS_HALT)
/* Turn the WDT off */ pcipcwd_stop(); /* Turn the WDT off */
pcipcwd_stop();
}
return NOTIFY_DONE; return NOTIFY_DONE;
} }

View File

@@ -383,8 +383,7 @@ static long usb_pcwd_ioctl(struct file *file, unsigned int cmd,
switch (cmd) { switch (cmd) {
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
return copy_to_user(argp, &ident, return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
sizeof (ident)) ? -EFAULT : 0;
case WDIOC_GETSTATUS: case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS: case WDIOC_GETBOOTSTATUS:
@@ -518,10 +517,8 @@ static int usb_pcwd_temperature_release(struct inode *inode, struct file *file)
static int usb_pcwd_notify_sys(struct notifier_block *this, unsigned long code, void *unused) static int usb_pcwd_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
{ {
if (code==SYS_DOWN || code==SYS_HALT) { if (code == SYS_DOWN || code == SYS_HALT)
/* Turn the WDT off */ usb_pcwd_stop(usb_pcwd_device); /* Turn the WDT off */
usb_pcwd_stop(usb_pcwd_device);
}
return NOTIFY_DONE; return NOTIFY_DONE;
} }
@@ -640,7 +637,8 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi
usb_pcwd->intr_size = (le16_to_cpu(endpoint->wMaxPacketSize) > 8 ? le16_to_cpu(endpoint->wMaxPacketSize) : 8); usb_pcwd->intr_size = (le16_to_cpu(endpoint->wMaxPacketSize) > 8 ? le16_to_cpu(endpoint->wMaxPacketSize) : 8);
/* set up the memory buffer's */ /* set up the memory buffer's */
if (!(usb_pcwd->intr_buffer = usb_buffer_alloc(udev, usb_pcwd->intr_size, GFP_ATOMIC, &usb_pcwd->intr_dma))) { usb_pcwd->intr_buffer = usb_buffer_alloc(udev, usb_pcwd->intr_size, GFP_ATOMIC, &usb_pcwd->intr_dma);
if (!usb_pcwd->intr_buffer) {
printk(KERN_ERR PFX "Out of memory\n"); printk(KERN_ERR PFX "Out of memory\n");
goto error; goto error;
} }
@@ -674,11 +672,10 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi
/* Get the Firmware Version */ /* Get the Firmware Version */
got_fw_rev = usb_pcwd_send_command(usb_pcwd, CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor); got_fw_rev = usb_pcwd_send_command(usb_pcwd, CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor);
if (got_fw_rev) { if (got_fw_rev)
sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor); sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor);
} else { else
sprintf(fw_ver_str, "<card no answer>"); sprintf(fw_ver_str, "<card no answer>");
}
printk(KERN_INFO PFX "Found card (Firmware: %s) with temp option\n", printk(KERN_INFO PFX "Found card (Firmware: %s) with temp option\n",
fw_ver_str); fw_ver_str);

View File

@@ -234,8 +234,8 @@ static int wdt_gpi_release(struct inode *inode, struct file *file)
return 0; return 0;
} }
static ssize_t static ssize_t wdt_gpi_write(struct file *f, const char __user *d, size_t s,
wdt_gpi_write(struct file *f, const char __user *d, size_t s, loff_t *o) loff_t *o)
{ {
char val; char val;
@@ -325,8 +325,8 @@ static long wdt_gpi_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
/* Shutdown notifier */ /* Shutdown notifier */
static int static int wdt_gpi_notify(struct notifier_block *this, unsigned long code,
wdt_gpi_notify(struct notifier_block *this, unsigned long code, void *unused) void *unused)
{ {
if (code == SYS_DOWN || code == SYS_HALT) if (code == SYS_DOWN || code == SYS_HALT)
wdt_gpi_stop(); wdt_gpi_stop();
@@ -336,9 +336,8 @@ wdt_gpi_notify(struct notifier_block *this, unsigned long code, void *unused)
/* Init & exit procedures */ /* Init & exit procedures */
static const struct resource * static const struct resource *wdt_gpi_get_resource(struct platform_device *pdv,
wdt_gpi_get_resource(struct platform_device *pdv, const char *name, const char *name, unsigned int type)
unsigned int type)
{ {
char buf[80]; char buf[80];
if (snprintf(buf, sizeof buf, "%s_0", name) >= sizeof buf) if (snprintf(buf, sizeof buf, "%s_0", name) >= sizeof buf)

View File

@@ -215,8 +215,8 @@ static long sbwdog_ioctl(struct file *file, unsigned int cmd,
/* /*
* Notifier for system down * Notifier for system down
*/ */
static int static int sbwdog_notify_sys(struct notifier_block *this, unsigned long code,
sbwdog_notify_sys(struct notifier_block *this, unsigned long code, void *erf) void *erf)
{ {
if (code == SYS_DOWN || code == SYS_HALT) { if (code == SYS_DOWN || code == SYS_HALT) {
/* /*

View File

@@ -438,7 +438,7 @@ static long wb_smsc_wdt_ioctl(struct file *file,
WDIOF_SETTIMEOUT | WDIOF_SETTIMEOUT |
WDIOF_MAGICCLOSE, WDIOF_MAGICCLOSE,
.firmware_version = 0, .firmware_version = 0,
.identity = "SMsC 37B787 Watchdog" .identity = "SMsC 37B787 Watchdog",
}; };
uarg.i = (int __user *)arg; uarg.i = (int __user *)arg;

View File

@@ -190,7 +190,7 @@ static struct miscdevice txx9wdt_miscdev = {
}; };
static struct notifier_block txx9wdt_notifier = { static struct notifier_block txx9wdt_notifier = {
.notifier_call = txx9wdt_notify_sys .notifier_call = txx9wdt_notify_sys,
}; };
static int __init txx9wdt_probe(struct platform_device *dev) static int __init txx9wdt_probe(struct platform_device *dev)

View File

@@ -278,10 +278,9 @@ static int wdt_close(struct inode *inode, struct file *file)
static int wdt_notify_sys(struct notifier_block *this, unsigned long code, static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
void *unused) void *unused)
{ {
if (code == SYS_DOWN || code == SYS_HALT) { if (code == SYS_DOWN || code == SYS_HALT)
/* Turn the WDT off */ wdt_disable(); /* Turn the WDT off */
wdt_disable();
}
return NOTIFY_DONE; return NOTIFY_DONE;
} }

View File

@@ -325,10 +325,9 @@ static int wdt_close(struct inode *inode, struct file *file)
static int wdt_notify_sys(struct notifier_block *this, unsigned long code, static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
void *unused) void *unused)
{ {
if (code == SYS_DOWN || code == SYS_HALT) { if (code == SYS_DOWN || code == SYS_HALT)
/* Turn the WDT off */ wdt_disable(); /* Turn the WDT off */
wdt_disable();
}
return NOTIFY_DONE; return NOTIFY_DONE;
} }

View File

@@ -87,8 +87,7 @@ static void wafwdt_start(void)
inb_p(wdt_start); inb_p(wdt_start);
} }
static void static void wafwdt_stop(void)
wafwdt_stop(void)
{ {
/* stop watchdog */ /* stop watchdog */
inb_p(wdt_stop); inb_p(wdt_stop);
@@ -199,8 +198,7 @@ static int wafwdt_open(struct inode *inode, struct file *file)
return nonseekable_open(inode, file); return nonseekable_open(inode, file);
} }
static int static int wafwdt_close(struct inode *inode, struct file *file)
wafwdt_close(struct inode *inode, struct file *file)
{ {
if (expect_close == 42) if (expect_close == 42)
wafwdt_stop(); wafwdt_stop();

View File

@@ -313,7 +313,7 @@ static long wdrtas_ioctl(struct file *file, unsigned int cmd,
static struct watchdog_info wdinfo = { static struct watchdog_info wdinfo = {
.options = WDRTAS_SUPPORTED_MASK, .options = WDRTAS_SUPPORTED_MASK,
.firmware_version = 0, .firmware_version = 0,
.identity = "wdrtas" .identity = "wdrtas",
}; };
switch (cmd) { switch (cmd) {