X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=drivers%2Fwatchdog%2Fsmsc37b787_wdt.c;h=6d665f9c1d586393224594df0d2ae57bd9412b29;hb=477ce17decc1bf58b21f7ec62cca1016c4f9432a;hp=97b8184614ae6b0956a873ec50cb955a731b8553;hpb=54a0f91301950af3d6ae2ff2bf710c9c68a9bfea;p=cascardo%2Flinux.git diff --git a/drivers/watchdog/smsc37b787_wdt.c b/drivers/watchdog/smsc37b787_wdt.c index 97b8184614ae..6d665f9c1d58 100644 --- a/drivers/watchdog/smsc37b787_wdt.c +++ b/drivers/watchdog/smsc37b787_wdt.c @@ -43,6 +43,8 @@ * Documentation/watchdog/wdt.txt */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -58,7 +60,6 @@ #include #include -#include /* enable support for minutes as units? */ /* (does not always work correctly, so disabled by default!) */ @@ -70,7 +71,6 @@ #define UNIT_SECOND 0 #define UNIT_MINUTE 1 -#define MODNAME "smsc37b787_wdt: " #define VERSION "1.1" #define IOPORT 0x3F0 @@ -85,7 +85,7 @@ static char expect_close; /* is the close expected? */ static DEFINE_SPINLOCK(io_lock);/* to guard the watchdog from io races */ -static int nowayout = WATCHDOG_NOWAYOUT; +static bool nowayout = WATCHDOG_NOWAYOUT; /* -- Low level function ----------------------------------------*/ @@ -363,8 +363,7 @@ static int wb_smsc_wdt_open(struct inode *inode, struct file *file) /* Reload and activate timer */ wb_smsc_wdt_enable(); - printk(KERN_INFO MODNAME - "Watchdog enabled. Timeout set to %d %s.\n", + pr_info("Watchdog enabled. Timeout set to %d %s\n", timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); return nonseekable_open(inode, file); @@ -378,11 +377,9 @@ static int wb_smsc_wdt_release(struct inode *inode, struct file *file) if (expect_close == 42) { wb_smsc_wdt_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"); wb_smsc_wdt_reset_timer(); } @@ -534,12 +531,11 @@ static int __init wb_smsc_wdt_init(void) { int ret; - printk(KERN_INFO "SMsC 37B787 watchdog component driver " - VERSION " initialising...\n"); + pr_info("SMsC 37B787 watchdog component driver " + VERSION " initialising...\n"); if (!request_region(IOPORT, IOPORT_SIZE, "SMsC 37B787 watchdog")) { - printk(KERN_ERR MODNAME "Unable to register IO port %#x\n", - IOPORT); + pr_err("Unable to register IO port %#x\n", IOPORT); ret = -EBUSY; goto out_pnp; } @@ -553,25 +549,22 @@ static int __init wb_smsc_wdt_init(void) ret = register_reboot_notifier(&wb_smsc_wdt_notifier); if (ret) { - printk(KERN_ERR MODNAME - "Unable to register reboot notifier err = %d\n", ret); + pr_err("Unable to register reboot notifier err = %d\n", ret); goto out_io; } ret = misc_register(&wb_smsc_wdt_miscdev); if (ret) { - printk(KERN_ERR MODNAME - "Unable to register miscdev on minor %d\n", - WATCHDOG_MINOR); + pr_err("Unable to register miscdev on minor %d\n", + WATCHDOG_MINOR); goto out_rbt; } /* output info */ - printk(KERN_INFO MODNAME "Timeout set to %d %s.\n", + pr_info("Timeout set to %d %s\n", timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); - printk(KERN_INFO MODNAME - "Watchdog initialized and sleeping (nowayout=%d)...\n", - nowayout); + pr_info("Watchdog initialized and sleeping (nowayout=%d)...\n", + nowayout); out_clean: return ret; @@ -592,14 +585,14 @@ static void __exit wb_smsc_wdt_exit(void) /* Stop the timer before we leave */ if (!nowayout) { wb_smsc_wdt_shutdown(); - printk(KERN_INFO MODNAME "Watchdog disabled.\n"); + pr_info("Watchdog disabled\n"); } misc_deregister(&wb_smsc_wdt_miscdev); unregister_reboot_notifier(&wb_smsc_wdt_notifier); release_region(IOPORT, IOPORT_SIZE); - printk(KERN_INFO "SMsC 37B787 watchdog component driver removed.\n"); + pr_info("SMsC 37B787 watchdog component driver removed\n"); } module_init(wb_smsc_wdt_init); @@ -621,7 +614,7 @@ MODULE_PARM_DESC(unit, module_param(timeout, int, 0); MODULE_PARM_DESC(timeout, "range is 1-255 units, default is 60"); -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) ")");