aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/toshiba_acpi.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-03-29 18:21:52 -0400
committerMatthew Garrett <mjg@redhat.com>2011-05-27 12:35:52 -0400
commit7e33460d8d991843a5821d667b55c75a092cf6e3 (patch)
treed00fed9f0e7f0ed3a9db31c3e233cbca5d533a3b /drivers/platform/x86/toshiba_acpi.c
parent93c1d05b5fa83ac771b5d1a5b4eb0fe6f54b3b46 (diff)
toshiba: Convert printks to pr_<level>
Add pr_fmt. Remove local MY_<foo> #defines. Convert printks to pr_<level>. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform/x86/toshiba_acpi.c')
-rw-r--r--drivers/platform/x86/toshiba_acpi.c59
1 files changed, 28 insertions, 31 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index 63f42a22e102..cb009b2629ee 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -35,6 +35,8 @@
35 * 35 *
36 */ 36 */
37 37
38#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
39
38#define TOSHIBA_ACPI_VERSION "0.19" 40#define TOSHIBA_ACPI_VERSION "0.19"
39#define PROC_INTERFACE_VERSION 1 41#define PROC_INTERFACE_VERSION 1
40 42
@@ -60,11 +62,6 @@ MODULE_AUTHOR("John Belmonte");
60MODULE_DESCRIPTION("Toshiba Laptop ACPI Extras Driver"); 62MODULE_DESCRIPTION("Toshiba Laptop ACPI Extras Driver");
61MODULE_LICENSE("GPL"); 63MODULE_LICENSE("GPL");
62 64
63#define MY_LOGPREFIX "toshiba_acpi: "
64#define MY_ERR KERN_ERR MY_LOGPREFIX
65#define MY_NOTICE KERN_NOTICE MY_LOGPREFIX
66#define MY_INFO KERN_INFO MY_LOGPREFIX
67
68/* Toshiba ACPI method paths */ 65/* Toshiba ACPI method paths */
69#define METHOD_LCD_BRIGHTNESS "\\_SB_.PCI0.VGA_.LCD_._BCM" 66#define METHOD_LCD_BRIGHTNESS "\\_SB_.PCI0.VGA_.LCD_._BCM"
70#define TOSH_INTERFACE_1 "\\_SB_.VALD" 67#define TOSH_INTERFACE_1 "\\_SB_.VALD"
@@ -301,7 +298,7 @@ static int toshiba_illumination_available(void)
301 in[0] = 0xf100; 298 in[0] = 0xf100;
302 status = hci_raw(in, out); 299 status = hci_raw(in, out);
303 if (ACPI_FAILURE(status)) { 300 if (ACPI_FAILURE(status)) {
304 printk(MY_INFO "Illumination device not available\n"); 301 pr_info("Illumination device not available\n");
305 return 0; 302 return 0;
306 } 303 }
307 in[0] = 0xf400; 304 in[0] = 0xf400;
@@ -320,7 +317,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
320 in[0] = 0xf100; 317 in[0] = 0xf100;
321 status = hci_raw(in, out); 318 status = hci_raw(in, out);
322 if (ACPI_FAILURE(status)) { 319 if (ACPI_FAILURE(status)) {
323 printk(MY_INFO "Illumination device not available\n"); 320 pr_info("Illumination device not available\n");
324 return; 321 return;
325 } 322 }
326 323
@@ -331,7 +328,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
331 in[2] = 1; 328 in[2] = 1;
332 status = hci_raw(in, out); 329 status = hci_raw(in, out);
333 if (ACPI_FAILURE(status)) { 330 if (ACPI_FAILURE(status)) {
334 printk(MY_INFO "ACPI call for illumination failed.\n"); 331 pr_info("ACPI call for illumination failed\n");
335 return; 332 return;
336 } 333 }
337 } else { 334 } else {
@@ -341,7 +338,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
341 in[2] = 0; 338 in[2] = 0;
342 status = hci_raw(in, out); 339 status = hci_raw(in, out);
343 if (ACPI_FAILURE(status)) { 340 if (ACPI_FAILURE(status)) {
344 printk(MY_INFO "ACPI call for illumination failed.\n"); 341 pr_info("ACPI call for illumination failed.\n");
345 return; 342 return;
346 } 343 }
347 } 344 }
@@ -364,7 +361,7 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev)
364 in[0] = 0xf100; 361 in[0] = 0xf100;
365 status = hci_raw(in, out); 362 status = hci_raw(in, out);
366 if (ACPI_FAILURE(status)) { 363 if (ACPI_FAILURE(status)) {
367 printk(MY_INFO "Illumination device not available\n"); 364 pr_info("Illumination device not available\n");
368 return LED_OFF; 365 return LED_OFF;
369 } 366 }
370 367
@@ -373,7 +370,7 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev)
373 in[1] = 0x14e; 370 in[1] = 0x14e;
374 status = hci_raw(in, out); 371 status = hci_raw(in, out);
375 if (ACPI_FAILURE(status)) { 372 if (ACPI_FAILURE(status)) {
376 printk(MY_INFO "ACPI call for illumination failed.\n"); 373 pr_info("ACPI call for illumination failed.\n");
377 return LED_OFF; 374 return LED_OFF;
378 } 375 }
379 376
@@ -517,7 +514,7 @@ static int lcd_proc_show(struct seq_file *m, void *v)
517 seq_printf(m, "brightness_levels: %d\n", 514 seq_printf(m, "brightness_levels: %d\n",
518 HCI_LCD_BRIGHTNESS_LEVELS); 515 HCI_LCD_BRIGHTNESS_LEVELS);
519 } else { 516 } else {
520 printk(MY_ERR "Error reading LCD brightness\n"); 517 pr_err("Error reading LCD brightness\n");
521 } 518 }
522 519
523 return 0; 520 return 0;
@@ -592,7 +589,7 @@ static int video_proc_show(struct seq_file *m, void *v)
592 seq_printf(m, "crt_out: %d\n", is_crt); 589 seq_printf(m, "crt_out: %d\n", is_crt);
593 seq_printf(m, "tv_out: %d\n", is_tv); 590 seq_printf(m, "tv_out: %d\n", is_tv);
594 } else { 591 } else {
595 printk(MY_ERR "Error reading video out status\n"); 592 pr_err("Error reading video out status\n");
596 } 593 }
597 594
598 return 0; 595 return 0;
@@ -686,7 +683,7 @@ static int fan_proc_show(struct seq_file *m, void *v)
686 seq_printf(m, "running: %d\n", (value > 0)); 683 seq_printf(m, "running: %d\n", (value > 0));
687 seq_printf(m, "force_on: %d\n", force_fan); 684 seq_printf(m, "force_on: %d\n", force_fan);
688 } else { 685 } else {
689 printk(MY_ERR "Error reading fan status\n"); 686 pr_err("Error reading fan status\n");
690 } 687 }
691 688
692 return 0; 689 return 0;
@@ -750,9 +747,9 @@ static int keys_proc_show(struct seq_file *m, void *v)
750 * some machines where system events sporadically 747 * some machines where system events sporadically
751 * become disabled. */ 748 * become disabled. */
752 hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result); 749 hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result);
753 printk(MY_NOTICE "Re-enabled hotkeys\n"); 750 pr_notice("Re-enabled hotkeys\n");
754 } else { 751 } else {
755 printk(MY_ERR "Error reading hotkey status\n"); 752 pr_err("Error reading hotkey status\n");
756 goto end; 753 goto end;
757 } 754 }
758 } 755 }
@@ -863,7 +860,7 @@ static void toshiba_acpi_notify(acpi_handle handle, u32 event, void *context)
863 860
864 if (!sparse_keymap_report_event(toshiba_acpi.hotkey_dev, 861 if (!sparse_keymap_report_event(toshiba_acpi.hotkey_dev,
865 value, 1, true)) { 862 value, 1, true)) {
866 printk(MY_INFO "Unknown key %x\n", 863 pr_info("Unknown key %x\n",
867 value); 864 value);
868 } 865 }
869 } else if (hci_result == HCI_NOT_SUPPORTED) { 866 } else if (hci_result == HCI_NOT_SUPPORTED) {
@@ -871,7 +868,7 @@ static void toshiba_acpi_notify(acpi_handle handle, u32 event, void *context)
871 * some machines where system events sporadically 868 * some machines where system events sporadically
872 * become disabled. */ 869 * become disabled. */
873 hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result); 870 hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result);
874 printk(MY_NOTICE "Re-enabled hotkeys\n"); 871 pr_notice("Re-enabled hotkeys\n");
875 } 872 }
876 } while (hci_result != HCI_EMPTY); 873 } while (hci_result != HCI_EMPTY);
877} 874}
@@ -883,13 +880,13 @@ static int __init toshiba_acpi_setup_keyboard(char *device)
883 880
884 status = acpi_get_handle(NULL, device, &toshiba_acpi.handle); 881 status = acpi_get_handle(NULL, device, &toshiba_acpi.handle);
885 if (ACPI_FAILURE(status)) { 882 if (ACPI_FAILURE(status)) {
886 printk(MY_INFO "Unable to get notification device\n"); 883 pr_info("Unable to get notification device\n");
887 return -ENODEV; 884 return -ENODEV;
888 } 885 }
889 886
890 toshiba_acpi.hotkey_dev = input_allocate_device(); 887 toshiba_acpi.hotkey_dev = input_allocate_device();
891 if (!toshiba_acpi.hotkey_dev) { 888 if (!toshiba_acpi.hotkey_dev) {
892 printk(MY_INFO "Unable to register input device\n"); 889 pr_info("Unable to register input device\n");
893 return -ENOMEM; 890 return -ENOMEM;
894 } 891 }
895 892
@@ -905,21 +902,21 @@ static int __init toshiba_acpi_setup_keyboard(char *device)
905 status = acpi_install_notify_handler(toshiba_acpi.handle, 902 status = acpi_install_notify_handler(toshiba_acpi.handle,
906 ACPI_DEVICE_NOTIFY, toshiba_acpi_notify, NULL); 903 ACPI_DEVICE_NOTIFY, toshiba_acpi_notify, NULL);
907 if (ACPI_FAILURE(status)) { 904 if (ACPI_FAILURE(status)) {
908 printk(MY_INFO "Unable to install hotkey notification\n"); 905 pr_info("Unable to install hotkey notification\n");
909 error = -ENODEV; 906 error = -ENODEV;
910 goto err_free_keymap; 907 goto err_free_keymap;
911 } 908 }
912 909
913 status = acpi_evaluate_object(toshiba_acpi.handle, "ENAB", NULL, NULL); 910 status = acpi_evaluate_object(toshiba_acpi.handle, "ENAB", NULL, NULL);
914 if (ACPI_FAILURE(status)) { 911 if (ACPI_FAILURE(status)) {
915 printk(MY_INFO "Unable to enable hotkeys\n"); 912 pr_info("Unable to enable hotkeys\n");
916 error = -ENODEV; 913 error = -ENODEV;
917 goto err_remove_notify; 914 goto err_remove_notify;
918 } 915 }
919 916
920 error = input_register_device(toshiba_acpi.hotkey_dev); 917 error = input_register_device(toshiba_acpi.hotkey_dev);
921 if (error) { 918 if (error) {
922 printk(MY_INFO "Unable to register input device\n"); 919 pr_info("Unable to register input device\n");
923 goto err_remove_notify; 920 goto err_remove_notify;
924 } 921 }
925 922
@@ -980,17 +977,17 @@ static int __init toshiba_acpi_init(void)
980 if (is_valid_acpi_path(TOSH_INTERFACE_1 GHCI_METHOD)) { 977 if (is_valid_acpi_path(TOSH_INTERFACE_1 GHCI_METHOD)) {
981 method_hci = TOSH_INTERFACE_1 GHCI_METHOD; 978 method_hci = TOSH_INTERFACE_1 GHCI_METHOD;
982 if (toshiba_acpi_setup_keyboard(TOSH_INTERFACE_1)) 979 if (toshiba_acpi_setup_keyboard(TOSH_INTERFACE_1))
983 printk(MY_INFO "Unable to activate hotkeys\n"); 980 pr_info("Unable to activate hotkeys\n");
984 } else if (is_valid_acpi_path(TOSH_INTERFACE_2 GHCI_METHOD)) { 981 } else if (is_valid_acpi_path(TOSH_INTERFACE_2 GHCI_METHOD)) {
985 method_hci = TOSH_INTERFACE_2 GHCI_METHOD; 982 method_hci = TOSH_INTERFACE_2 GHCI_METHOD;
986 if (toshiba_acpi_setup_keyboard(TOSH_INTERFACE_2)) 983 if (toshiba_acpi_setup_keyboard(TOSH_INTERFACE_2))
987 printk(MY_INFO "Unable to activate hotkeys\n"); 984 pr_info("Unable to activate hotkeys\n");
988 } else 985 } else
989 return -ENODEV; 986 return -ENODEV;
990 987
991 printk(MY_INFO "Toshiba Laptop ACPI Extras version %s\n", 988 pr_info("Toshiba Laptop ACPI Extras version %s\n",
992 TOSHIBA_ACPI_VERSION); 989 TOSHIBA_ACPI_VERSION);
993 printk(MY_INFO " HCI method: %s\n", method_hci); 990 pr_info(" HCI method: %s\n", method_hci);
994 991
995 mutex_init(&toshiba_acpi.mutex); 992 mutex_init(&toshiba_acpi.mutex);
996 993
@@ -998,7 +995,7 @@ static int __init toshiba_acpi_init(void)
998 -1, NULL, 0); 995 -1, NULL, 0);
999 if (IS_ERR(toshiba_acpi.p_dev)) { 996 if (IS_ERR(toshiba_acpi.p_dev)) {
1000 ret = PTR_ERR(toshiba_acpi.p_dev); 997 ret = PTR_ERR(toshiba_acpi.p_dev);
1001 printk(MY_ERR "unable to register platform device\n"); 998 pr_err("unable to register platform device\n");
1002 toshiba_acpi.p_dev = NULL; 999 toshiba_acpi.p_dev = NULL;
1003 toshiba_acpi_exit(); 1000 toshiba_acpi_exit();
1004 return ret; 1001 return ret;
@@ -1028,7 +1025,7 @@ static int __init toshiba_acpi_init(void)
1028 if (IS_ERR(toshiba_backlight_device)) { 1025 if (IS_ERR(toshiba_backlight_device)) {
1029 ret = PTR_ERR(toshiba_backlight_device); 1026 ret = PTR_ERR(toshiba_backlight_device);
1030 1027
1031 printk(KERN_ERR "Could not register toshiba backlight device\n"); 1028 pr_err("Could not register toshiba backlight device\n");
1032 toshiba_backlight_device = NULL; 1029 toshiba_backlight_device = NULL;
1033 toshiba_acpi_exit(); 1030 toshiba_acpi_exit();
1034 return ret; 1031 return ret;
@@ -1042,14 +1039,14 @@ static int __init toshiba_acpi_init(void)
1042 &toshiba_rfk_ops, 1039 &toshiba_rfk_ops,
1043 &toshiba_acpi); 1040 &toshiba_acpi);
1044 if (!toshiba_acpi.bt_rfk) { 1041 if (!toshiba_acpi.bt_rfk) {
1045 printk(MY_ERR "unable to allocate rfkill device\n"); 1042 pr_err("unable to allocate rfkill device\n");
1046 toshiba_acpi_exit(); 1043 toshiba_acpi_exit();
1047 return -ENOMEM; 1044 return -ENOMEM;
1048 } 1045 }
1049 1046
1050 ret = rfkill_register(toshiba_acpi.bt_rfk); 1047 ret = rfkill_register(toshiba_acpi.bt_rfk);
1051 if (ret) { 1048 if (ret) {
1052 printk(MY_ERR "unable to register rfkill device\n"); 1049 pr_err("unable to register rfkill device\n");
1053 rfkill_destroy(toshiba_acpi.bt_rfk); 1050 rfkill_destroy(toshiba_acpi.bt_rfk);
1054 toshiba_acpi_exit(); 1051 toshiba_acpi_exit();
1055 return ret; 1052 return ret;