diff options
Diffstat (limited to 'drivers/watchdog/pika_wdt.c')
-rw-r--r-- | drivers/watchdog/pika_wdt.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/watchdog/pika_wdt.c b/drivers/watchdog/pika_wdt.c index 2d22e996e996..7d3d471f810c 100644 --- a/drivers/watchdog/pika_wdt.c +++ b/drivers/watchdog/pika_wdt.c | |||
@@ -5,6 +5,8 @@ | |||
5 | * Sean MacLennan <smaclennan@pikatech.com> | 5 | * Sean MacLennan <smaclennan@pikatech.com> |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
9 | |||
8 | #include <linux/init.h> | 10 | #include <linux/init.h> |
9 | #include <linux/errno.h> | 11 | #include <linux/errno.h> |
10 | #include <linux/module.h> | 12 | #include <linux/module.h> |
@@ -23,7 +25,6 @@ | |||
23 | #include <linux/of_platform.h> | 25 | #include <linux/of_platform.h> |
24 | 26 | ||
25 | #define DRV_NAME "PIKA-WDT" | 27 | #define DRV_NAME "PIKA-WDT" |
26 | #define PFX DRV_NAME ": " | ||
27 | 28 | ||
28 | /* Hardware timeout in seconds */ | 29 | /* Hardware timeout in seconds */ |
29 | #define WDT_HW_TIMEOUT 2 | 30 | #define WDT_HW_TIMEOUT 2 |
@@ -38,8 +39,8 @@ module_param(heartbeat, int, 0); | |||
38 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeats in seconds. " | 39 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeats in seconds. " |
39 | "(default = " __MODULE_STRING(WDT_HEARTBEAT) ")"); | 40 | "(default = " __MODULE_STRING(WDT_HEARTBEAT) ")"); |
40 | 41 | ||
41 | static int nowayout = WATCHDOG_NOWAYOUT; | 42 | static bool nowayout = WATCHDOG_NOWAYOUT; |
42 | module_param(nowayout, int, 0); | 43 | module_param(nowayout, bool, 0); |
43 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started " | 44 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started " |
44 | "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | 45 | "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
45 | 46 | ||
@@ -90,7 +91,7 @@ static void pikawdt_ping(unsigned long data) | |||
90 | pikawdt_reset(); | 91 | pikawdt_reset(); |
91 | mod_timer(&pikawdt_private.timer, jiffies + WDT_TIMEOUT); | 92 | mod_timer(&pikawdt_private.timer, jiffies + WDT_TIMEOUT); |
92 | } else | 93 | } else |
93 | printk(KERN_CRIT PFX "I will reset your machine !\n"); | 94 | pr_crit("I will reset your machine !\n"); |
94 | } | 95 | } |
95 | 96 | ||
96 | 97 | ||
@@ -228,14 +229,14 @@ static int __init pikawdt_init(void) | |||
228 | 229 | ||
229 | np = of_find_compatible_node(NULL, NULL, "pika,fpga"); | 230 | np = of_find_compatible_node(NULL, NULL, "pika,fpga"); |
230 | if (np == NULL) { | 231 | if (np == NULL) { |
231 | printk(KERN_ERR PFX "Unable to find fpga.\n"); | 232 | pr_err("Unable to find fpga\n"); |
232 | return -ENOENT; | 233 | return -ENOENT; |
233 | } | 234 | } |
234 | 235 | ||
235 | pikawdt_private.fpga = of_iomap(np, 0); | 236 | pikawdt_private.fpga = of_iomap(np, 0); |
236 | of_node_put(np); | 237 | of_node_put(np); |
237 | if (pikawdt_private.fpga == NULL) { | 238 | if (pikawdt_private.fpga == NULL) { |
238 | printk(KERN_ERR PFX "Unable to map fpga.\n"); | 239 | pr_err("Unable to map fpga\n"); |
239 | return -ENOMEM; | 240 | return -ENOMEM; |
240 | } | 241 | } |
241 | 242 | ||
@@ -244,7 +245,7 @@ static int __init pikawdt_init(void) | |||
244 | /* POST information is in the sd area. */ | 245 | /* POST information is in the sd area. */ |
245 | np = of_find_compatible_node(NULL, NULL, "pika,fpga-sd"); | 246 | np = of_find_compatible_node(NULL, NULL, "pika,fpga-sd"); |
246 | if (np == NULL) { | 247 | if (np == NULL) { |
247 | printk(KERN_ERR PFX "Unable to find fpga-sd.\n"); | 248 | pr_err("Unable to find fpga-sd\n"); |
248 | ret = -ENOENT; | 249 | ret = -ENOENT; |
249 | goto out; | 250 | goto out; |
250 | } | 251 | } |
@@ -252,7 +253,7 @@ static int __init pikawdt_init(void) | |||
252 | fpga = of_iomap(np, 0); | 253 | fpga = of_iomap(np, 0); |
253 | of_node_put(np); | 254 | of_node_put(np); |
254 | if (fpga == NULL) { | 255 | if (fpga == NULL) { |
255 | printk(KERN_ERR PFX "Unable to map fpga-sd.\n"); | 256 | pr_err("Unable to map fpga-sd\n"); |
256 | ret = -ENOMEM; | 257 | ret = -ENOMEM; |
257 | goto out; | 258 | goto out; |
258 | } | 259 | } |
@@ -271,12 +272,12 @@ static int __init pikawdt_init(void) | |||
271 | 272 | ||
272 | ret = misc_register(&pikawdt_miscdev); | 273 | ret = misc_register(&pikawdt_miscdev); |
273 | if (ret) { | 274 | if (ret) { |
274 | printk(KERN_ERR PFX "Unable to register miscdev.\n"); | 275 | pr_err("Unable to register miscdev\n"); |
275 | goto out; | 276 | goto out; |
276 | } | 277 | } |
277 | 278 | ||
278 | printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", | 279 | pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", |
279 | heartbeat, nowayout); | 280 | heartbeat, nowayout); |
280 | return 0; | 281 | return 0; |
281 | 282 | ||
282 | out: | 283 | out: |