diff options
Diffstat (limited to 'drivers/watchdog/acquirewdt.c')
-rw-r--r-- | drivers/watchdog/acquirewdt.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c index b6a2b58cbe64..4397881c83f4 100644 --- a/drivers/watchdog/acquirewdt.c +++ b/drivers/watchdog/acquirewdt.c | |||
@@ -52,6 +52,8 @@ | |||
52 | * Includes, defines, variables, module parameters, ... | 52 | * Includes, defines, variables, module parameters, ... |
53 | */ | 53 | */ |
54 | 54 | ||
55 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
56 | |||
55 | /* Includes */ | 57 | /* Includes */ |
56 | #include <linux/module.h> /* For module specific items */ | 58 | #include <linux/module.h> /* For module specific items */ |
57 | #include <linux/moduleparam.h> /* For new moduleparam's */ | 59 | #include <linux/moduleparam.h> /* For new moduleparam's */ |
@@ -70,7 +72,6 @@ | |||
70 | 72 | ||
71 | /* Module information */ | 73 | /* Module information */ |
72 | #define DRV_NAME "acquirewdt" | 74 | #define DRV_NAME "acquirewdt" |
73 | #define PFX DRV_NAME ": " | ||
74 | #define WATCHDOG_NAME "Acquire WDT" | 75 | #define WATCHDOG_NAME "Acquire WDT" |
75 | /* There is no way to see what the correct time-out period is */ | 76 | /* There is no way to see what the correct time-out period is */ |
76 | #define WATCHDOG_HEARTBEAT 0 | 77 | #define WATCHDOG_HEARTBEAT 0 |
@@ -92,8 +93,8 @@ static int wdt_start = 0x443; | |||
92 | module_param(wdt_start, int, 0); | 93 | module_param(wdt_start, int, 0); |
93 | MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)"); | 94 | MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)"); |
94 | 95 | ||
95 | static int nowayout = WATCHDOG_NOWAYOUT; | 96 | static bool nowayout = WATCHDOG_NOWAYOUT; |
96 | module_param(nowayout, int, 0); | 97 | module_param(nowayout, bool, 0); |
97 | MODULE_PARM_DESC(nowayout, | 98 | MODULE_PARM_DESC(nowayout, |
98 | "Watchdog cannot be stopped once started (default=" | 99 | "Watchdog cannot be stopped once started (default=" |
99 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | 100 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
@@ -208,8 +209,7 @@ static int acq_close(struct inode *inode, struct file *file) | |||
208 | if (expect_close == 42) { | 209 | if (expect_close == 42) { |
209 | acq_stop(); | 210 | acq_stop(); |
210 | } else { | 211 | } else { |
211 | printk(KERN_CRIT PFX | 212 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
212 | "Unexpected close, not stopping watchdog!\n"); | ||
213 | acq_keepalive(); | 213 | acq_keepalive(); |
214 | } | 214 | } |
215 | clear_bit(0, &acq_is_open); | 215 | clear_bit(0, &acq_is_open); |
@@ -246,27 +246,24 @@ static int __devinit acq_probe(struct platform_device *dev) | |||
246 | 246 | ||
247 | if (wdt_stop != wdt_start) { | 247 | if (wdt_stop != wdt_start) { |
248 | if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { | 248 | if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { |
249 | printk(KERN_ERR PFX | 249 | pr_err("I/O address 0x%04x already in use\n", wdt_stop); |
250 | "I/O address 0x%04x already in use\n", wdt_stop); | ||
251 | ret = -EIO; | 250 | ret = -EIO; |
252 | goto out; | 251 | goto out; |
253 | } | 252 | } |
254 | } | 253 | } |
255 | 254 | ||
256 | if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { | 255 | if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { |
257 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 256 | pr_err("I/O address 0x%04x already in use\n", wdt_start); |
258 | wdt_start); | ||
259 | ret = -EIO; | 257 | ret = -EIO; |
260 | goto unreg_stop; | 258 | goto unreg_stop; |
261 | } | 259 | } |
262 | ret = misc_register(&acq_miscdev); | 260 | ret = misc_register(&acq_miscdev); |
263 | if (ret != 0) { | 261 | if (ret != 0) { |
264 | printk(KERN_ERR PFX | 262 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
265 | "cannot register miscdev on minor=%d (err=%d)\n", | 263 | WATCHDOG_MINOR, ret); |
266 | WATCHDOG_MINOR, ret); | ||
267 | goto unreg_regions; | 264 | goto unreg_regions; |
268 | } | 265 | } |
269 | printk(KERN_INFO PFX "initialized. (nowayout=%d)\n", nowayout); | 266 | pr_info("initialized. (nowayout=%d)\n", nowayout); |
270 | 267 | ||
271 | return 0; | 268 | return 0; |
272 | unreg_regions: | 269 | unreg_regions: |
@@ -308,8 +305,7 @@ static int __init acq_init(void) | |||
308 | { | 305 | { |
309 | int err; | 306 | int err; |
310 | 307 | ||
311 | printk(KERN_INFO | 308 | pr_info("WDT driver for Acquire single board computer initialising\n"); |
312 | "WDT driver for Acquire single board computer initialising.\n"); | ||
313 | 309 | ||
314 | err = platform_driver_register(&acquirewdt_driver); | 310 | err = platform_driver_register(&acquirewdt_driver); |
315 | if (err) | 311 | if (err) |
@@ -332,7 +328,7 @@ static void __exit acq_exit(void) | |||
332 | { | 328 | { |
333 | platform_device_unregister(acq_platform_device); | 329 | platform_device_unregister(acq_platform_device); |
334 | platform_driver_unregister(&acquirewdt_driver); | 330 | platform_driver_unregister(&acquirewdt_driver); |
335 | printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); | 331 | pr_info("Watchdog Module Unloaded\n"); |
336 | } | 332 | } |
337 | 333 | ||
338 | module_init(acq_init); | 334 | module_init(acq_init); |