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/rc32434_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/rc32434_wdt.c')
-rw-r--r-- | drivers/watchdog/rc32434_wdt.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/watchdog/rc32434_wdt.c b/drivers/watchdog/rc32434_wdt.c index bf7bc8aa1c01..76c9d1cf8cf1 100644 --- a/drivers/watchdog/rc32434_wdt.c +++ b/drivers/watchdog/rc32434_wdt.c | |||
@@ -17,6 +17,8 @@ | |||
17 | * | 17 | * |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
21 | |||
20 | #include <linux/module.h> /* For module specific items */ | 22 | #include <linux/module.h> /* For module specific items */ |
21 | #include <linux/moduleparam.h> /* For new moduleparam's */ | 23 | #include <linux/moduleparam.h> /* For new moduleparam's */ |
22 | #include <linux/types.h> /* For standard types (like size_t) */ | 24 | #include <linux/types.h> /* For standard types (like size_t) */ |
@@ -33,8 +35,6 @@ | |||
33 | 35 | ||
34 | #include <asm/mach-rc32434/integ.h> /* For the Watchdog registers */ | 36 | #include <asm/mach-rc32434/integ.h> /* For the Watchdog registers */ |
35 | 37 | ||
36 | #define PFX KBUILD_MODNAME ": " | ||
37 | |||
38 | #define VERSION "1.0" | 38 | #define VERSION "1.0" |
39 | 39 | ||
40 | static struct { | 40 | static struct { |
@@ -78,8 +78,7 @@ static int rc32434_wdt_set(int new_timeout) | |||
78 | int max_to = WTCOMP2SEC((u32)-1); | 78 | int max_to = WTCOMP2SEC((u32)-1); |
79 | 79 | ||
80 | if (new_timeout < 0 || new_timeout > max_to) { | 80 | if (new_timeout < 0 || new_timeout > max_to) { |
81 | printk(KERN_ERR PFX "timeout value must be between 0 and %d", | 81 | pr_err("timeout value must be between 0 and %d\n", max_to); |
82 | max_to); | ||
83 | return -EINVAL; | 82 | return -EINVAL; |
84 | } | 83 | } |
85 | timeout = new_timeout; | 84 | timeout = new_timeout; |
@@ -119,7 +118,7 @@ static void rc32434_wdt_start(void) | |||
119 | SET_BITS(wdt_reg->wtc, or, nand); | 118 | SET_BITS(wdt_reg->wtc, or, nand); |
120 | 119 | ||
121 | spin_unlock(&rc32434_wdt_device.io_lock); | 120 | spin_unlock(&rc32434_wdt_device.io_lock); |
122 | printk(KERN_INFO PFX "Started watchdog timer.\n"); | 121 | pr_info("Started watchdog timer\n"); |
123 | } | 122 | } |
124 | 123 | ||
125 | static void rc32434_wdt_stop(void) | 124 | static void rc32434_wdt_stop(void) |
@@ -130,7 +129,7 @@ static void rc32434_wdt_stop(void) | |||
130 | SET_BITS(wdt_reg->wtc, 0, 1 << RC32434_WTC_EN); | 129 | SET_BITS(wdt_reg->wtc, 0, 1 << RC32434_WTC_EN); |
131 | 130 | ||
132 | spin_unlock(&rc32434_wdt_device.io_lock); | 131 | spin_unlock(&rc32434_wdt_device.io_lock); |
133 | printk(KERN_INFO PFX "Stopped watchdog timer.\n"); | 132 | pr_info("Stopped watchdog timer\n"); |
134 | } | 133 | } |
135 | 134 | ||
136 | static void rc32434_wdt_ping(void) | 135 | static void rc32434_wdt_ping(void) |
@@ -160,8 +159,7 @@ static int rc32434_wdt_release(struct inode *inode, struct file *file) | |||
160 | rc32434_wdt_stop(); | 159 | rc32434_wdt_stop(); |
161 | module_put(THIS_MODULE); | 160 | module_put(THIS_MODULE); |
162 | } else { | 161 | } else { |
163 | printk(KERN_CRIT PFX | 162 | pr_crit("device closed unexpectedly. WDT will not stop!\n"); |
164 | "device closed unexpectedly. WDT will not stop!\n"); | ||
165 | rc32434_wdt_ping(); | 163 | rc32434_wdt_ping(); |
166 | } | 164 | } |
167 | clear_bit(0, &rc32434_wdt_device.inuse); | 165 | clear_bit(0, &rc32434_wdt_device.inuse); |
@@ -262,9 +260,6 @@ static struct miscdevice rc32434_wdt_miscdev = { | |||
262 | .fops = &rc32434_wdt_fops, | 260 | .fops = &rc32434_wdt_fops, |
263 | }; | 261 | }; |
264 | 262 | ||
265 | static char banner[] __devinitdata = KERN_INFO PFX | ||
266 | "Watchdog Timer version " VERSION ", timer margin: %d sec\n"; | ||
267 | |||
268 | static int __devinit rc32434_wdt_probe(struct platform_device *pdev) | 263 | static int __devinit rc32434_wdt_probe(struct platform_device *pdev) |
269 | { | 264 | { |
270 | int ret; | 265 | int ret; |
@@ -272,13 +267,13 @@ static int __devinit rc32434_wdt_probe(struct platform_device *pdev) | |||
272 | 267 | ||
273 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rb532_wdt_res"); | 268 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rb532_wdt_res"); |
274 | if (!r) { | 269 | if (!r) { |
275 | printk(KERN_ERR PFX "failed to retrieve resources\n"); | 270 | pr_err("failed to retrieve resources\n"); |
276 | return -ENODEV; | 271 | return -ENODEV; |
277 | } | 272 | } |
278 | 273 | ||
279 | wdt_reg = ioremap_nocache(r->start, resource_size(r)); | 274 | wdt_reg = ioremap_nocache(r->start, resource_size(r)); |
280 | if (!wdt_reg) { | 275 | if (!wdt_reg) { |
281 | printk(KERN_ERR PFX "failed to remap I/O resources\n"); | 276 | pr_err("failed to remap I/O resources\n"); |
282 | return -ENXIO; | 277 | return -ENXIO; |
283 | } | 278 | } |
284 | 279 | ||
@@ -291,18 +286,18 @@ static int __devinit rc32434_wdt_probe(struct platform_device *pdev) | |||
291 | * if not reset to the default */ | 286 | * if not reset to the default */ |
292 | if (rc32434_wdt_set(timeout)) { | 287 | if (rc32434_wdt_set(timeout)) { |
293 | rc32434_wdt_set(WATCHDOG_TIMEOUT); | 288 | rc32434_wdt_set(WATCHDOG_TIMEOUT); |
294 | printk(KERN_INFO PFX | 289 | pr_info("timeout value must be between 0 and %d\n", |
295 | "timeout value must be between 0 and %d\n", | ||
296 | WTCOMP2SEC((u32)-1)); | 290 | WTCOMP2SEC((u32)-1)); |
297 | } | 291 | } |
298 | 292 | ||
299 | ret = misc_register(&rc32434_wdt_miscdev); | 293 | ret = misc_register(&rc32434_wdt_miscdev); |
300 | if (ret < 0) { | 294 | if (ret < 0) { |
301 | printk(KERN_ERR PFX "failed to register watchdog device\n"); | 295 | pr_err("failed to register watchdog device\n"); |
302 | goto unmap; | 296 | goto unmap; |
303 | } | 297 | } |
304 | 298 | ||
305 | printk(banner, timeout); | 299 | pr_info("Watchdog Timer version " VERSION ", timer margin: %d sec\n", |
300 | timeout); | ||
306 | 301 | ||
307 | return 0; | 302 | return 0; |
308 | 303 | ||