diff options
Diffstat (limited to 'drivers/watchdog/sbc8360.c')
-rw-r--r-- | drivers/watchdog/sbc8360.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/watchdog/sbc8360.c b/drivers/watchdog/sbc8360.c index 514ec23050f7..a9ea385fa125 100644 --- a/drivers/watchdog/sbc8360.c +++ b/drivers/watchdog/sbc8360.c | |||
@@ -36,6 +36,8 @@ | |||
36 | * | 36 | * |
37 | */ | 37 | */ |
38 | 38 | ||
39 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
40 | |||
39 | #include <linux/module.h> | 41 | #include <linux/module.h> |
40 | #include <linux/types.h> | 42 | #include <linux/types.h> |
41 | #include <linux/miscdevice.h> | 43 | #include <linux/miscdevice.h> |
@@ -56,8 +58,6 @@ | |||
56 | static unsigned long sbc8360_is_open; | 58 | static unsigned long sbc8360_is_open; |
57 | static char expect_close; | 59 | static char expect_close; |
58 | 60 | ||
59 | #define PFX "sbc8360: " | ||
60 | |||
61 | /* | 61 | /* |
62 | * | 62 | * |
63 | * Watchdog Timer Configuration | 63 | * Watchdog Timer Configuration |
@@ -197,11 +197,11 @@ static int wd_times[64][2] = { | |||
197 | static int timeout = 27; | 197 | static int timeout = 27; |
198 | static int wd_margin = 0xB; | 198 | static int wd_margin = 0xB; |
199 | static int wd_multiplier = 2; | 199 | static int wd_multiplier = 2; |
200 | static int nowayout = WATCHDOG_NOWAYOUT; | 200 | static bool nowayout = WATCHDOG_NOWAYOUT; |
201 | 201 | ||
202 | module_param(timeout, int, 0); | 202 | module_param(timeout, int, 0); |
203 | MODULE_PARM_DESC(timeout, "Index into timeout table (0-63) (default=27 (60s))"); | 203 | MODULE_PARM_DESC(timeout, "Index into timeout table (0-63) (default=27 (60s))"); |
204 | module_param(nowayout, int, 0); | 204 | module_param(nowayout, bool, 0); |
205 | MODULE_PARM_DESC(nowayout, | 205 | MODULE_PARM_DESC(nowayout, |
206 | "Watchdog cannot be stopped once started (default=" | 206 | "Watchdog cannot be stopped once started (default=" |
207 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | 207 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
@@ -280,8 +280,7 @@ static int sbc8360_close(struct inode *inode, struct file *file) | |||
280 | if (expect_close == 42) | 280 | if (expect_close == 42) |
281 | sbc8360_stop(); | 281 | sbc8360_stop(); |
282 | else | 282 | else |
283 | printk(KERN_CRIT PFX "SBC8360 device closed unexpectedly. " | 283 | pr_crit("SBC8360 device closed unexpectedly. SBC8360 will not stop!\n"); |
284 | "SBC8360 will not stop!\n"); | ||
285 | 284 | ||
286 | clear_bit(0, &sbc8360_is_open); | 285 | clear_bit(0, &sbc8360_is_open); |
287 | expect_close = 0; | 286 | expect_close = 0; |
@@ -334,20 +333,19 @@ static int __init sbc8360_init(void) | |||
334 | unsigned long int mseconds = 60000; | 333 | unsigned long int mseconds = 60000; |
335 | 334 | ||
336 | if (timeout < 0 || timeout > 63) { | 335 | if (timeout < 0 || timeout > 63) { |
337 | printk(KERN_ERR PFX "Invalid timeout index (must be 0-63).\n"); | 336 | pr_err("Invalid timeout index (must be 0-63)\n"); |
338 | res = -EINVAL; | 337 | res = -EINVAL; |
339 | goto out; | 338 | goto out; |
340 | } | 339 | } |
341 | 340 | ||
342 | if (!request_region(SBC8360_ENABLE, 1, "SBC8360")) { | 341 | if (!request_region(SBC8360_ENABLE, 1, "SBC8360")) { |
343 | printk(KERN_ERR PFX "ENABLE method I/O %X is not available.\n", | 342 | pr_err("ENABLE method I/O %X is not available\n", |
344 | SBC8360_ENABLE); | 343 | SBC8360_ENABLE); |
345 | res = -EIO; | 344 | res = -EIO; |
346 | goto out; | 345 | goto out; |
347 | } | 346 | } |
348 | if (!request_region(SBC8360_BASETIME, 1, "SBC8360")) { | 347 | if (!request_region(SBC8360_BASETIME, 1, "SBC8360")) { |
349 | printk(KERN_ERR PFX | 348 | pr_err("BASETIME method I/O %X is not available\n", |
350 | "BASETIME method I/O %X is not available.\n", | ||
351 | SBC8360_BASETIME); | 349 | SBC8360_BASETIME); |
352 | res = -EIO; | 350 | res = -EIO; |
353 | goto out_nobasetimereg; | 351 | goto out_nobasetimereg; |
@@ -355,13 +353,13 @@ static int __init sbc8360_init(void) | |||
355 | 353 | ||
356 | res = register_reboot_notifier(&sbc8360_notifier); | 354 | res = register_reboot_notifier(&sbc8360_notifier); |
357 | if (res) { | 355 | if (res) { |
358 | printk(KERN_ERR PFX "Failed to register reboot notifier.\n"); | 356 | pr_err("Failed to register reboot notifier\n"); |
359 | goto out_noreboot; | 357 | goto out_noreboot; |
360 | } | 358 | } |
361 | 359 | ||
362 | res = misc_register(&sbc8360_miscdev); | 360 | res = misc_register(&sbc8360_miscdev); |
363 | if (res) { | 361 | if (res) { |
364 | printk(KERN_ERR PFX "failed to register misc device\n"); | 362 | pr_err("failed to register misc device\n"); |
365 | goto out_nomisc; | 363 | goto out_nomisc; |
366 | } | 364 | } |
367 | 365 | ||
@@ -378,7 +376,7 @@ static int __init sbc8360_init(void) | |||
378 | mseconds = (wd_margin + 1) * 100000; | 376 | mseconds = (wd_margin + 1) * 100000; |
379 | 377 | ||
380 | /* My kingdom for the ability to print "0.5 seconds" in the kernel! */ | 378 | /* My kingdom for the ability to print "0.5 seconds" in the kernel! */ |
381 | printk(KERN_INFO PFX "Timeout set at %ld ms.\n", mseconds); | 379 | pr_info("Timeout set at %ld ms\n", mseconds); |
382 | 380 | ||
383 | return 0; | 381 | return 0; |
384 | 382 | ||