diff options
author | Joe Perches <joe@perches.com> | 2012-02-15 18:06:19 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2012-03-27 13:59:26 -0400 |
commit | 27c766aaacb265d625dc634bf7903f7f9fd0c697 (patch) | |
tree | 06b399d21dec006bc0a3e1c6685b076753e19b94 /drivers/watchdog/pnx833x_wdt.c | |
parent | 7cbc353540c31ffaf65ad44d89b955be0f1d04dc (diff) |
watchdog: Use pr_<fmt> and pr_<level>
Use the current logging styles.
Make sure all output has a prefix.
Add missing newlines.
Remove now unnecessary PFX, NAME, and miscellaneous other #defines.
Coalesce formats.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/pnx833x_wdt.c')
-rw-r--r-- | drivers/watchdog/pnx833x_wdt.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/drivers/watchdog/pnx833x_wdt.c b/drivers/watchdog/pnx833x_wdt.c index a7b5ad2a98bd..97959e9738e4 100644 --- a/drivers/watchdog/pnx833x_wdt.c +++ b/drivers/watchdog/pnx833x_wdt.c | |||
@@ -17,6 +17,8 @@ | |||
17 | * based on softdog.c by Alan Cox <alan@redhat.com> | 17 | * based on softdog.c by Alan Cox <alan@redhat.com> |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
21 | |||
20 | #include <linux/module.h> | 22 | #include <linux/module.h> |
21 | #include <linux/moduleparam.h> | 23 | #include <linux/moduleparam.h> |
22 | #include <linux/types.h> | 24 | #include <linux/types.h> |
@@ -30,7 +32,6 @@ | |||
30 | #include <linux/init.h> | 32 | #include <linux/init.h> |
31 | #include <asm/mach-pnx833x/pnx833x.h> | 33 | #include <asm/mach-pnx833x/pnx833x.h> |
32 | 34 | ||
33 | #define PFX "pnx833x: " | ||
34 | #define WATCHDOG_TIMEOUT 30 /* 30 sec Maximum timeout */ | 35 | #define WATCHDOG_TIMEOUT 30 /* 30 sec Maximum timeout */ |
35 | #define WATCHDOG_COUNT_FREQUENCY 68000000U /* Watchdog counts at 68MHZ. */ | 36 | #define WATCHDOG_COUNT_FREQUENCY 68000000U /* Watchdog counts at 68MHZ. */ |
36 | #define PNX_WATCHDOG_TIMEOUT (WATCHDOG_TIMEOUT * WATCHDOG_COUNT_FREQUENCY) | 37 | #define PNX_WATCHDOG_TIMEOUT (WATCHDOG_TIMEOUT * WATCHDOG_COUNT_FREQUENCY) |
@@ -76,7 +77,7 @@ static void pnx833x_wdt_start(void) | |||
76 | PNX833X_REG(PNX833X_CONFIG + | 77 | PNX833X_REG(PNX833X_CONFIG + |
77 | PNX833X_CONFIG_CPU_COUNTERS_CONTROL) |= 0x1; | 78 | PNX833X_CONFIG_CPU_COUNTERS_CONTROL) |= 0x1; |
78 | 79 | ||
79 | printk(KERN_INFO PFX "Started watchdog timer.\n"); | 80 | pr_info("Started watchdog timer\n"); |
80 | } | 81 | } |
81 | 82 | ||
82 | static void pnx833x_wdt_stop(void) | 83 | static void pnx833x_wdt_stop(void) |
@@ -87,7 +88,7 @@ static void pnx833x_wdt_stop(void) | |||
87 | PNX833X_REG(PNX833X_CONFIG + | 88 | PNX833X_REG(PNX833X_CONFIG + |
88 | PNX833X_CONFIG_CPU_COUNTERS_CONTROL) &= 0xFFFFFFFE; | 89 | PNX833X_CONFIG_CPU_COUNTERS_CONTROL) &= 0xFFFFFFFE; |
89 | 90 | ||
90 | printk(KERN_INFO PFX "Stopped watchdog timer.\n"); | 91 | pr_info("Stopped watchdog timer\n"); |
91 | } | 92 | } |
92 | 93 | ||
93 | static void pnx833x_wdt_ping(void) | 94 | static void pnx833x_wdt_ping(void) |
@@ -113,7 +114,7 @@ static int pnx833x_wdt_open(struct inode *inode, struct file *file) | |||
113 | 114 | ||
114 | pnx833x_wdt_ping(); | 115 | pnx833x_wdt_ping(); |
115 | 116 | ||
116 | printk(KERN_INFO "Started watchdog timer.\n"); | 117 | pr_info("Started watchdog timer\n"); |
117 | 118 | ||
118 | return nonseekable_open(inode, file); | 119 | return nonseekable_open(inode, file); |
119 | } | 120 | } |
@@ -232,9 +233,6 @@ static struct notifier_block pnx833x_wdt_notifier = { | |||
232 | .notifier_call = pnx833x_wdt_notify_sys, | 233 | .notifier_call = pnx833x_wdt_notify_sys, |
233 | }; | 234 | }; |
234 | 235 | ||
235 | static char banner[] __initdata = | ||
236 | KERN_INFO PFX "Hardware Watchdog Timer for PNX833x: Version 0.1\n"; | ||
237 | |||
238 | static int __init watchdog_init(void) | 236 | static int __init watchdog_init(void) |
239 | { | 237 | { |
240 | int ret, cause; | 238 | int ret, cause; |
@@ -243,27 +241,25 @@ static int __init watchdog_init(void) | |||
243 | cause = PNX833X_REG(PNX833X_RESET); | 241 | cause = PNX833X_REG(PNX833X_RESET); |
244 | /*If bit 31 is set then watchdog was cause of reset.*/ | 242 | /*If bit 31 is set then watchdog was cause of reset.*/ |
245 | if (cause & 0x80000000) { | 243 | if (cause & 0x80000000) { |
246 | printk(KERN_INFO PFX "The system was previously reset due to " | 244 | pr_info("The system was previously reset due to the watchdog firing - please investigate...\n"); |
247 | "the watchdog firing - please investigate...\n"); | ||
248 | } | 245 | } |
249 | 246 | ||
250 | ret = register_reboot_notifier(&pnx833x_wdt_notifier); | 247 | ret = register_reboot_notifier(&pnx833x_wdt_notifier); |
251 | if (ret) { | 248 | if (ret) { |
252 | printk(KERN_ERR PFX | 249 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
253 | "cannot register reboot notifier (err=%d)\n", ret); | ||
254 | return ret; | 250 | return ret; |
255 | } | 251 | } |
256 | 252 | ||
257 | ret = misc_register(&pnx833x_wdt_miscdev); | 253 | ret = misc_register(&pnx833x_wdt_miscdev); |
258 | if (ret) { | 254 | if (ret) { |
259 | printk(KERN_ERR PFX | 255 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
260 | "cannot register miscdev on minor=%d (err=%d)\n", | 256 | WATCHDOG_MINOR, ret); |
261 | WATCHDOG_MINOR, ret); | ||
262 | unregister_reboot_notifier(&pnx833x_wdt_notifier); | 257 | unregister_reboot_notifier(&pnx833x_wdt_notifier); |
263 | return ret; | 258 | return ret; |
264 | } | 259 | } |
265 | 260 | ||
266 | printk(banner); | 261 | pr_info("Hardware Watchdog Timer for PNX833x: Version 0.1\n"); |
262 | |||
267 | if (start_enabled) | 263 | if (start_enabled) |
268 | pnx833x_wdt_start(); | 264 | pnx833x_wdt_start(); |
269 | 265 | ||