aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-04-04 13:06:25 -0400
committerMatthew Garrett <mjg@redhat.com>2011-05-27 12:35:54 -0400
commit0978e012cfbaca8bd312933e98cdea2d11778e11 (patch)
treeb698c36967b645be9710aafaaef1124041fee3a2 /drivers
parent112a6ee053f9e9f014ab64f2549d3a25551aa349 (diff)
thinkpad_acpi: Convert printks to pr_<level>
Add pr_fmt. Removed local TPACPI_<level> #defines, convert to pr_<level>. Neaten dbg_<foo> macros. Added a few missing newlines to logging messages. Added static inline str_supported for !CONFIG_THINKPAD_ACPI_DEBUG vdbg_printk defect reported by Sedat Dilek <sedat.dilek@googlemail.com>. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c472
1 files changed, 188 insertions, 284 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 7693e89459f0..77f6e707a2a9 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -21,6 +21,8 @@
21 * 02110-1301, USA. 21 * 02110-1301, USA.
22 */ 22 */
23 23
24#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
25
24#define TPACPI_VERSION "0.24" 26#define TPACPI_VERSION "0.24"
25#define TPACPI_SYSFS_VERSION 0x020700 27#define TPACPI_SYSFS_VERSION 0x020700
26 28
@@ -224,17 +226,6 @@ enum tpacpi_hkey_event_t {
224 226
225#define TPACPI_MAX_ACPI_ARGS 3 227#define TPACPI_MAX_ACPI_ARGS 3
226 228
227/* printk headers */
228#define TPACPI_LOG TPACPI_FILE ": "
229#define TPACPI_EMERG KERN_EMERG TPACPI_LOG
230#define TPACPI_ALERT KERN_ALERT TPACPI_LOG
231#define TPACPI_CRIT KERN_CRIT TPACPI_LOG
232#define TPACPI_ERR KERN_ERR TPACPI_LOG
233#define TPACPI_WARN KERN_WARNING TPACPI_LOG
234#define TPACPI_NOTICE KERN_NOTICE TPACPI_LOG
235#define TPACPI_INFO KERN_INFO TPACPI_LOG
236#define TPACPI_DEBUG KERN_DEBUG TPACPI_LOG
237
238/* Debugging printk groups */ 229/* Debugging printk groups */
239#define TPACPI_DBG_ALL 0xffff 230#define TPACPI_DBG_ALL 0xffff
240#define TPACPI_DBG_DISCLOSETASK 0x8000 231#define TPACPI_DBG_DISCLOSETASK 0x8000
@@ -389,34 +380,36 @@ static int tpacpi_uwb_emulstate;
389 * Debugging helpers 380 * Debugging helpers
390 */ 381 */
391 382
392#define dbg_printk(a_dbg_level, format, arg...) \ 383#define dbg_printk(a_dbg_level, format, arg...) \
393 do { if (dbg_level & (a_dbg_level)) \ 384do { \
394 printk(TPACPI_DEBUG "%s: " format, __func__ , ## arg); \ 385 if (dbg_level & (a_dbg_level)) \
395 } while (0) 386 printk(KERN_DEBUG pr_fmt("%s: " format), \
387 __func__, ##arg); \
388} while (0)
396 389
397#ifdef CONFIG_THINKPAD_ACPI_DEBUG 390#ifdef CONFIG_THINKPAD_ACPI_DEBUG
398#define vdbg_printk dbg_printk 391#define vdbg_printk dbg_printk
399static const char *str_supported(int is_supported); 392static const char *str_supported(int is_supported);
400#else 393#else
401#define vdbg_printk(a_dbg_level, format, arg...) \ 394static inline const char *str_supported(int is_supported) { return ""; }
402 do { } while (0) 395#define vdbg_printk(a_dbg_level, format, arg...) \
396 no_printk(format, ##arg)
403#endif 397#endif
404 398
405static void tpacpi_log_usertask(const char * const what) 399static void tpacpi_log_usertask(const char * const what)
406{ 400{
407 printk(TPACPI_DEBUG "%s: access by process with PID %d\n", 401 printk(KERN_DEBUG pr_fmt("%s: access by process with PID %d\n"),
408 what, task_tgid_vnr(current)); 402 what, task_tgid_vnr(current));
409} 403}
410 404
411#define tpacpi_disclose_usertask(what, format, arg...) \ 405#define tpacpi_disclose_usertask(what, format, arg...) \
412 do { \ 406do { \
413 if (unlikely( \ 407 if (unlikely((dbg_level & TPACPI_DBG_DISCLOSETASK) && \
414 (dbg_level & TPACPI_DBG_DISCLOSETASK) && \ 408 (tpacpi_lifecycle == TPACPI_LIFE_RUNNING))) { \
415 (tpacpi_lifecycle == TPACPI_LIFE_RUNNING))) { \ 409 printk(KERN_DEBUG pr_fmt("%s: PID %d: " format), \
416 printk(TPACPI_DEBUG "%s: PID %d: " format, \ 410 what, task_tgid_vnr(current), ## arg); \
417 what, task_tgid_vnr(current), ## arg); \ 411 } \
418 } \ 412} while (0)
419 } while (0)
420 413
421/* 414/*
422 * Quirk handling helpers 415 * Quirk handling helpers
@@ -554,7 +547,7 @@ static int acpi_evalf(acpi_handle handle,
554 int quiet; 547 int quiet;
555 548
556 if (!*fmt) { 549 if (!*fmt) {
557 printk(TPACPI_ERR "acpi_evalf() called with empty format\n"); 550 pr_err("acpi_evalf() called with empty format\n");
558 return 0; 551 return 0;
559 } 552 }
560 553
@@ -579,7 +572,7 @@ static int acpi_evalf(acpi_handle handle,
579 break; 572 break;
580 /* add more types as needed */ 573 /* add more types as needed */
581 default: 574 default:
582 printk(TPACPI_ERR "acpi_evalf() called " 575 pr_err("acpi_evalf() called "
583 "with invalid format character '%c'\n", c); 576 "with invalid format character '%c'\n", c);
584 va_end(ap); 577 va_end(ap);
585 return 0; 578 return 0;
@@ -608,13 +601,13 @@ static int acpi_evalf(acpi_handle handle,
608 break; 601 break;
609 /* add more types as needed */ 602 /* add more types as needed */
610 default: 603 default:
611 printk(TPACPI_ERR "acpi_evalf() called " 604 pr_err("acpi_evalf() called "
612 "with invalid format character '%c'\n", res_type); 605 "with invalid format character '%c'\n", res_type);
613 return 0; 606 return 0;
614 } 607 }
615 608
616 if (!success && !quiet) 609 if (!success && !quiet)
617 printk(TPACPI_ERR "acpi_evalf(%s, %s, ...) failed: %s\n", 610 pr_err("acpi_evalf(%s, %s, ...) failed: %s\n",
618 method, fmt0, acpi_format_exception(status)); 611 method, fmt0, acpi_format_exception(status));
619 612
620 return success; 613 return success;
@@ -758,8 +751,7 @@ static int __init setup_acpi_notify(struct ibm_struct *ibm)
758 751
759 rc = acpi_bus_get_device(*ibm->acpi->handle, &ibm->acpi->device); 752 rc = acpi_bus_get_device(*ibm->acpi->handle, &ibm->acpi->device);
760 if (rc < 0) { 753 if (rc < 0) {
761 printk(TPACPI_ERR "acpi_bus_get_device(%s) failed: %d\n", 754 pr_err("acpi_bus_get_device(%s) failed: %d\n", ibm->name, rc);
762 ibm->name, rc);
763 return -ENODEV; 755 return -ENODEV;
764 } 756 }
765 757
@@ -772,12 +764,10 @@ static int __init setup_acpi_notify(struct ibm_struct *ibm)
772 ibm->acpi->type, dispatch_acpi_notify, ibm); 764 ibm->acpi->type, dispatch_acpi_notify, ibm);
773 if (ACPI_FAILURE(status)) { 765 if (ACPI_FAILURE(status)) {
774 if (status == AE_ALREADY_EXISTS) { 766 if (status == AE_ALREADY_EXISTS) {
775 printk(TPACPI_NOTICE 767 pr_notice("another device driver is already "
776 "another device driver is already " 768 "handling %s events\n", ibm->name);
777 "handling %s events\n", ibm->name);
778 } else { 769 } else {
779 printk(TPACPI_ERR 770 pr_err("acpi_install_notify_handler(%s) failed: %s\n",
780 "acpi_install_notify_handler(%s) failed: %s\n",
781 ibm->name, acpi_format_exception(status)); 771 ibm->name, acpi_format_exception(status));
782 } 772 }
783 return -ENODEV; 773 return -ENODEV;
@@ -802,8 +792,7 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm)
802 792
803 ibm->acpi->driver = kzalloc(sizeof(struct acpi_driver), GFP_KERNEL); 793 ibm->acpi->driver = kzalloc(sizeof(struct acpi_driver), GFP_KERNEL);
804 if (!ibm->acpi->driver) { 794 if (!ibm->acpi->driver) {
805 printk(TPACPI_ERR 795 pr_err("failed to allocate memory for ibm->acpi->driver\n");
806 "failed to allocate memory for ibm->acpi->driver\n");
807 return -ENOMEM; 796 return -ENOMEM;
808 } 797 }
809 798
@@ -814,7 +803,7 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm)
814 803
815 rc = acpi_bus_register_driver(ibm->acpi->driver); 804 rc = acpi_bus_register_driver(ibm->acpi->driver);
816 if (rc < 0) { 805 if (rc < 0) {
817 printk(TPACPI_ERR "acpi_bus_register_driver(%s) failed: %d\n", 806 pr_err("acpi_bus_register_driver(%s) failed: %d\n",
818 ibm->name, rc); 807 ibm->name, rc);
819 kfree(ibm->acpi->driver); 808 kfree(ibm->acpi->driver);
820 ibm->acpi->driver = NULL; 809 ibm->acpi->driver = NULL;
@@ -1072,15 +1061,14 @@ static int parse_strtoul(const char *buf,
1072static void tpacpi_disable_brightness_delay(void) 1061static void tpacpi_disable_brightness_delay(void)
1073{ 1062{
1074 if (acpi_evalf(hkey_handle, NULL, "PWMS", "qvd", 0)) 1063 if (acpi_evalf(hkey_handle, NULL, "PWMS", "qvd", 0))
1075 printk(TPACPI_NOTICE 1064 pr_notice("ACPI backlight control delay disabled\n");
1076 "ACPI backlight control delay disabled\n");
1077} 1065}
1078 1066
1079static void printk_deprecated_attribute(const char * const what, 1067static void printk_deprecated_attribute(const char * const what,
1080 const char * const details) 1068 const char * const details)
1081{ 1069{
1082 tpacpi_log_usertask("deprecated sysfs attribute"); 1070 tpacpi_log_usertask("deprecated sysfs attribute");
1083 printk(TPACPI_WARN "WARNING: sysfs attribute %s is deprecated and " 1071 pr_warn("WARNING: sysfs attribute %s is deprecated and "
1084 "will be removed. %s\n", 1072 "will be removed. %s\n",
1085 what, details); 1073 what, details);
1086} 1074}
@@ -1255,8 +1243,7 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id,
1255 &tpacpi_rfk_rfkill_ops, 1243 &tpacpi_rfk_rfkill_ops,
1256 atp_rfk); 1244 atp_rfk);
1257 if (!atp_rfk || !atp_rfk->rfkill) { 1245 if (!atp_rfk || !atp_rfk->rfkill) {
1258 printk(TPACPI_ERR 1246 pr_err("failed to allocate memory for rfkill class\n");
1259 "failed to allocate memory for rfkill class\n");
1260 kfree(atp_rfk); 1247 kfree(atp_rfk);
1261 return -ENOMEM; 1248 return -ENOMEM;
1262 } 1249 }
@@ -1266,9 +1253,8 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id,
1266 1253
1267 sw_status = (tp_rfkops->get_status)(); 1254 sw_status = (tp_rfkops->get_status)();
1268 if (sw_status < 0) { 1255 if (sw_status < 0) {
1269 printk(TPACPI_ERR 1256 pr_err("failed to read initial state for %s, error %d\n",
1270 "failed to read initial state for %s, error %d\n", 1257 name, sw_status);
1271 name, sw_status);
1272 } else { 1258 } else {
1273 sw_state = (sw_status == TPACPI_RFK_RADIO_OFF); 1259 sw_state = (sw_status == TPACPI_RFK_RADIO_OFF);
1274 if (set_default) { 1260 if (set_default) {
@@ -1282,9 +1268,7 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id,
1282 1268
1283 res = rfkill_register(atp_rfk->rfkill); 1269 res = rfkill_register(atp_rfk->rfkill);
1284 if (res < 0) { 1270 if (res < 0) {
1285 printk(TPACPI_ERR 1271 pr_err("failed to register %s rfkill switch: %d\n", name, res);
1286 "failed to register %s rfkill switch: %d\n",
1287 name, res);
1288 rfkill_destroy(atp_rfk->rfkill); 1272 rfkill_destroy(atp_rfk->rfkill);
1289 kfree(atp_rfk); 1273 kfree(atp_rfk);
1290 return res; 1274 return res;
@@ -1292,7 +1276,7 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id,
1292 1276
1293 tpacpi_rfkill_switches[id] = atp_rfk; 1277 tpacpi_rfkill_switches[id] = atp_rfk;
1294 1278
1295 printk(TPACPI_INFO "rfkill switch %s: radio is %sblocked\n", 1279 pr_info("rfkill switch %s: radio is %sblocked\n",
1296 name, (sw_state || hw_state) ? "" : "un"); 1280 name, (sw_state || hw_state) ? "" : "un");
1297 return 0; 1281 return 0;
1298} 1282}
@@ -1816,10 +1800,8 @@ static void __init tpacpi_check_outdated_fw(void)
1816 * broken, or really stable to begin with, so it is 1800 * broken, or really stable to begin with, so it is
1817 * best if the user upgrades the firmware anyway. 1801 * best if the user upgrades the firmware anyway.
1818 */ 1802 */
1819 printk(TPACPI_WARN 1803 pr_warn("WARNING: Outdated ThinkPad BIOS/EC firmware\n");
1820 "WARNING: Outdated ThinkPad BIOS/EC firmware\n"); 1804 pr_warn("WARNING: This firmware may be missing critical bug "
1821 printk(TPACPI_WARN
1822 "WARNING: This firmware may be missing critical bug "
1823 "fixes and/or important features\n"); 1805 "fixes and/or important features\n");
1824 } 1806 }
1825} 1807}
@@ -2108,9 +2090,7 @@ void static hotkey_mask_warn_incomplete_mask(void)
2108 (hotkey_all_mask | TPACPI_HKEY_NVRAM_KNOWN_MASK); 2090 (hotkey_all_mask | TPACPI_HKEY_NVRAM_KNOWN_MASK);
2109 2091
2110 if (wantedmask) 2092 if (wantedmask)
2111 printk(TPACPI_NOTICE 2093 pr_notice("required events 0x%08x not enabled!\n", wantedmask);
2112 "required events 0x%08x not enabled!\n",
2113 wantedmask);
2114} 2094}
2115 2095
2116/* 2096/*
@@ -2148,10 +2128,9 @@ static int hotkey_mask_set(u32 mask)
2148 * a given event. 2128 * a given event.
2149 */ 2129 */
2150 if (!hotkey_mask_get() && !rc && (fwmask & ~hotkey_acpi_mask)) { 2130 if (!hotkey_mask_get() && !rc && (fwmask & ~hotkey_acpi_mask)) {
2151 printk(TPACPI_NOTICE 2131 pr_notice("asked for hotkey mask 0x%08x, but "
2152 "asked for hotkey mask 0x%08x, but " 2132 "firmware forced it to 0x%08x\n",
2153 "firmware forced it to 0x%08x\n", 2133 fwmask, hotkey_acpi_mask);
2154 fwmask, hotkey_acpi_mask);
2155 } 2134 }
2156 2135
2157 if (tpacpi_lifecycle != TPACPI_LIFE_EXITING) 2136 if (tpacpi_lifecycle != TPACPI_LIFE_EXITING)
@@ -2175,13 +2154,11 @@ static int hotkey_user_mask_set(const u32 mask)
2175 (mask == 0xffff || mask == 0xffffff || 2154 (mask == 0xffff || mask == 0xffffff ||
2176 mask == 0xffffffff)) { 2155 mask == 0xffffffff)) {
2177 tp_warned.hotkey_mask_ff = 1; 2156 tp_warned.hotkey_mask_ff = 1;
2178 printk(TPACPI_NOTICE 2157 pr_notice("setting the hotkey mask to 0x%08x is likely "
2179 "setting the hotkey mask to 0x%08x is likely " 2158 "not the best way to go about it\n", mask);
2180 "not the best way to go about it\n", mask); 2159 pr_notice("please consider using the driver defaults, "
2181 printk(TPACPI_NOTICE 2160 "and refer to up-to-date thinkpad-acpi "
2182 "please consider using the driver defaults, " 2161 "documentation\n");
2183 "and refer to up-to-date thinkpad-acpi "
2184 "documentation\n");
2185 } 2162 }
2186 2163
2187 /* Try to enable what the user asked for, plus whatever we need. 2164 /* Try to enable what the user asked for, plus whatever we need.
@@ -2565,8 +2542,7 @@ static void hotkey_poll_setup(const bool may_warn)
2565 NULL, TPACPI_NVRAM_KTHREAD_NAME); 2542 NULL, TPACPI_NVRAM_KTHREAD_NAME);
2566 if (IS_ERR(tpacpi_hotkey_task)) { 2543 if (IS_ERR(tpacpi_hotkey_task)) {
2567 tpacpi_hotkey_task = NULL; 2544 tpacpi_hotkey_task = NULL;
2568 printk(TPACPI_ERR 2545 pr_err("could not create kernel thread "
2569 "could not create kernel thread "
2570 "for hotkey polling\n"); 2546 "for hotkey polling\n");
2571 } 2547 }
2572 } 2548 }
@@ -2574,11 +2550,10 @@ static void hotkey_poll_setup(const bool may_warn)
2574 hotkey_poll_stop_sync(); 2550 hotkey_poll_stop_sync();
2575 if (may_warn && (poll_driver_mask || poll_user_mask) && 2551 if (may_warn && (poll_driver_mask || poll_user_mask) &&
2576 hotkey_poll_freq == 0) { 2552 hotkey_poll_freq == 0) {
2577 printk(TPACPI_NOTICE 2553 pr_notice("hot keys 0x%08x and/or events 0x%08x "
2578 "hot keys 0x%08x and/or events 0x%08x " 2554 "require polling, which is currently "
2579 "require polling, which is currently " 2555 "disabled\n",
2580 "disabled\n", 2556 poll_user_mask, poll_driver_mask);
2581 poll_user_mask, poll_driver_mask);
2582 } 2557 }
2583 } 2558 }
2584} 2559}
@@ -2802,13 +2777,13 @@ static ssize_t hotkey_source_mask_store(struct device *dev,
2802 mutex_unlock(&hotkey_mutex); 2777 mutex_unlock(&hotkey_mutex);
2803 2778
2804 if (rc < 0) 2779 if (rc < 0)
2805 printk(TPACPI_ERR "hotkey_source_mask: failed to update the" 2780 pr_err("hotkey_source_mask: "
2806 "firmware event mask!\n"); 2781 "failed to update the firmware event mask!\n");
2807 2782
2808 if (r_ev) 2783 if (r_ev)
2809 printk(TPACPI_NOTICE "hotkey_source_mask: " 2784 pr_notice("hotkey_source_mask: "
2810 "some important events were disabled: " 2785 "some important events were disabled: 0x%04x\n",
2811 "0x%04x\n", r_ev); 2786 r_ev);
2812 2787
2813 tpacpi_disclose_usertask("hotkey_source_mask", "set to 0x%08lx\n", t); 2788 tpacpi_disclose_usertask("hotkey_source_mask", "set to 0x%08lx\n", t);
2814 2789
@@ -3039,8 +3014,7 @@ static void hotkey_exit(void)
3039 if (((tp_features.hotkey_mask && 3014 if (((tp_features.hotkey_mask &&
3040 hotkey_mask_set(hotkey_orig_mask)) | 3015 hotkey_mask_set(hotkey_orig_mask)) |
3041 hotkey_status_set(false)) != 0) 3016 hotkey_status_set(false)) != 0)
3042 printk(TPACPI_ERR 3017 pr_err("failed to restore hot key mask "
3043 "failed to restore hot key mask "
3044 "to BIOS defaults\n"); 3018 "to BIOS defaults\n");
3045} 3019}
3046 3020
@@ -3279,10 +3253,9 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
3279 for HKEY interface version 0x100 */ 3253 for HKEY interface version 0x100 */
3280 if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) { 3254 if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) {
3281 if ((hkeyv >> 8) != 1) { 3255 if ((hkeyv >> 8) != 1) {
3282 printk(TPACPI_ERR "unknown version of the " 3256 pr_err("unknown version of the HKEY interface: 0x%x\n",
3283 "HKEY interface: 0x%x\n", hkeyv); 3257 hkeyv);
3284 printk(TPACPI_ERR "please report this to %s\n", 3258 pr_err("please report this to %s\n", TPACPI_MAIL);
3285 TPACPI_MAIL);
3286 } else { 3259 } else {
3287 /* 3260 /*
3288 * MHKV 0x100 in A31, R40, R40e, 3261 * MHKV 0x100 in A31, R40, R40e,
@@ -3295,8 +3268,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
3295 /* Paranoia check AND init hotkey_all_mask */ 3268 /* Paranoia check AND init hotkey_all_mask */
3296 if (!acpi_evalf(hkey_handle, &hotkey_all_mask, 3269 if (!acpi_evalf(hkey_handle, &hotkey_all_mask,
3297 "MHKA", "qd")) { 3270 "MHKA", "qd")) {
3298 printk(TPACPI_ERR 3271 pr_err("missing MHKA handler, "
3299 "missing MHKA handler, "
3300 "please report this to %s\n", 3272 "please report this to %s\n",
3301 TPACPI_MAIL); 3273 TPACPI_MAIL);
3302 /* Fallback: pre-init for FN+F3,F4,F12 */ 3274 /* Fallback: pre-init for FN+F3,F4,F12 */
@@ -3334,16 +3306,14 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
3334 if (dbg_wlswemul) { 3306 if (dbg_wlswemul) {
3335 tp_features.hotkey_wlsw = 1; 3307 tp_features.hotkey_wlsw = 1;
3336 radiosw_state = !!tpacpi_wlsw_emulstate; 3308 radiosw_state = !!tpacpi_wlsw_emulstate;
3337 printk(TPACPI_INFO 3309 pr_info("radio switch emulation enabled\n");
3338 "radio switch emulation enabled\n");
3339 } else 3310 } else
3340#endif 3311#endif
3341 /* Not all thinkpads have a hardware radio switch */ 3312 /* Not all thinkpads have a hardware radio switch */
3342 if (acpi_evalf(hkey_handle, &status, "WLSW", "qd")) { 3313 if (acpi_evalf(hkey_handle, &status, "WLSW", "qd")) {
3343 tp_features.hotkey_wlsw = 1; 3314 tp_features.hotkey_wlsw = 1;
3344 radiosw_state = !!status; 3315 radiosw_state = !!status;
3345 printk(TPACPI_INFO 3316 pr_info("radio switch found; radios are %s\n",
3346 "radio switch found; radios are %s\n",
3347 enabled(status, 0)); 3317 enabled(status, 0));
3348 } 3318 }
3349 if (tp_features.hotkey_wlsw) 3319 if (tp_features.hotkey_wlsw)
@@ -3354,8 +3324,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
3354 if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) { 3324 if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) {
3355 tp_features.hotkey_tablet = 1; 3325 tp_features.hotkey_tablet = 1;
3356 tabletsw_state = !!(status & TP_HOTKEY_TABLET_MASK); 3326 tabletsw_state = !!(status & TP_HOTKEY_TABLET_MASK);
3357 printk(TPACPI_INFO 3327 pr_info("possible tablet mode switch found; "
3358 "possible tablet mode switch found; "
3359 "ThinkPad in %s mode\n", 3328 "ThinkPad in %s mode\n",
3360 (tabletsw_state) ? "tablet" : "laptop"); 3329 (tabletsw_state) ? "tablet" : "laptop");
3361 res = add_to_attr_set(hotkey_dev_attributes, 3330 res = add_to_attr_set(hotkey_dev_attributes,
@@ -3373,8 +3342,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
3373 hotkey_keycode_map = kmalloc(TPACPI_HOTKEY_MAP_SIZE, 3342 hotkey_keycode_map = kmalloc(TPACPI_HOTKEY_MAP_SIZE,
3374 GFP_KERNEL); 3343 GFP_KERNEL);
3375 if (!hotkey_keycode_map) { 3344 if (!hotkey_keycode_map) {
3376 printk(TPACPI_ERR 3345 pr_err("failed to allocate memory for key map\n");
3377 "failed to allocate memory for key map\n");
3378 res = -ENOMEM; 3346 res = -ENOMEM;
3379 goto err_exit; 3347 goto err_exit;
3380 } 3348 }
@@ -3417,13 +3385,11 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
3417 * userspace. tpacpi_detect_brightness_capabilities() must have 3385 * userspace. tpacpi_detect_brightness_capabilities() must have
3418 * been called before this point */ 3386 * been called before this point */
3419 if (tp_features.bright_acpimode && acpi_video_backlight_support()) { 3387 if (tp_features.bright_acpimode && acpi_video_backlight_support()) {
3420 printk(TPACPI_INFO 3388 pr_info("This ThinkPad has standard ACPI backlight "
3421 "This ThinkPad has standard ACPI backlight " 3389 "brightness control, supported by the ACPI "
3422 "brightness control, supported by the ACPI " 3390 "video driver\n");
3423 "video driver\n"); 3391 pr_notice("Disabling thinkpad-acpi brightness events "
3424 printk(TPACPI_NOTICE 3392 "by default...\n");
3425 "Disabling thinkpad-acpi brightness events "
3426 "by default...\n");
3427 3393
3428 /* Disable brightness up/down on Lenovo thinkpads when 3394 /* Disable brightness up/down on Lenovo thinkpads when
3429 * ACPI is handling them, otherwise it is plain impossible 3395 * ACPI is handling them, otherwise it is plain impossible
@@ -3530,8 +3496,7 @@ static bool hotkey_notify_wakeup(const u32 hkey,
3530 3496
3531 case TP_HKEY_EV_WKUP_S3_BATLOW: /* Battery on critical low level/S3 */ 3497 case TP_HKEY_EV_WKUP_S3_BATLOW: /* Battery on critical low level/S3 */
3532 case TP_HKEY_EV_WKUP_S4_BATLOW: /* Battery on critical low level/S4 */ 3498 case TP_HKEY_EV_WKUP_S4_BATLOW: /* Battery on critical low level/S4 */
3533 printk(TPACPI_ALERT 3499 pr_alert("EMERGENCY WAKEUP: battery almost empty\n");
3534 "EMERGENCY WAKEUP: battery almost empty\n");
3535 /* how to auto-heal: */ 3500 /* how to auto-heal: */
3536 /* 2313: woke up from S3, go to S4/S5 */ 3501 /* 2313: woke up from S3, go to S4/S5 */
3537 /* 2413: woke up from S4, go to S5 */ 3502 /* 2413: woke up from S4, go to S5 */
@@ -3542,9 +3507,7 @@ static bool hotkey_notify_wakeup(const u32 hkey,
3542 } 3507 }
3543 3508
3544 if (hotkey_wakeup_reason != TP_ACPI_WAKEUP_NONE) { 3509 if (hotkey_wakeup_reason != TP_ACPI_WAKEUP_NONE) {
3545 printk(TPACPI_INFO 3510 pr_info("woke up due to a hot-unplug request...\n");
3546 "woke up due to a hot-unplug "
3547 "request...\n");
3548 hotkey_wakeup_reason_notify_change(); 3511 hotkey_wakeup_reason_notify_change();
3549 } 3512 }
3550 return true; 3513 return true;
@@ -3596,37 +3559,31 @@ static bool hotkey_notify_thermal(const u32 hkey,
3596 3559
3597 switch (hkey) { 3560 switch (hkey) {
3598 case TP_HKEY_EV_THM_TABLE_CHANGED: 3561 case TP_HKEY_EV_THM_TABLE_CHANGED:
3599 printk(TPACPI_INFO 3562 pr_info("EC reports that Thermal Table has changed\n");
3600 "EC reports that Thermal Table has changed\n");
3601 /* recommended action: do nothing, we don't have 3563 /* recommended action: do nothing, we don't have
3602 * Lenovo ATM information */ 3564 * Lenovo ATM information */
3603 return true; 3565 return true;
3604 case TP_HKEY_EV_ALARM_BAT_HOT: 3566 case TP_HKEY_EV_ALARM_BAT_HOT:
3605 printk(TPACPI_CRIT 3567 pr_crit("THERMAL ALARM: battery is too hot!\n");
3606 "THERMAL ALARM: battery is too hot!\n");
3607 /* recommended action: warn user through gui */ 3568 /* recommended action: warn user through gui */
3608 break; 3569 break;
3609 case TP_HKEY_EV_ALARM_BAT_XHOT: 3570 case TP_HKEY_EV_ALARM_BAT_XHOT:
3610 printk(TPACPI_ALERT 3571 pr_alert("THERMAL EMERGENCY: battery is extremely hot!\n");
3611 "THERMAL EMERGENCY: battery is extremely hot!\n");
3612 /* recommended action: immediate sleep/hibernate */ 3572 /* recommended action: immediate sleep/hibernate */
3613 break; 3573 break;
3614 case TP_HKEY_EV_ALARM_SENSOR_HOT: 3574 case TP_HKEY_EV_ALARM_SENSOR_HOT:
3615 printk(TPACPI_CRIT 3575 pr_crit("THERMAL ALARM: "
3616 "THERMAL ALARM: "
3617 "a sensor reports something is too hot!\n"); 3576 "a sensor reports something is too hot!\n");
3618 /* recommended action: warn user through gui, that */ 3577 /* recommended action: warn user through gui, that */
3619 /* some internal component is too hot */ 3578 /* some internal component is too hot */
3620 break; 3579 break;
3621 case TP_HKEY_EV_ALARM_SENSOR_XHOT: 3580 case TP_HKEY_EV_ALARM_SENSOR_XHOT:
3622 printk(TPACPI_ALERT 3581 pr_alert("THERMAL EMERGENCY: "
3623 "THERMAL EMERGENCY: " 3582 "a sensor reports something is extremely hot!\n");
3624 "a sensor reports something is extremely hot!\n");
3625 /* recommended action: immediate sleep/hibernate */ 3583 /* recommended action: immediate sleep/hibernate */
3626 break; 3584 break;
3627 default: 3585 default:
3628 printk(TPACPI_ALERT 3586 pr_alert("THERMAL ALERT: unknown thermal alarm received\n");
3629 "THERMAL ALERT: unknown thermal alarm received\n");
3630 known = false; 3587 known = false;
3631 } 3588 }
3632 3589
@@ -3643,8 +3600,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
3643 bool known_ev; 3600 bool known_ev;
3644 3601
3645 if (event != 0x80) { 3602 if (event != 0x80) {
3646 printk(TPACPI_ERR 3603 pr_err("unknown HKEY notification event %d\n", event);
3647 "unknown HKEY notification event %d\n", event);
3648 /* forward it to userspace, maybe it knows how to handle it */ 3604 /* forward it to userspace, maybe it knows how to handle it */
3649 acpi_bus_generate_netlink_event( 3605 acpi_bus_generate_netlink_event(
3650 ibm->acpi->device->pnp.device_class, 3606 ibm->acpi->device->pnp.device_class,
@@ -3655,7 +3611,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
3655 3611
3656 while (1) { 3612 while (1) {
3657 if (!acpi_evalf(hkey_handle, &hkey, "MHKP", "d")) { 3613 if (!acpi_evalf(hkey_handle, &hkey, "MHKP", "d")) {
3658 printk(TPACPI_ERR "failed to retrieve HKEY event\n"); 3614 pr_err("failed to retrieve HKEY event\n");
3659 return; 3615 return;
3660 } 3616 }
3661 3617
@@ -3683,8 +3639,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
3683 switch (hkey) { 3639 switch (hkey) {
3684 case TP_HKEY_EV_BAYEJ_ACK: 3640 case TP_HKEY_EV_BAYEJ_ACK:
3685 hotkey_autosleep_ack = 1; 3641 hotkey_autosleep_ack = 1;
3686 printk(TPACPI_INFO 3642 pr_info("bay ejected\n");
3687 "bay ejected\n");
3688 hotkey_wakeup_hotunplug_complete_notify_change(); 3643 hotkey_wakeup_hotunplug_complete_notify_change();
3689 known_ev = true; 3644 known_ev = true;
3690 break; 3645 break;
@@ -3700,8 +3655,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
3700 /* 0x4000-0x4FFF: dock-related wakeups */ 3655 /* 0x4000-0x4FFF: dock-related wakeups */
3701 if (hkey == TP_HKEY_EV_UNDOCK_ACK) { 3656 if (hkey == TP_HKEY_EV_UNDOCK_ACK) {
3702 hotkey_autosleep_ack = 1; 3657 hotkey_autosleep_ack = 1;
3703 printk(TPACPI_INFO 3658 pr_info("undocked\n");
3704 "undocked\n");
3705 hotkey_wakeup_hotunplug_complete_notify_change(); 3659 hotkey_wakeup_hotunplug_complete_notify_change();
3706 known_ev = true; 3660 known_ev = true;
3707 } else { 3661 } else {
@@ -3732,11 +3686,9 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
3732 known_ev = false; 3686 known_ev = false;
3733 } 3687 }
3734 if (!known_ev) { 3688 if (!known_ev) {
3735 printk(TPACPI_NOTICE 3689 pr_notice("unhandled HKEY event 0x%04x\n", hkey);
3736 "unhandled HKEY event 0x%04x\n", hkey); 3690 pr_notice("please report the conditions when this "
3737 printk(TPACPI_NOTICE 3691 "event happened to %s\n", TPACPI_MAIL);
3738 "please report the conditions when this "
3739 "event happened to %s\n", TPACPI_MAIL);
3740 } 3692 }
3741 3693
3742 /* Legacy events */ 3694 /* Legacy events */
@@ -3769,8 +3721,7 @@ static void hotkey_resume(void)
3769 3721
3770 if (hotkey_status_set(true) < 0 || 3722 if (hotkey_status_set(true) < 0 ||
3771 hotkey_mask_set(hotkey_acpi_mask) < 0) 3723 hotkey_mask_set(hotkey_acpi_mask) < 0)
3772 printk(TPACPI_ERR 3724 pr_err("error while attempting to reset the event "
3773 "error while attempting to reset the event "
3774 "firmware interface\n"); 3725 "firmware interface\n");
3775 3726
3776 tpacpi_send_radiosw_update(); 3727 tpacpi_send_radiosw_update();
@@ -3815,14 +3766,12 @@ static void hotkey_enabledisable_warn(bool enable)
3815{ 3766{
3816 tpacpi_log_usertask("procfs hotkey enable/disable"); 3767 tpacpi_log_usertask("procfs hotkey enable/disable");
3817 if (!WARN((tpacpi_lifecycle == TPACPI_LIFE_RUNNING || !enable), 3768 if (!WARN((tpacpi_lifecycle == TPACPI_LIFE_RUNNING || !enable),
3818 TPACPI_WARN 3769 pr_fmt("hotkey enable/disable functionality has been "
3819 "hotkey enable/disable functionality has been " 3770 "removed from the driver. "
3820 "removed from the driver. Hotkeys are always " 3771 "Hotkeys are always enabled.\n")))
3821 "enabled\n")) 3772 pr_err("Please remove the hotkey=enable module "
3822 printk(TPACPI_ERR 3773 "parameter, it is deprecated. "
3823 "Please remove the hotkey=enable module " 3774 "Hotkeys are always enabled.\n");
3824 "parameter, it is deprecated. Hotkeys are always "
3825 "enabled\n");
3826} 3775}
3827 3776
3828static int hotkey_write(char *buf) 3777static int hotkey_write(char *buf)
@@ -4002,8 +3951,7 @@ static void bluetooth_shutdown(void)
4002 /* Order firmware to save current state to NVRAM */ 3951 /* Order firmware to save current state to NVRAM */
4003 if (!acpi_evalf(NULL, NULL, "\\BLTH", "vd", 3952 if (!acpi_evalf(NULL, NULL, "\\BLTH", "vd",
4004 TP_ACPI_BLTH_SAVE_STATE)) 3953 TP_ACPI_BLTH_SAVE_STATE))
4005 printk(TPACPI_NOTICE 3954 pr_notice("failed to save bluetooth state to NVRAM\n");
4006 "failed to save bluetooth state to NVRAM\n");
4007 else 3955 else
4008 vdbg_printk(TPACPI_DBG_RFKILL, 3956 vdbg_printk(TPACPI_DBG_RFKILL,
4009 "bluestooth state saved to NVRAM\n"); 3957 "bluestooth state saved to NVRAM\n");
@@ -4042,8 +3990,7 @@ static int __init bluetooth_init(struct ibm_init_struct *iibm)
4042#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 3990#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
4043 if (dbg_bluetoothemul) { 3991 if (dbg_bluetoothemul) {
4044 tp_features.bluetooth = 1; 3992 tp_features.bluetooth = 1;
4045 printk(TPACPI_INFO 3993 pr_info("bluetooth switch emulation enabled\n");
4046 "bluetooth switch emulation enabled\n");
4047 } else 3994 } else
4048#endif 3995#endif
4049 if (tp_features.bluetooth && 3996 if (tp_features.bluetooth &&
@@ -4194,8 +4141,7 @@ static void wan_shutdown(void)
4194 /* Order firmware to save current state to NVRAM */ 4141 /* Order firmware to save current state to NVRAM */
4195 if (!acpi_evalf(NULL, NULL, "\\WGSV", "vd", 4142 if (!acpi_evalf(NULL, NULL, "\\WGSV", "vd",
4196 TP_ACPI_WGSV_SAVE_STATE)) 4143 TP_ACPI_WGSV_SAVE_STATE))
4197 printk(TPACPI_NOTICE 4144 pr_notice("failed to save WWAN state to NVRAM\n");
4198 "failed to save WWAN state to NVRAM\n");
4199 else 4145 else
4200 vdbg_printk(TPACPI_DBG_RFKILL, 4146 vdbg_printk(TPACPI_DBG_RFKILL,
4201 "WWAN state saved to NVRAM\n"); 4147 "WWAN state saved to NVRAM\n");
@@ -4232,8 +4178,7 @@ static int __init wan_init(struct ibm_init_struct *iibm)
4232#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 4178#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
4233 if (dbg_wwanemul) { 4179 if (dbg_wwanemul) {
4234 tp_features.wan = 1; 4180 tp_features.wan = 1;
4235 printk(TPACPI_INFO 4181 pr_info("wwan switch emulation enabled\n");
4236 "wwan switch emulation enabled\n");
4237 } else 4182 } else
4238#endif 4183#endif
4239 if (tp_features.wan && 4184 if (tp_features.wan &&
@@ -4373,8 +4318,7 @@ static int __init uwb_init(struct ibm_init_struct *iibm)
4373#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 4318#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
4374 if (dbg_uwbemul) { 4319 if (dbg_uwbemul) {
4375 tp_features.uwb = 1; 4320 tp_features.uwb = 1;
4376 printk(TPACPI_INFO 4321 pr_info("uwb switch emulation enabled\n");
4377 "uwb switch emulation enabled\n");
4378 } else 4322 } else
4379#endif 4323#endif
4380 if (tp_features.uwb && 4324 if (tp_features.uwb &&
@@ -4487,7 +4431,7 @@ static void video_exit(void)
4487 dbg_printk(TPACPI_DBG_EXIT, 4431 dbg_printk(TPACPI_DBG_EXIT,
4488 "restoring original video autoswitch mode\n"); 4432 "restoring original video autoswitch mode\n");
4489 if (video_autosw_set(video_orig_autosw)) 4433 if (video_autosw_set(video_orig_autosw))
4490 printk(TPACPI_ERR "error while trying to restore original " 4434 pr_err("error while trying to restore original "
4491 "video autoswitch mode\n"); 4435 "video autoswitch mode\n");
4492} 4436}
4493 4437
@@ -4560,8 +4504,7 @@ static int video_outputsw_set(int status)
4560 res = acpi_evalf(vid_handle, NULL, 4504 res = acpi_evalf(vid_handle, NULL,
4561 "ASWT", "vdd", status * 0x100, 0); 4505 "ASWT", "vdd", status * 0x100, 0);
4562 if (!autosw && video_autosw_set(autosw)) { 4506 if (!autosw && video_autosw_set(autosw)) {
4563 printk(TPACPI_ERR 4507 pr_err("video auto-switch left enabled due to error\n");
4564 "video auto-switch left enabled due to error\n");
4565 return -EIO; 4508 return -EIO;
4566 } 4509 }
4567 break; 4510 break;
@@ -4630,8 +4573,7 @@ static int video_outputsw_cycle(void)
4630 return -ENOSYS; 4573 return -ENOSYS;
4631 } 4574 }
4632 if (!autosw && video_autosw_set(autosw)) { 4575 if (!autosw && video_autosw_set(autosw)) {
4633 printk(TPACPI_ERR 4576 pr_err("video auto-switch left enabled due to error\n");
4634 "video auto-switch left enabled due to error\n");
4635 return -EIO; 4577 return -EIO;
4636 } 4578 }
4637 4579
@@ -5348,7 +5290,7 @@ static int __init led_init(struct ibm_init_struct *iibm)
5348 tpacpi_leds = kzalloc(sizeof(*tpacpi_leds) * TPACPI_LED_NUMLEDS, 5290 tpacpi_leds = kzalloc(sizeof(*tpacpi_leds) * TPACPI_LED_NUMLEDS,
5349 GFP_KERNEL); 5291 GFP_KERNEL);
5350 if (!tpacpi_leds) { 5292 if (!tpacpi_leds) {
5351 printk(TPACPI_ERR "Out of memory for LED data\n"); 5293 pr_err("Out of memory for LED data\n");
5352 return -ENOMEM; 5294 return -ENOMEM;
5353 } 5295 }
5354 5296
@@ -5367,9 +5309,8 @@ static int __init led_init(struct ibm_init_struct *iibm)
5367 } 5309 }
5368 5310
5369#ifdef CONFIG_THINKPAD_ACPI_UNSAFE_LEDS 5311#ifdef CONFIG_THINKPAD_ACPI_UNSAFE_LEDS
5370 printk(TPACPI_NOTICE 5312 pr_notice("warning: userspace override of important "
5371 "warning: userspace override of important " 5313 "firmware LEDs is enabled\n");
5372 "firmware LEDs is enabled\n");
5373#endif 5314#endif
5374 return 0; 5315 return 0;
5375} 5316}
@@ -5639,17 +5580,16 @@ static void thermal_dump_all_sensors(void)
5639 if (n <= 0) 5580 if (n <= 0)
5640 return; 5581 return;
5641 5582
5642 printk(TPACPI_NOTICE 5583 pr_notice("temperatures (Celsius):");
5643 "temperatures (Celsius):");
5644 5584
5645 for (i = 0; i < n; i++) { 5585 for (i = 0; i < n; i++) {
5646 if (t.temp[i] != TPACPI_THERMAL_SENSOR_NA) 5586 if (t.temp[i] != TPACPI_THERMAL_SENSOR_NA)
5647 printk(KERN_CONT " %d", (int)(t.temp[i] / 1000)); 5587 pr_cont(" %d", (int)(t.temp[i] / 1000));
5648 else 5588 else
5649 printk(KERN_CONT " N/A"); 5589 pr_cont(" N/A");
5650 } 5590 }
5651 5591
5652 printk(KERN_CONT "\n"); 5592 pr_cont("\n");
5653} 5593}
5654 5594
5655/* sysfs temp##_input -------------------------------------------------- */ 5595/* sysfs temp##_input -------------------------------------------------- */
@@ -5769,14 +5709,12 @@ static int __init thermal_init(struct ibm_init_struct *iibm)
5769 if (ta1 == 0) { 5709 if (ta1 == 0) {
5770 /* This is sheer paranoia, but we handle it anyway */ 5710 /* This is sheer paranoia, but we handle it anyway */
5771 if (acpi_tmp7) { 5711 if (acpi_tmp7) {
5772 printk(TPACPI_ERR 5712 pr_err("ThinkPad ACPI EC access misbehaving, "
5773 "ThinkPad ACPI EC access misbehaving, "
5774 "falling back to ACPI TMPx access " 5713 "falling back to ACPI TMPx access "
5775 "mode\n"); 5714 "mode\n");
5776 thermal_read_mode = TPACPI_THERMAL_ACPI_TMP07; 5715 thermal_read_mode = TPACPI_THERMAL_ACPI_TMP07;
5777 } else { 5716 } else {
5778 printk(TPACPI_ERR 5717 pr_err("ThinkPad ACPI EC access misbehaving, "
5779 "ThinkPad ACPI EC access misbehaving, "
5780 "disabling thermal sensors access\n"); 5718 "disabling thermal sensors access\n");
5781 thermal_read_mode = TPACPI_THERMAL_NONE; 5719 thermal_read_mode = TPACPI_THERMAL_NONE;
5782 } 5720 }
@@ -6129,8 +6067,8 @@ static int __init tpacpi_query_bcl_levels(acpi_handle handle)
6129 if (ACPI_SUCCESS(acpi_evaluate_object(handle, "_BCL", NULL, &buffer))) { 6067 if (ACPI_SUCCESS(acpi_evaluate_object(handle, "_BCL", NULL, &buffer))) {
6130 obj = (union acpi_object *)buffer.pointer; 6068 obj = (union acpi_object *)buffer.pointer;
6131 if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) { 6069 if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {
6132 printk(TPACPI_ERR "Unknown _BCL data, " 6070 pr_err("Unknown _BCL data, please report this to %s\n",
6133 "please report this to %s\n", TPACPI_MAIL); 6071 TPACPI_MAIL);
6134 rc = 0; 6072 rc = 0;
6135 } else { 6073 } else {
6136 rc = obj->package.count; 6074 rc = obj->package.count;
@@ -6214,18 +6152,15 @@ static void __init tpacpi_detect_brightness_capabilities(void)
6214 switch (b) { 6152 switch (b) {
6215 case 16: 6153 case 16:
6216 bright_maxlvl = 15; 6154 bright_maxlvl = 15;
6217 printk(TPACPI_INFO 6155 pr_info("detected a 16-level brightness capable ThinkPad\n");
6218 "detected a 16-level brightness capable ThinkPad\n");
6219 break; 6156 break;
6220 case 8: 6157 case 8:
6221 case 0: 6158 case 0:
6222 bright_maxlvl = 7; 6159 bright_maxlvl = 7;
6223 printk(TPACPI_INFO 6160 pr_info("detected a 8-level brightness capable ThinkPad\n");
6224 "detected a 8-level brightness capable ThinkPad\n");
6225 break; 6161 break;
6226 default: 6162 default:
6227 printk(TPACPI_ERR 6163 pr_err("Unsupported brightness interface, "
6228 "Unsupported brightness interface, "
6229 "please contact %s\n", TPACPI_MAIL); 6164 "please contact %s\n", TPACPI_MAIL);
6230 tp_features.bright_unkfw = 1; 6165 tp_features.bright_unkfw = 1;
6231 bright_maxlvl = b - 1; 6166 bright_maxlvl = b - 1;
@@ -6260,22 +6195,19 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
6260 6195
6261 if (acpi_video_backlight_support()) { 6196 if (acpi_video_backlight_support()) {
6262 if (brightness_enable > 1) { 6197 if (brightness_enable > 1) {
6263 printk(TPACPI_INFO 6198 pr_info("Standard ACPI backlight interface "
6264 "Standard ACPI backlight interface " 6199 "available, not loading native one\n");
6265 "available, not loading native one.\n");
6266 return 1; 6200 return 1;
6267 } else if (brightness_enable == 1) { 6201 } else if (brightness_enable == 1) {
6268 printk(TPACPI_WARN 6202 pr_warn("Cannot enable backlight brightness support, "
6269 "Cannot enable backlight brightness support, "
6270 "ACPI is already handling it. Refer to the " 6203 "ACPI is already handling it. Refer to the "
6271 "acpi_backlight kernel parameter\n"); 6204 "acpi_backlight kernel parameter.\n");
6272 return 1; 6205 return 1;
6273 } 6206 }
6274 } else if (tp_features.bright_acpimode && brightness_enable > 1) { 6207 } else if (tp_features.bright_acpimode && brightness_enable > 1) {
6275 printk(TPACPI_NOTICE 6208 pr_notice("Standard ACPI backlight interface not "
6276 "Standard ACPI backlight interface not " 6209 "available, thinkpad_acpi native "
6277 "available, thinkpad_acpi native " 6210 "brightness control enabled\n");
6278 "brightness control enabled\n");
6279 } 6211 }
6280 6212
6281 /* 6213 /*
@@ -6319,19 +6251,17 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
6319 if (IS_ERR(ibm_backlight_device)) { 6251 if (IS_ERR(ibm_backlight_device)) {
6320 int rc = PTR_ERR(ibm_backlight_device); 6252 int rc = PTR_ERR(ibm_backlight_device);
6321 ibm_backlight_device = NULL; 6253 ibm_backlight_device = NULL;
6322 printk(TPACPI_ERR "Could not register backlight device\n"); 6254 pr_err("Could not register backlight device\n");
6323 return rc; 6255 return rc;
6324 } 6256 }
6325 vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_BRGHT, 6257 vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_BRGHT,
6326 "brightness is supported\n"); 6258 "brightness is supported\n");
6327 6259
6328 if (quirks & TPACPI_BRGHT_Q_ASK) { 6260 if (quirks & TPACPI_BRGHT_Q_ASK) {
6329 printk(TPACPI_NOTICE 6261 pr_notice("brightness: will use unverified default: "
6330 "brightness: will use unverified default: " 6262 "brightness_mode=%d\n", brightness_mode);
6331 "brightness_mode=%d\n", brightness_mode); 6263 pr_notice("brightness: please report to %s whether it works well "
6332 printk(TPACPI_NOTICE 6264 "or not on your ThinkPad\n", TPACPI_MAIL);
6333 "brightness: please report to %s whether it works well "
6334 "or not on your ThinkPad\n", TPACPI_MAIL);
6335 } 6265 }
6336 6266
6337 /* Added by mistake in early 2007. Probably useless, but it could 6267 /* Added by mistake in early 2007. Probably useless, but it could
@@ -6804,8 +6734,7 @@ static int __init volume_create_alsa_mixer(void)
6804 rc = snd_card_create(alsa_index, alsa_id, THIS_MODULE, 6734 rc = snd_card_create(alsa_index, alsa_id, THIS_MODULE,
6805 sizeof(struct tpacpi_alsa_data), &card); 6735 sizeof(struct tpacpi_alsa_data), &card);
6806 if (rc < 0 || !card) { 6736 if (rc < 0 || !card) {
6807 printk(TPACPI_ERR 6737 pr_err("Failed to create ALSA card structures: %d\n", rc);
6808 "Failed to create ALSA card structures: %d\n", rc);
6809 return 1; 6738 return 1;
6810 } 6739 }
6811 6740
@@ -6839,9 +6768,8 @@ static int __init volume_create_alsa_mixer(void)
6839 ctl_vol = snd_ctl_new1(&volume_alsa_control_vol, NULL); 6768 ctl_vol = snd_ctl_new1(&volume_alsa_control_vol, NULL);
6840 rc = snd_ctl_add(card, ctl_vol); 6769 rc = snd_ctl_add(card, ctl_vol);
6841 if (rc < 0) { 6770 if (rc < 0) {
6842 printk(TPACPI_ERR 6771 pr_err("Failed to create ALSA volume control: %d\n",
6843 "Failed to create ALSA volume control: %d\n", 6772 rc);
6844 rc);
6845 goto err_exit; 6773 goto err_exit;
6846 } 6774 }
6847 data->ctl_vol_id = &ctl_vol->id; 6775 data->ctl_vol_id = &ctl_vol->id;
@@ -6850,8 +6778,7 @@ static int __init volume_create_alsa_mixer(void)
6850 ctl_mute = snd_ctl_new1(&volume_alsa_control_mute, NULL); 6778 ctl_mute = snd_ctl_new1(&volume_alsa_control_mute, NULL);
6851 rc = snd_ctl_add(card, ctl_mute); 6779 rc = snd_ctl_add(card, ctl_mute);
6852 if (rc < 0) { 6780 if (rc < 0) {
6853 printk(TPACPI_ERR "Failed to create ALSA mute control: %d\n", 6781 pr_err("Failed to create ALSA mute control: %d\n", rc);
6854 rc);
6855 goto err_exit; 6782 goto err_exit;
6856 } 6783 }
6857 data->ctl_mute_id = &ctl_mute->id; 6784 data->ctl_mute_id = &ctl_mute->id;
@@ -6859,7 +6786,7 @@ static int __init volume_create_alsa_mixer(void)
6859 snd_card_set_dev(card, &tpacpi_pdev->dev); 6786 snd_card_set_dev(card, &tpacpi_pdev->dev);
6860 rc = snd_card_register(card); 6787 rc = snd_card_register(card);
6861 if (rc < 0) { 6788 if (rc < 0) {
6862 printk(TPACPI_ERR "Failed to register ALSA card: %d\n", rc); 6789 pr_err("Failed to register ALSA card: %d\n", rc);
6863 goto err_exit; 6790 goto err_exit;
6864 } 6791 }
6865 6792
@@ -6915,9 +6842,8 @@ static int __init volume_init(struct ibm_init_struct *iibm)
6915 return -EINVAL; 6842 return -EINVAL;
6916 6843
6917 if (volume_mode == TPACPI_VOL_MODE_UCMS_STEP) { 6844 if (volume_mode == TPACPI_VOL_MODE_UCMS_STEP) {
6918 printk(TPACPI_ERR 6845 pr_err("UCMS step volume mode not implemented, "
6919 "UCMS step volume mode not implemented, " 6846 "please contact %s\n", TPACPI_MAIL);
6920 "please contact %s\n", TPACPI_MAIL);
6921 return 1; 6847 return 1;
6922 } 6848 }
6923 6849
@@ -6981,13 +6907,11 @@ static int __init volume_init(struct ibm_init_struct *iibm)
6981 6907
6982 rc = volume_create_alsa_mixer(); 6908 rc = volume_create_alsa_mixer();
6983 if (rc) { 6909 if (rc) {
6984 printk(TPACPI_ERR 6910 pr_err("Could not create the ALSA mixer interface\n");
6985 "Could not create the ALSA mixer interface\n");
6986 return rc; 6911 return rc;
6987 } 6912 }
6988 6913
6989 printk(TPACPI_INFO 6914 pr_info("Console audio control enabled, mode: %s\n",
6990 "Console audio control enabled, mode: %s\n",
6991 (volume_control_allowed) ? 6915 (volume_control_allowed) ?
6992 "override (read/write)" : 6916 "override (read/write)" :
6993 "monitor (read only)"); 6917 "monitor (read only)");
@@ -7049,12 +6973,10 @@ static int volume_write(char *buf)
7049 if (!volume_control_allowed && tpacpi_lifecycle != TPACPI_LIFE_INIT) { 6973 if (!volume_control_allowed && tpacpi_lifecycle != TPACPI_LIFE_INIT) {
7050 if (unlikely(!tp_warned.volume_ctrl_forbidden)) { 6974 if (unlikely(!tp_warned.volume_ctrl_forbidden)) {
7051 tp_warned.volume_ctrl_forbidden = 1; 6975 tp_warned.volume_ctrl_forbidden = 1;
7052 printk(TPACPI_NOTICE 6976 pr_notice("Console audio control in monitor mode, "
7053 "Console audio control in monitor mode, " 6977 "changes are not allowed\n");
7054 "changes are not allowed.\n"); 6978 pr_notice("Use the volume_control=1 module parameter "
7055 printk(TPACPI_NOTICE 6979 "to enable volume control\n");
7056 "Use the volume_control=1 module parameter "
7057 "to enable volume control\n");
7058 } 6980 }
7059 return -EPERM; 6981 return -EPERM;
7060 } 6982 }
@@ -7129,8 +7051,7 @@ static void inline volume_alsa_notify_change(void)
7129 7051
7130static int __init volume_init(struct ibm_init_struct *iibm) 7052static int __init volume_init(struct ibm_init_struct *iibm)
7131{ 7053{
7132 printk(TPACPI_INFO 7054 pr_info("volume: disabled as there is no ALSA support in this kernel\n");
7133 "volume: disabled as there is no ALSA support in this kernel\n");
7134 7055
7135 return 1; 7056 return 1;
7136} 7057}
@@ -7337,9 +7258,8 @@ TPACPI_HANDLE(sfan, ec, "SFAN", /* 570 */
7337static void fan_quirk1_setup(void) 7258static void fan_quirk1_setup(void)
7338{ 7259{
7339 if (fan_control_initial_status == 0x07) { 7260 if (fan_control_initial_status == 0x07) {
7340 printk(TPACPI_NOTICE 7261 pr_notice("fan_init: initial fan status is unknown, "
7341 "fan_init: initial fan status is unknown, " 7262 "assuming it is in auto mode\n");
7342 "assuming it is in auto mode\n");
7343 tp_features.fan_ctrl_status_undef = 1; 7263 tp_features.fan_ctrl_status_undef = 1;
7344 } 7264 }
7345} 7265}
@@ -7726,8 +7646,7 @@ static void fan_watchdog_reset(void)
7726 if (!queue_delayed_work(tpacpi_wq, &fan_watchdog_task, 7646 if (!queue_delayed_work(tpacpi_wq, &fan_watchdog_task,
7727 msecs_to_jiffies(fan_watchdog_maxinterval 7647 msecs_to_jiffies(fan_watchdog_maxinterval
7728 * 1000))) { 7648 * 1000))) {
7729 printk(TPACPI_ERR 7649 pr_err("failed to queue the fan watchdog, "
7730 "failed to queue the fan watchdog, "
7731 "watchdog will not trigger\n"); 7650 "watchdog will not trigger\n");
7732 } 7651 }
7733 } else 7652 } else
@@ -7741,11 +7660,11 @@ static void fan_watchdog_fire(struct work_struct *ignored)
7741 if (tpacpi_lifecycle != TPACPI_LIFE_RUNNING) 7660 if (tpacpi_lifecycle != TPACPI_LIFE_RUNNING)
7742 return; 7661 return;
7743 7662
7744 printk(TPACPI_NOTICE "fan watchdog: enabling fan\n"); 7663 pr_notice("fan watchdog: enabling fan\n");
7745 rc = fan_set_enable(); 7664 rc = fan_set_enable();
7746 if (rc < 0) { 7665 if (rc < 0) {
7747 printk(TPACPI_ERR "fan watchdog: error %d while enabling fan, " 7666 pr_err("fan watchdog: error %d while enabling fan, "
7748 "will try again later...\n", -rc); 7667 "will try again later...\n", -rc);
7749 /* reschedule for later */ 7668 /* reschedule for later */
7750 fan_watchdog_reset(); 7669 fan_watchdog_reset();
7751 } 7670 }
@@ -8049,8 +7968,7 @@ static int __init fan_init(struct ibm_init_struct *iibm)
8049 "secondary fan support enabled\n"); 7968 "secondary fan support enabled\n");
8050 } 7969 }
8051 } else { 7970 } else {
8052 printk(TPACPI_ERR 7971 pr_err("ThinkPad ACPI EC access misbehaving, "
8053 "ThinkPad ACPI EC access misbehaving, "
8054 "fan status and control unavailable\n"); 7972 "fan status and control unavailable\n");
8055 return 1; 7973 return 1;
8056 } 7974 }
@@ -8150,9 +8068,8 @@ static void fan_suspend(pm_message_t state)
8150 fan_control_resume_level = 0; 8068 fan_control_resume_level = 0;
8151 rc = fan_get_status_safe(&fan_control_resume_level); 8069 rc = fan_get_status_safe(&fan_control_resume_level);
8152 if (rc < 0) 8070 if (rc < 0)
8153 printk(TPACPI_NOTICE 8071 pr_notice("failed to read fan level for later "
8154 "failed to read fan level for later " 8072 "restore during resume: %d\n", rc);
8155 "restore during resume: %d\n", rc);
8156 8073
8157 /* if it is undefined, don't attempt to restore it. 8074 /* if it is undefined, don't attempt to restore it.
8158 * KEEP THIS LAST */ 8075 * KEEP THIS LAST */
@@ -8207,13 +8124,11 @@ static void fan_resume(void)
8207 return; 8124 return;
8208 } 8125 }
8209 if (do_set) { 8126 if (do_set) {
8210 printk(TPACPI_NOTICE 8127 pr_notice("restoring fan level to 0x%02x\n",
8211 "restoring fan level to 0x%02x\n", 8128 fan_control_resume_level);
8212 fan_control_resume_level);
8213 rc = fan_set_level_safe(fan_control_resume_level); 8129 rc = fan_set_level_safe(fan_control_resume_level);
8214 if (rc < 0) 8130 if (rc < 0)
8215 printk(TPACPI_NOTICE 8131 pr_notice("failed to restore fan level: %d\n", rc);
8216 "failed to restore fan level: %d\n", rc);
8217 } 8132 }
8218} 8133}
8219 8134
@@ -8305,8 +8220,8 @@ static int fan_write_cmd_level(const char *cmd, int *rc)
8305 8220
8306 *rc = fan_set_level_safe(level); 8221 *rc = fan_set_level_safe(level);
8307 if (*rc == -ENXIO) 8222 if (*rc == -ENXIO)
8308 printk(TPACPI_ERR "level command accepted for unsupported " 8223 pr_err("level command accepted for unsupported access mode %d\n",
8309 "access mode %d", fan_control_access_mode); 8224 fan_control_access_mode);
8310 else if (!*rc) 8225 else if (!*rc)
8311 tpacpi_disclose_usertask("procfs fan", 8226 tpacpi_disclose_usertask("procfs fan",
8312 "set level to %d\n", level); 8227 "set level to %d\n", level);
@@ -8321,8 +8236,8 @@ static int fan_write_cmd_enable(const char *cmd, int *rc)
8321 8236
8322 *rc = fan_set_enable(); 8237 *rc = fan_set_enable();
8323 if (*rc == -ENXIO) 8238 if (*rc == -ENXIO)
8324 printk(TPACPI_ERR "enable command accepted for unsupported " 8239 pr_err("enable command accepted for unsupported access mode %d\n",
8325 "access mode %d", fan_control_access_mode); 8240 fan_control_access_mode);
8326 else if (!*rc) 8241 else if (!*rc)
8327 tpacpi_disclose_usertask("procfs fan", "enable\n"); 8242 tpacpi_disclose_usertask("procfs fan", "enable\n");
8328 8243
@@ -8336,8 +8251,8 @@ static int fan_write_cmd_disable(const char *cmd, int *rc)
8336 8251
8337 *rc = fan_set_disable(); 8252 *rc = fan_set_disable();
8338 if (*rc == -ENXIO) 8253 if (*rc == -ENXIO)
8339 printk(TPACPI_ERR "disable command accepted for unsupported " 8254 pr_err("disable command accepted for unsupported access mode %d\n",
8340 "access mode %d", fan_control_access_mode); 8255 fan_control_access_mode);
8341 else if (!*rc) 8256 else if (!*rc)
8342 tpacpi_disclose_usertask("procfs fan", "disable\n"); 8257 tpacpi_disclose_usertask("procfs fan", "disable\n");
8343 8258
@@ -8356,8 +8271,8 @@ static int fan_write_cmd_speed(const char *cmd, int *rc)
8356 8271
8357 *rc = fan_set_speed(speed); 8272 *rc = fan_set_speed(speed);
8358 if (*rc == -ENXIO) 8273 if (*rc == -ENXIO)
8359 printk(TPACPI_ERR "speed command accepted for unsupported " 8274 pr_err("speed command accepted for unsupported access mode %d\n",
8360 "access mode %d", fan_control_access_mode); 8275 fan_control_access_mode);
8361 else if (!*rc) 8276 else if (!*rc)
8362 tpacpi_disclose_usertask("procfs fan", 8277 tpacpi_disclose_usertask("procfs fan",
8363 "set speed to %d\n", speed); 8278 "set speed to %d\n", speed);
@@ -8560,8 +8475,8 @@ static int __init ibm_init(struct ibm_init_struct *iibm)
8560 if (ibm->acpi->notify) { 8475 if (ibm->acpi->notify) {
8561 ret = setup_acpi_notify(ibm); 8476 ret = setup_acpi_notify(ibm);
8562 if (ret == -ENODEV) { 8477 if (ret == -ENODEV) {
8563 printk(TPACPI_NOTICE "disabling subdriver %s\n", 8478 pr_notice("disabling subdriver %s\n",
8564 ibm->name); 8479 ibm->name);
8565 ret = 0; 8480 ret = 0;
8566 goto err_out; 8481 goto err_out;
8567 } 8482 }
@@ -8583,8 +8498,7 @@ static int __init ibm_init(struct ibm_init_struct *iibm)
8583 entry = proc_create_data(ibm->name, mode, proc_dir, 8498 entry = proc_create_data(ibm->name, mode, proc_dir,
8584 &dispatch_proc_fops, ibm); 8499 &dispatch_proc_fops, ibm);
8585 if (!entry) { 8500 if (!entry) {
8586 printk(TPACPI_ERR "unable to create proc entry %s\n", 8501 pr_err("unable to create proc entry %s\n", ibm->name);
8587 ibm->name);
8588 ret = -ENODEV; 8502 ret = -ENODEV;
8589 goto err_out; 8503 goto err_out;
8590 } 8504 }
@@ -8683,13 +8597,11 @@ static int __must_check __init get_thinkpad_model_data(
8683 tp->ec_release = (ec_fw_string[4] << 8) 8597 tp->ec_release = (ec_fw_string[4] << 8)
8684 | ec_fw_string[5]; 8598 | ec_fw_string[5];
8685 } else { 8599 } else {
8686 printk(TPACPI_NOTICE 8600 pr_notice("ThinkPad firmware release %s "
8687 "ThinkPad firmware release %s " 8601 "doesn't match the known patterns\n",
8688 "doesn't match the known patterns\n", 8602 ec_fw_string);
8689 ec_fw_string); 8603 pr_notice("please report this to %s\n",
8690 printk(TPACPI_NOTICE 8604 TPACPI_MAIL);
8691 "please report this to %s\n",
8692 TPACPI_MAIL);
8693 } 8605 }
8694 break; 8606 break;
8695 } 8607 }
@@ -8733,8 +8645,7 @@ static int __init probe_for_thinkpad(void)
8733 tpacpi_acpi_handle_locate("ec", TPACPI_ACPI_EC_HID, &ec_handle); 8645 tpacpi_acpi_handle_locate("ec", TPACPI_ACPI_EC_HID, &ec_handle);
8734 if (!ec_handle) { 8646 if (!ec_handle) {
8735 if (is_thinkpad) 8647 if (is_thinkpad)
8736 printk(TPACPI_ERR 8648 pr_err("Not yet supported ThinkPad detected!\n");
8737 "Not yet supported ThinkPad detected!\n");
8738 return -ENODEV; 8649 return -ENODEV;
8739 } 8650 }
8740 8651
@@ -8746,10 +8657,10 @@ static int __init probe_for_thinkpad(void)
8746 8657
8747static void __init thinkpad_acpi_init_banner(void) 8658static void __init thinkpad_acpi_init_banner(void)
8748{ 8659{
8749 printk(TPACPI_INFO "%s v%s\n", TPACPI_DESC, TPACPI_VERSION); 8660 pr_info("%s v%s\n", TPACPI_DESC, TPACPI_VERSION);
8750 printk(TPACPI_INFO "%s\n", TPACPI_URL); 8661 pr_info("%s\n", TPACPI_URL);
8751 8662
8752 printk(TPACPI_INFO "ThinkPad BIOS %s, EC %s\n", 8663 pr_info("ThinkPad BIOS %s, EC %s\n",
8753 (thinkpad_id.bios_version_str) ? 8664 (thinkpad_id.bios_version_str) ?
8754 thinkpad_id.bios_version_str : "unknown", 8665 thinkpad_id.bios_version_str : "unknown",
8755 (thinkpad_id.ec_version_str) ? 8666 (thinkpad_id.ec_version_str) ?
@@ -8758,7 +8669,7 @@ static void __init thinkpad_acpi_init_banner(void)
8758 BUG_ON(!thinkpad_id.vendor); 8669 BUG_ON(!thinkpad_id.vendor);
8759 8670
8760 if (thinkpad_id.model_str) 8671 if (thinkpad_id.model_str)
8761 printk(TPACPI_INFO "%s %s, model %s\n", 8672 pr_info("%s %s, model %s\n",
8762 (thinkpad_id.vendor == PCI_VENDOR_ID_IBM) ? 8673 (thinkpad_id.vendor == PCI_VENDOR_ID_IBM) ?
8763 "IBM" : ((thinkpad_id.vendor == 8674 "IBM" : ((thinkpad_id.vendor ==
8764 PCI_VENDOR_ID_LENOVO) ? 8675 PCI_VENDOR_ID_LENOVO) ?
@@ -9024,8 +8935,7 @@ static int __init thinkpad_acpi_module_init(void)
9024 8935
9025 ret = get_thinkpad_model_data(&thinkpad_id); 8936 ret = get_thinkpad_model_data(&thinkpad_id);
9026 if (ret) { 8937 if (ret) {
9027 printk(TPACPI_ERR 8938 pr_err("unable to get DMI data: %d\n", ret);
9028 "unable to get DMI data: %d\n", ret);
9029 thinkpad_acpi_module_exit(); 8939 thinkpad_acpi_module_exit();
9030 return ret; 8940 return ret;
9031 } 8941 }
@@ -9051,16 +8961,14 @@ static int __init thinkpad_acpi_module_init(void)
9051 8961
9052 proc_dir = proc_mkdir(TPACPI_PROC_DIR, acpi_root_dir); 8962 proc_dir = proc_mkdir(TPACPI_PROC_DIR, acpi_root_dir);
9053 if (!proc_dir) { 8963 if (!proc_dir) {
9054 printk(TPACPI_ERR 8964 pr_err("unable to create proc dir " TPACPI_PROC_DIR "\n");
9055 "unable to create proc dir " TPACPI_PROC_DIR);
9056 thinkpad_acpi_module_exit(); 8965 thinkpad_acpi_module_exit();
9057 return -ENODEV; 8966 return -ENODEV;
9058 } 8967 }
9059 8968
9060 ret = platform_driver_register(&tpacpi_pdriver); 8969 ret = platform_driver_register(&tpacpi_pdriver);
9061 if (ret) { 8970 if (ret) {
9062 printk(TPACPI_ERR 8971 pr_err("unable to register main platform driver\n");
9063 "unable to register main platform driver\n");
9064 thinkpad_acpi_module_exit(); 8972 thinkpad_acpi_module_exit();
9065 return ret; 8973 return ret;
9066 } 8974 }
@@ -9068,8 +8976,7 @@ static int __init thinkpad_acpi_module_init(void)
9068 8976
9069 ret = platform_driver_register(&tpacpi_hwmon_pdriver); 8977 ret = platform_driver_register(&tpacpi_hwmon_pdriver);
9070 if (ret) { 8978 if (ret) {
9071 printk(TPACPI_ERR 8979 pr_err("unable to register hwmon platform driver\n");
9072 "unable to register hwmon platform driver\n");
9073 thinkpad_acpi_module_exit(); 8980 thinkpad_acpi_module_exit();
9074 return ret; 8981 return ret;
9075 } 8982 }
@@ -9082,8 +8989,7 @@ static int __init thinkpad_acpi_module_init(void)
9082 &tpacpi_hwmon_pdriver.driver); 8989 &tpacpi_hwmon_pdriver.driver);
9083 } 8990 }
9084 if (ret) { 8991 if (ret) {
9085 printk(TPACPI_ERR 8992 pr_err("unable to create sysfs driver attributes\n");
9086 "unable to create sysfs driver attributes\n");
9087 thinkpad_acpi_module_exit(); 8993 thinkpad_acpi_module_exit();
9088 return ret; 8994 return ret;
9089 } 8995 }
@@ -9096,7 +9002,7 @@ static int __init thinkpad_acpi_module_init(void)
9096 if (IS_ERR(tpacpi_pdev)) { 9002 if (IS_ERR(tpacpi_pdev)) {
9097 ret = PTR_ERR(tpacpi_pdev); 9003 ret = PTR_ERR(tpacpi_pdev);
9098 tpacpi_pdev = NULL; 9004 tpacpi_pdev = NULL;
9099 printk(TPACPI_ERR "unable to register platform device\n"); 9005 pr_err("unable to register platform device\n");
9100 thinkpad_acpi_module_exit(); 9006 thinkpad_acpi_module_exit();
9101 return ret; 9007 return ret;
9102 } 9008 }
@@ -9106,16 +9012,14 @@ static int __init thinkpad_acpi_module_init(void)
9106 if (IS_ERR(tpacpi_sensors_pdev)) { 9012 if (IS_ERR(tpacpi_sensors_pdev)) {
9107 ret = PTR_ERR(tpacpi_sensors_pdev); 9013 ret = PTR_ERR(tpacpi_sensors_pdev);
9108 tpacpi_sensors_pdev = NULL; 9014 tpacpi_sensors_pdev = NULL;
9109 printk(TPACPI_ERR 9015 pr_err("unable to register hwmon platform device\n");
9110 "unable to register hwmon platform device\n");
9111 thinkpad_acpi_module_exit(); 9016 thinkpad_acpi_module_exit();
9112 return ret; 9017 return ret;
9113 } 9018 }
9114 ret = device_create_file(&tpacpi_sensors_pdev->dev, 9019 ret = device_create_file(&tpacpi_sensors_pdev->dev,
9115 &dev_attr_thinkpad_acpi_pdev_name); 9020 &dev_attr_thinkpad_acpi_pdev_name);
9116 if (ret) { 9021 if (ret) {
9117 printk(TPACPI_ERR 9022 pr_err("unable to create sysfs hwmon device attributes\n");
9118 "unable to create sysfs hwmon device attributes\n");
9119 thinkpad_acpi_module_exit(); 9023 thinkpad_acpi_module_exit();
9120 return ret; 9024 return ret;
9121 } 9025 }
@@ -9124,14 +9028,14 @@ static int __init thinkpad_acpi_module_init(void)
9124 if (IS_ERR(tpacpi_hwmon)) { 9028 if (IS_ERR(tpacpi_hwmon)) {
9125 ret = PTR_ERR(tpacpi_hwmon); 9029 ret = PTR_ERR(tpacpi_hwmon);
9126 tpacpi_hwmon = NULL; 9030 tpacpi_hwmon = NULL;
9127 printk(TPACPI_ERR "unable to register hwmon device\n"); 9031 pr_err("unable to register hwmon device\n");
9128 thinkpad_acpi_module_exit(); 9032 thinkpad_acpi_module_exit();
9129 return ret; 9033 return ret;
9130 } 9034 }
9131 mutex_init(&tpacpi_inputdev_send_mutex); 9035 mutex_init(&tpacpi_inputdev_send_mutex);
9132 tpacpi_inputdev = input_allocate_device(); 9036 tpacpi_inputdev = input_allocate_device();
9133 if (!tpacpi_inputdev) { 9037 if (!tpacpi_inputdev) {
9134 printk(TPACPI_ERR "unable to allocate input device\n"); 9038 pr_err("unable to allocate input device\n");
9135 thinkpad_acpi_module_exit(); 9039 thinkpad_acpi_module_exit();
9136 return -ENOMEM; 9040 return -ENOMEM;
9137 } else { 9041 } else {
@@ -9163,7 +9067,7 @@ static int __init thinkpad_acpi_module_init(void)
9163 9067
9164 ret = input_register_device(tpacpi_inputdev); 9068 ret = input_register_device(tpacpi_inputdev);
9165 if (ret < 0) { 9069 if (ret < 0) {
9166 printk(TPACPI_ERR "unable to register input device\n"); 9070 pr_err("unable to register input device\n");
9167 thinkpad_acpi_module_exit(); 9071 thinkpad_acpi_module_exit();
9168 return ret; 9072 return ret;
9169 } else { 9073 } else {