diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-29 00:03:26 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-29 00:03:26 +0400 |
commit | 750f77064a290beb162352077b52c61b04bcae0e (patch) | |
tree | 736a8dd043dc4cda298762a80e7c1fbf1bb87742 /drivers/watchdog/pc87413_wdt.c | |
parent | 89e5d6f0d979f6e7dc2bbb1ebd9e239217e2e952 (diff) | |
parent | b92c803ec61de59e6e4ab9b2748d8e633cec3f08 (diff) | |
download | linux-750f77064a290beb162352077b52c61b04bcae0e.tar.xz |
Merge git://www.linux-watchdog.org/linux-watchdog
Pull watchdog updates from Wim Van Sebroeck:
- Removal of the Documentation/watchdog/00-INDEX file
- Fix boot status reporting for imx2_wdt
- clean-up sp805_wdt, pnx4008_wdt and mpcore_wdt
- convert printk in watchdog drivers to pr_ functions
- change nowayout module parameter to bool for every watchdog device
- conversion of jz4740_wdt, pnx4008_wdt, max63xx_wdt, softdog,
ep93xx_wdt, coh901327 and txx9wdt to new watchdog API
- Add support for the WDIOC_GETTIMELEFT ioctl call to the new watchdog
API
- Change the new watchdog API so that the driver updates the timeout
value
- two fixes for the xen_wdt driver
Fix up conflicts in ep93xx driver due to the same patches being merged
through separate branches.
* git://www.linux-watchdog.org/linux-watchdog: (33 commits)
watchdog: txx9wdt: fix timeout
watchdog: Convert txx9wdt driver to watchdog framework
watchdog: coh901327_wdt.c: fix timeout
watchdog: coh901327: convert to use watchdog core
watchdog: Add support for WDIOC_GETTIMELEFT IOCTL in watchdog core
watchdog: ep93xx_wdt: timeout is an unsigned int value.
watchdog: ep93xx_wdt: Fix timeout after conversion to watchdog core
watchdog: Convert ep93xx driver to watchdog core
watchdog: sp805: Use devm routines
watchdog: sp805: replace readl/writel with lighter _relaxed variants
watchdog: sp805: Fix documentation style comment
watchdog: mpcore_wdt: Allow platform_get_irq() to fail
watchdog: mpcore_wdt: Use devm routines
watchdog: mpcore_wdt: Rename dev to pdev for pointing to struct platform_device
watchdog: xen: don't clear is_active when xen_wdt_stop() failed
watchdog: xen: don't unconditionally enable the watchdog during resume
watchdog: fix compiler error for missing parenthesis
watchdog: ep93xx_wdt.c: fix platform probe
watchdog: ep93xx: Convert the watchdog driver into a platform device.
watchdog: fix set_timeout operations
...
Diffstat (limited to 'drivers/watchdog/pc87413_wdt.c')
-rw-r--r-- | drivers/watchdog/pc87413_wdt.c | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/drivers/watchdog/pc87413_wdt.c b/drivers/watchdog/pc87413_wdt.c index e78d89986768..d5bf112e0077 100644 --- a/drivers/watchdog/pc87413_wdt.c +++ b/drivers/watchdog/pc87413_wdt.c @@ -18,6 +18,8 @@ * Release 1.1 */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/module.h> #include <linux/types.h> #include <linux/miscdevice.h> @@ -42,7 +44,6 @@ #define VERSION "1.1" #define MODNAME "pc87413 WDT" -#define PFX MODNAME ": " #define DPFX MODNAME " - DEBUG: " #define WDT_INDEX_IO_PORT (io+0) /* I/O port base (index register) */ @@ -65,7 +66,7 @@ static char expect_close; /* is the close expected? */ static DEFINE_SPINLOCK(io_lock); /* to guard us from io races */ -static int nowayout = WATCHDOG_NOWAYOUT; +static bool nowayout = WATCHDOG_NOWAYOUT; /* -- Low level function ----------------------------------------*/ @@ -87,7 +88,7 @@ static inline void pc87413_select_wdt_out(void) outb_p(cr_data, WDT_DATA_IO_PORT); #ifdef DEBUG - printk(KERN_INFO DPFX + pr_info(DPFX "Select multiple pin,pin55,as WDT output: Bit7 to 1: %d\n", cr_data); #endif @@ -111,7 +112,7 @@ static inline void pc87413_enable_swc(void) outb_p(cr_data, WDT_DATA_IO_PORT); /* Index0x30_bit0P1 */ #ifdef DEBUG - printk(KERN_INFO DPFX "pc87413 - Enable SWC functions\n"); + pr_info(DPFX "pc87413 - Enable SWC functions\n"); #endif } @@ -132,7 +133,7 @@ static void pc87413_get_swc_base_addr(void) swc_base_addr = (addr_h << 8) + addr_l; #ifdef DEBUG - printk(KERN_INFO DPFX + pr_info(DPFX "Read SWC I/O Base Address: low %d, high %d, res %d\n", addr_l, addr_h, swc_base_addr); #endif @@ -145,7 +146,7 @@ static inline void pc87413_swc_bank3(void) /* Step 4: Select Bank3 of SWC */ outb_p(inb(swc_base_addr + 0x0f) | 0x03, swc_base_addr + 0x0f); #ifdef DEBUG - printk(KERN_INFO DPFX "Select Bank3 of SWC\n"); + pr_info(DPFX "Select Bank3 of SWC\n"); #endif } @@ -156,7 +157,7 @@ static inline void pc87413_programm_wdto(char pc87413_time) /* Step 5: Programm WDTO, Twd. */ outb_p(pc87413_time, swc_base_addr + WDTO); #ifdef DEBUG - printk(KERN_INFO DPFX "Set WDTO to %d minutes\n", pc87413_time); + pr_info(DPFX "Set WDTO to %d minutes\n", pc87413_time); #endif } @@ -167,7 +168,7 @@ static inline void pc87413_enable_wden(void) /* Step 6: Enable WDEN */ outb_p(inb(swc_base_addr + WDCTL) | 0x01, swc_base_addr + WDCTL); #ifdef DEBUG - printk(KERN_INFO DPFX "Enable WDEN\n"); + pr_info(DPFX "Enable WDEN\n"); #endif } @@ -177,7 +178,7 @@ static inline void pc87413_enable_sw_wd_tren(void) /* Enable SW_WD_TREN */ outb_p(inb(swc_base_addr + WDCFG) | 0x80, swc_base_addr + WDCFG); #ifdef DEBUG - printk(KERN_INFO DPFX "Enable SW_WD_TREN\n"); + pr_info(DPFX "Enable SW_WD_TREN\n"); #endif } @@ -188,7 +189,7 @@ static inline void pc87413_disable_sw_wd_tren(void) /* Disable SW_WD_TREN */ outb_p(inb(swc_base_addr + WDCFG) & 0x7f, swc_base_addr + WDCFG); #ifdef DEBUG - printk(KERN_INFO DPFX "pc87413 - Disable SW_WD_TREN\n"); + pr_info(DPFX "pc87413 - Disable SW_WD_TREN\n"); #endif } @@ -199,7 +200,7 @@ static inline void pc87413_enable_sw_wd_trg(void) /* Enable SW_WD_TRG */ outb_p(inb(swc_base_addr + WDCTL) | 0x80, swc_base_addr + WDCTL); #ifdef DEBUG - printk(KERN_INFO DPFX "pc87413 - Enable SW_WD_TRG\n"); + pr_info(DPFX "pc87413 - Enable SW_WD_TRG\n"); #endif } @@ -210,7 +211,7 @@ static inline void pc87413_disable_sw_wd_trg(void) /* Disable SW_WD_TRG */ outb_p(inb(swc_base_addr + WDCTL) & 0x7f, swc_base_addr + WDCTL); #ifdef DEBUG - printk(KERN_INFO DPFX "Disable SW_WD_TRG\n"); + pr_info(DPFX "Disable SW_WD_TRG\n"); #endif } @@ -284,8 +285,7 @@ static int pc87413_open(struct inode *inode, struct file *file) /* Reload and activate timer */ pc87413_refresh(); - printk(KERN_INFO MODNAME - "Watchdog enabled. Timeout set to %d minute(s).\n", timeout); + pr_info("Watchdog enabled. Timeout set to %d minute(s).\n", timeout); return nonseekable_open(inode, file); } @@ -308,11 +308,9 @@ static int pc87413_release(struct inode *inode, struct file *file) if (expect_close == 42) { pc87413_disable(); - printk(KERN_INFO MODNAME - "Watchdog disabled, sleeping again...\n"); + pr_info("Watchdog disabled, sleeping again...\n"); } else { - printk(KERN_CRIT MODNAME - "Unexpected close, not stopping watchdog!\n"); + pr_crit("Unexpected close, not stopping watchdog!\n"); pc87413_refresh(); } clear_bit(0, &timer_enabled); @@ -428,7 +426,7 @@ static long pc87413_ioctl(struct file *file, unsigned int cmd, case WDIOC_KEEPALIVE: pc87413_refresh(); #ifdef DEBUG - printk(KERN_INFO DPFX "keepalive\n"); + pr_info(DPFX "keepalive\n"); #endif return 0; case WDIOC_SETTIMEOUT: @@ -508,7 +506,7 @@ static int __init pc87413_init(void) { int ret; - printk(KERN_INFO PFX "Version " VERSION " at io 0x%X\n", + pr_info("Version " VERSION " at io 0x%X\n", WDT_INDEX_IO_PORT); if (!request_muxed_region(io, 2, MODNAME)) @@ -516,26 +514,23 @@ static int __init pc87413_init(void) ret = register_reboot_notifier(&pc87413_notifier); if (ret != 0) { - printk(KERN_ERR PFX - "cannot register reboot notifier (err=%d)\n", ret); + pr_err("cannot register reboot notifier (err=%d)\n", ret); } ret = misc_register(&pc87413_miscdev); if (ret != 0) { - printk(KERN_ERR PFX - "cannot register miscdev on minor=%d (err=%d)\n", - WATCHDOG_MINOR, ret); + pr_err("cannot register miscdev on minor=%d (err=%d)\n", + WATCHDOG_MINOR, ret); goto reboot_unreg; } - printk(KERN_INFO PFX "initialized. timeout=%d min \n", timeout); + pr_info("initialized. timeout=%d min\n", timeout); pc87413_select_wdt_out(); pc87413_enable_swc(); pc87413_get_swc_base_addr(); if (!request_region(swc_base_addr, 0x20, MODNAME)) { - printk(KERN_ERR PFX - "cannot request SWC region at 0x%x\n", swc_base_addr); + pr_err("cannot request SWC region at 0x%x\n", swc_base_addr); ret = -EBUSY; goto misc_unreg; } @@ -568,14 +563,14 @@ static void __exit pc87413_exit(void) /* Stop the timer before we leave */ if (!nowayout) { pc87413_disable(); - printk(KERN_INFO MODNAME "Watchdog disabled.\n"); + pr_info("Watchdog disabled\n"); } misc_deregister(&pc87413_miscdev); unregister_reboot_notifier(&pc87413_notifier); release_region(swc_base_addr, 0x20); - printk(KERN_INFO MODNAME " watchdog component driver removed.\n"); + pr_info("watchdog component driver removed\n"); } module_init(pc87413_init); @@ -597,7 +592,7 @@ MODULE_PARM_DESC(timeout, "Watchdog timeout in minutes (default=" __MODULE_STRING(DEFAULT_TIMEOUT) ")."); -module_param(nowayout, int, 0); +module_param(nowayout, bool, 0); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |