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/wdrtas.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/wdrtas.c')
-rw-r--r-- | drivers/watchdog/wdrtas.c | 69 |
1 files changed, 29 insertions, 40 deletions
diff --git a/drivers/watchdog/wdrtas.c b/drivers/watchdog/wdrtas.c index 94ec22b9e66b..b7b34600f9a0 100644 --- a/drivers/watchdog/wdrtas.c +++ b/drivers/watchdog/wdrtas.c | |||
@@ -26,6 +26,8 @@ | |||
26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include <linux/fs.h> | 31 | #include <linux/fs.h> |
30 | #include <linux/init.h> | 32 | #include <linux/init.h> |
31 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
@@ -93,8 +95,8 @@ static int wdrtas_set_interval(int interval) | |||
93 | result = rtas_call(wdrtas_token_set_indicator, 3, 1, NULL, | 95 | result = rtas_call(wdrtas_token_set_indicator, 3, 1, NULL, |
94 | WDRTAS_SURVEILLANCE_IND, 0, interval); | 96 | WDRTAS_SURVEILLANCE_IND, 0, interval); |
95 | if (result < 0 && print_msg) { | 97 | if (result < 0 && print_msg) { |
96 | printk(KERN_ERR "wdrtas: setting the watchdog to %i " | 98 | pr_err("setting the watchdog to %i timeout failed: %li\n", |
97 | "timeout failed: %li\n", interval, result); | 99 | interval, result); |
98 | print_msg--; | 100 | print_msg--; |
99 | } | 101 | } |
100 | 102 | ||
@@ -128,8 +130,8 @@ static int wdrtas_get_interval(int fallback_value) | |||
128 | spin_unlock(&rtas_data_buf_lock); | 130 | spin_unlock(&rtas_data_buf_lock); |
129 | 131 | ||
130 | if (value[0] != 0 || value[1] != 2 || value[3] != 0 || result < 0) { | 132 | if (value[0] != 0 || value[1] != 2 || value[3] != 0 || result < 0) { |
131 | printk(KERN_WARNING "wdrtas: could not get sp_spi watchdog " | 133 | pr_warn("could not get sp_spi watchdog timeout (%li). Continuing\n", |
132 | "timeout (%li). Continuing\n", result); | 134 | result); |
133 | return fallback_value; | 135 | return fallback_value; |
134 | } | 136 | } |
135 | 137 | ||
@@ -170,18 +172,18 @@ static void wdrtas_log_scanned_event(void) | |||
170 | int i; | 172 | int i; |
171 | 173 | ||
172 | for (i = 0; i < WDRTAS_LOGBUFFER_LEN; i += 16) | 174 | for (i = 0; i < WDRTAS_LOGBUFFER_LEN; i += 16) |
173 | printk(KERN_INFO "wdrtas: dumping event (line %i/%i), data = " | 175 | pr_info("dumping event (line %i/%i), data = " |
174 | "%02x %02x %02x %02x %02x %02x %02x %02x " | 176 | "%02x %02x %02x %02x %02x %02x %02x %02x " |
175 | "%02x %02x %02x %02x %02x %02x %02x %02x\n", | 177 | "%02x %02x %02x %02x %02x %02x %02x %02x\n", |
176 | (i / 16) + 1, (WDRTAS_LOGBUFFER_LEN / 16), | 178 | (i / 16) + 1, (WDRTAS_LOGBUFFER_LEN / 16), |
177 | wdrtas_logbuffer[i + 0], wdrtas_logbuffer[i + 1], | 179 | wdrtas_logbuffer[i + 0], wdrtas_logbuffer[i + 1], |
178 | wdrtas_logbuffer[i + 2], wdrtas_logbuffer[i + 3], | 180 | wdrtas_logbuffer[i + 2], wdrtas_logbuffer[i + 3], |
179 | wdrtas_logbuffer[i + 4], wdrtas_logbuffer[i + 5], | 181 | wdrtas_logbuffer[i + 4], wdrtas_logbuffer[i + 5], |
180 | wdrtas_logbuffer[i + 6], wdrtas_logbuffer[i + 7], | 182 | wdrtas_logbuffer[i + 6], wdrtas_logbuffer[i + 7], |
181 | wdrtas_logbuffer[i + 8], wdrtas_logbuffer[i + 9], | 183 | wdrtas_logbuffer[i + 8], wdrtas_logbuffer[i + 9], |
182 | wdrtas_logbuffer[i + 10], wdrtas_logbuffer[i + 11], | 184 | wdrtas_logbuffer[i + 10], wdrtas_logbuffer[i + 11], |
183 | wdrtas_logbuffer[i + 12], wdrtas_logbuffer[i + 13], | 185 | wdrtas_logbuffer[i + 12], wdrtas_logbuffer[i + 13], |
184 | wdrtas_logbuffer[i + 14], wdrtas_logbuffer[i + 15]); | 186 | wdrtas_logbuffer[i + 14], wdrtas_logbuffer[i + 15]); |
185 | } | 187 | } |
186 | 188 | ||
187 | /** | 189 | /** |
@@ -201,8 +203,7 @@ static void wdrtas_timer_keepalive(void) | |||
201 | (void *)__pa(wdrtas_logbuffer), | 203 | (void *)__pa(wdrtas_logbuffer), |
202 | WDRTAS_LOGBUFFER_LEN); | 204 | WDRTAS_LOGBUFFER_LEN); |
203 | if (result < 0) | 205 | if (result < 0) |
204 | printk(KERN_ERR "wdrtas: event-scan failed: %li\n", | 206 | pr_err("event-scan failed: %li\n", result); |
205 | result); | ||
206 | if (result == 0) | 207 | if (result == 0) |
207 | wdrtas_log_scanned_event(); | 208 | wdrtas_log_scanned_event(); |
208 | } while (result == 0); | 209 | } while (result == 0); |
@@ -224,8 +225,7 @@ static int wdrtas_get_temperature(void) | |||
224 | result = rtas_get_sensor(WDRTAS_THERMAL_SENSOR, 0, &temperature); | 225 | result = rtas_get_sensor(WDRTAS_THERMAL_SENSOR, 0, &temperature); |
225 | 226 | ||
226 | if (result < 0) | 227 | if (result < 0) |
227 | printk(KERN_WARNING "wdrtas: reading the thermal sensor " | 228 | pr_warn("reading the thermal sensor failed: %i\n", result); |
228 | "failed: %i\n", result); | ||
229 | else | 229 | else |
230 | temperature = ((temperature * 9) / 5) + 32; /* fahrenheit */ | 230 | temperature = ((temperature * 9) / 5) + 32; /* fahrenheit */ |
231 | 231 | ||
@@ -419,8 +419,7 @@ static int wdrtas_close(struct inode *inode, struct file *file) | |||
419 | if (wdrtas_expect_close == WDRTAS_MAGIC_CHAR) | 419 | if (wdrtas_expect_close == WDRTAS_MAGIC_CHAR) |
420 | wdrtas_timer_stop(); | 420 | wdrtas_timer_stop(); |
421 | else { | 421 | else { |
422 | printk(KERN_WARNING "wdrtas: got unexpected close. Watchdog " | 422 | pr_warn("got unexpected close. Watchdog not stopped.\n"); |
423 | "not stopped.\n"); | ||
424 | wdrtas_timer_keepalive(); | 423 | wdrtas_timer_keepalive(); |
425 | } | 424 | } |
426 | 425 | ||
@@ -552,30 +551,24 @@ static int wdrtas_get_tokens(void) | |||
552 | { | 551 | { |
553 | wdrtas_token_get_sensor_state = rtas_token("get-sensor-state"); | 552 | wdrtas_token_get_sensor_state = rtas_token("get-sensor-state"); |
554 | if (wdrtas_token_get_sensor_state == RTAS_UNKNOWN_SERVICE) { | 553 | if (wdrtas_token_get_sensor_state == RTAS_UNKNOWN_SERVICE) { |
555 | printk(KERN_WARNING "wdrtas: couldn't get token for " | 554 | pr_warn("couldn't get token for get-sensor-state. Trying to continue without temperature support.\n"); |
556 | "get-sensor-state. Trying to continue without " | ||
557 | "temperature support.\n"); | ||
558 | } | 555 | } |
559 | 556 | ||
560 | wdrtas_token_get_sp = rtas_token("ibm,get-system-parameter"); | 557 | wdrtas_token_get_sp = rtas_token("ibm,get-system-parameter"); |
561 | if (wdrtas_token_get_sp == RTAS_UNKNOWN_SERVICE) { | 558 | if (wdrtas_token_get_sp == RTAS_UNKNOWN_SERVICE) { |
562 | printk(KERN_WARNING "wdrtas: couldn't get token for " | 559 | pr_warn("couldn't get token for ibm,get-system-parameter. Trying to continue with a default timeout value of %i seconds.\n", |
563 | "ibm,get-system-parameter. Trying to continue with " | 560 | WDRTAS_DEFAULT_INTERVAL); |
564 | "a default timeout value of %i seconds.\n", | ||
565 | WDRTAS_DEFAULT_INTERVAL); | ||
566 | } | 561 | } |
567 | 562 | ||
568 | wdrtas_token_set_indicator = rtas_token("set-indicator"); | 563 | wdrtas_token_set_indicator = rtas_token("set-indicator"); |
569 | if (wdrtas_token_set_indicator == RTAS_UNKNOWN_SERVICE) { | 564 | if (wdrtas_token_set_indicator == RTAS_UNKNOWN_SERVICE) { |
570 | printk(KERN_ERR "wdrtas: couldn't get token for " | 565 | pr_err("couldn't get token for set-indicator. Terminating watchdog code.\n"); |
571 | "set-indicator. Terminating watchdog code.\n"); | ||
572 | return -EIO; | 566 | return -EIO; |
573 | } | 567 | } |
574 | 568 | ||
575 | wdrtas_token_event_scan = rtas_token("event-scan"); | 569 | wdrtas_token_event_scan = rtas_token("event-scan"); |
576 | if (wdrtas_token_event_scan == RTAS_UNKNOWN_SERVICE) { | 570 | if (wdrtas_token_event_scan == RTAS_UNKNOWN_SERVICE) { |
577 | printk(KERN_ERR "wdrtas: couldn't get token for event-scan. " | 571 | pr_err("couldn't get token for event-scan. Terminating watchdog code.\n"); |
578 | "Terminating watchdog code.\n"); | ||
579 | return -EIO; | 572 | return -EIO; |
580 | } | 573 | } |
581 | 574 | ||
@@ -609,17 +602,14 @@ static int wdrtas_register_devs(void) | |||
609 | 602 | ||
610 | result = misc_register(&wdrtas_miscdev); | 603 | result = misc_register(&wdrtas_miscdev); |
611 | if (result) { | 604 | if (result) { |
612 | printk(KERN_ERR "wdrtas: couldn't register watchdog misc " | 605 | pr_err("couldn't register watchdog misc device. Terminating watchdog code.\n"); |
613 | "device. Terminating watchdog code.\n"); | ||
614 | return result; | 606 | return result; |
615 | } | 607 | } |
616 | 608 | ||
617 | if (wdrtas_token_get_sensor_state != RTAS_UNKNOWN_SERVICE) { | 609 | if (wdrtas_token_get_sensor_state != RTAS_UNKNOWN_SERVICE) { |
618 | result = misc_register(&wdrtas_tempdev); | 610 | result = misc_register(&wdrtas_tempdev); |
619 | if (result) { | 611 | if (result) { |
620 | printk(KERN_WARNING "wdrtas: couldn't register " | 612 | pr_warn("couldn't register watchdog temperature misc device. Continuing without temperature support.\n"); |
621 | "watchdog temperature misc device. Continuing " | ||
622 | "without temperature support.\n"); | ||
623 | wdrtas_token_get_sensor_state = RTAS_UNKNOWN_SERVICE; | 613 | wdrtas_token_get_sensor_state = RTAS_UNKNOWN_SERVICE; |
624 | } | 614 | } |
625 | } | 615 | } |
@@ -643,8 +633,7 @@ static int __init wdrtas_init(void) | |||
643 | return -ENODEV; | 633 | return -ENODEV; |
644 | 634 | ||
645 | if (register_reboot_notifier(&wdrtas_notifier)) { | 635 | if (register_reboot_notifier(&wdrtas_notifier)) { |
646 | printk(KERN_ERR "wdrtas: could not register reboot notifier. " | 636 | pr_err("could not register reboot notifier. Terminating watchdog code.\n"); |
647 | "Terminating watchdog code.\n"); | ||
648 | wdrtas_unregister_devs(); | 637 | wdrtas_unregister_devs(); |
649 | return -ENODEV; | 638 | return -ENODEV; |
650 | } | 639 | } |