X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=drivers%2Fwatchdog%2Fscx200_wdt.c;h=8ae7c282d465ade3be2c3f08efe91968bf2bb503;hb=86a1e1896c2710402e29a875d8d830244274244d;hp=e67b76c0526c340f80ddba05e978b0bd46e15844;hpb=31583d6acf940d2951bc8716557b06d9de5a0c4b;p=mirror_ubuntu-artful-kernel.git diff --git a/drivers/watchdog/scx200_wdt.c b/drivers/watchdog/scx200_wdt.c index e67b76c0526c..8ae7c282d465 100644 --- a/drivers/watchdog/scx200_wdt.c +++ b/drivers/watchdog/scx200_wdt.c @@ -17,6 +17,8 @@ of any nature resulting due to the use of this software. This software is provided AS-IS with no warranties. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -30,7 +32,7 @@ #include #include -#define NAME "scx200_wdt" +#define DEBUG MODULE_AUTHOR("Christer Weinigel "); MODULE_DESCRIPTION("NatSemi SCx200 Watchdog Driver"); @@ -41,8 +43,8 @@ static int margin = 60; /* in seconds */ module_param(margin, int, 0); MODULE_PARM_DESC(margin, "Watchdog margin in seconds"); -static int nowayout = WATCHDOG_NOWAYOUT; -module_param(nowayout, int, 0); +static bool nowayout = WATCHDOG_NOWAYOUT; +module_param(nowayout, bool, 0); MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close"); static u16 wdto_restart; @@ -66,14 +68,13 @@ static void scx200_wdt_ping(void) static void scx200_wdt_update_margin(void) { - printk(KERN_INFO NAME ": timer margin %d seconds\n", margin); + pr_info("timer margin %d seconds\n", margin); wdto_restart = margin * W_SCALE; } static void scx200_wdt_enable(void) { - printk(KERN_DEBUG NAME ": enabling watchdog timer, wdto_restart = %d\n", - wdto_restart); + pr_debug("enabling watchdog timer, wdto_restart = %d\n", wdto_restart); spin_lock(&scx_lock); outw(0, scx200_cb_base + SCx200_WDT_WDTO); @@ -86,7 +87,7 @@ static void scx200_wdt_enable(void) static void scx200_wdt_disable(void) { - printk(KERN_DEBUG NAME ": disabling watchdog timer\n"); + pr_debug("disabling watchdog timer\n"); spin_lock(&scx_lock); outw(0, scx200_cb_base + SCx200_WDT_WDTO); @@ -108,9 +109,7 @@ static int scx200_wdt_open(struct inode *inode, struct file *file) static int scx200_wdt_release(struct inode *inode, struct file *file) { if (expect_close != 42) - printk(KERN_WARNING NAME - ": watchdog device closed unexpectedly, " - "will not disable the watchdog timer\n"); + pr_warn("watchdog device closed unexpectedly, will not disable the watchdog timer\n"); else if (!nowayout) scx200_wdt_disable(); expect_close = 0; @@ -219,7 +218,7 @@ static int __init scx200_wdt_init(void) { int r; - printk(KERN_DEBUG NAME ": NatSemi SCx200 Watchdog Driver\n"); + pr_debug("NatSemi SCx200 Watchdog Driver\n"); /* check that we have found the configuration block */ if (!scx200_cb_present()) @@ -228,7 +227,7 @@ static int __init scx200_wdt_init(void) if (!request_region(scx200_cb_base + SCx200_WDT_OFFSET, SCx200_WDT_SIZE, "NatSemi SCx200 Watchdog")) { - printk(KERN_WARNING NAME ": watchdog I/O region busy\n"); + pr_warn("watchdog I/O region busy\n"); return -EBUSY; } @@ -237,7 +236,7 @@ static int __init scx200_wdt_init(void) r = register_reboot_notifier(&scx200_wdt_notifier); if (r) { - printk(KERN_ERR NAME ": unable to register reboot notifier"); + pr_err("unable to register reboot notifier\n"); release_region(scx200_cb_base + SCx200_WDT_OFFSET, SCx200_WDT_SIZE); return r;