diff options
author | Corentin Chary <corentincj@iksaif.net> | 2009-06-19 08:52:03 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-06-24 01:31:38 -0400 |
commit | 2fcc23da5522b89677fb0af6043a88e88fdd09a2 (patch) | |
tree | b396070d063645d00c370f37f865346f5550ddd4 | |
parent | b31d0fde89c905673ceed0404d5ae24f2261d7c7 (diff) |
asus-laptop: use pr_fmt and pr_<level>
Convert the unusual printk(ASUS_<level> uses to
the more standard pr_fmt and pr_<level>(.
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | drivers/platform/x86/asus-laptop.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index faa87d3e3983..db657bbeec90 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c | |||
@@ -33,6 +33,8 @@ | |||
33 | * Sam Lin - GPS support | 33 | * Sam Lin - GPS support |
34 | */ | 34 | */ |
35 | 35 | ||
36 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
37 | |||
36 | #include <linux/kernel.h> | 38 | #include <linux/kernel.h> |
37 | #include <linux/module.h> | 39 | #include <linux/module.h> |
38 | #include <linux/init.h> | 40 | #include <linux/init.h> |
@@ -53,9 +55,10 @@ | |||
53 | #define ASUS_HOTK_NAME "Asus Laptop Support" | 55 | #define ASUS_HOTK_NAME "Asus Laptop Support" |
54 | #define ASUS_HOTK_CLASS "hotkey" | 56 | #define ASUS_HOTK_CLASS "hotkey" |
55 | #define ASUS_HOTK_DEVICE_NAME "Hotkey" | 57 | #define ASUS_HOTK_DEVICE_NAME "Hotkey" |
56 | #define ASUS_HOTK_FILE "asus-laptop" | 58 | #define ASUS_HOTK_FILE KBUILD_MODNAME |
57 | #define ASUS_HOTK_PREFIX "\\_SB.ATKD." | 59 | #define ASUS_HOTK_PREFIX "\\_SB.ATKD." |
58 | 60 | ||
61 | |||
59 | /* | 62 | /* |
60 | * Some events we use, same for all Asus | 63 | * Some events we use, same for all Asus |
61 | */ | 64 | */ |
@@ -327,7 +330,7 @@ static int read_wireless_status(int mask) | |||
327 | 330 | ||
328 | rv = acpi_evaluate_integer(wireless_status_handle, NULL, NULL, &status); | 331 | rv = acpi_evaluate_integer(wireless_status_handle, NULL, NULL, &status); |
329 | if (ACPI_FAILURE(rv)) | 332 | if (ACPI_FAILURE(rv)) |
330 | printk(ASUS_WARNING "Error reading Wireless status\n"); | 333 | pr_warning("Error reading Wireless status\n"); |
331 | else | 334 | else |
332 | return (status & mask) ? 1 : 0; | 335 | return (status & mask) ? 1 : 0; |
333 | 336 | ||
@@ -341,7 +344,7 @@ static int read_gps_status(void) | |||
341 | 344 | ||
342 | rv = acpi_evaluate_integer(gps_status_handle, NULL, NULL, &status); | 345 | rv = acpi_evaluate_integer(gps_status_handle, NULL, NULL, &status); |
343 | if (ACPI_FAILURE(rv)) | 346 | if (ACPI_FAILURE(rv)) |
344 | printk(ASUS_WARNING "Error reading GPS status\n"); | 347 | pr_warning("Error reading GPS status\n"); |
345 | else | 348 | else |
346 | return status ? 1 : 0; | 349 | return status ? 1 : 0; |
347 | 350 | ||
@@ -381,7 +384,7 @@ static void write_status(acpi_handle handle, int out, int mask) | |||
381 | } | 384 | } |
382 | 385 | ||
383 | if (write_acpi_int(handle, NULL, out, NULL)) | 386 | if (write_acpi_int(handle, NULL, out, NULL)) |
384 | printk(ASUS_WARNING " write failed %x\n", mask); | 387 | pr_warning(" write failed %x\n", mask); |
385 | } | 388 | } |
386 | 389 | ||
387 | /* /sys/class/led handlers */ | 390 | /* /sys/class/led handlers */ |
@@ -424,7 +427,7 @@ static int set_lcd_state(int value) | |||
424 | NULL, NULL, NULL); | 427 | NULL, NULL, NULL); |
425 | 428 | ||
426 | if (ACPI_FAILURE(status)) | 429 | if (ACPI_FAILURE(status)) |
427 | printk(ASUS_WARNING "Error switching LCD\n"); | 430 | pr_warning("Error switching LCD\n"); |
428 | } | 431 | } |
429 | 432 | ||
430 | write_status(NULL, lcd, LCD_ON); | 433 | write_status(NULL, lcd, LCD_ON); |
@@ -448,7 +451,7 @@ static int read_brightness(struct backlight_device *bd) | |||
448 | 451 | ||
449 | rv = acpi_evaluate_integer(brightness_get_handle, NULL, NULL, &value); | 452 | rv = acpi_evaluate_integer(brightness_get_handle, NULL, NULL, &value); |
450 | if (ACPI_FAILURE(rv)) | 453 | if (ACPI_FAILURE(rv)) |
451 | printk(ASUS_WARNING "Error reading brightness\n"); | 454 | pr_warning("Error reading brightness\n"); |
452 | 455 | ||
453 | return value; | 456 | return value; |
454 | } | 457 | } |
@@ -461,7 +464,7 @@ static int set_brightness(struct backlight_device *bd, int value) | |||
461 | /* 0 <= value <= 15 */ | 464 | /* 0 <= value <= 15 */ |
462 | 465 | ||
463 | if (write_acpi_int(brightness_set_handle, NULL, value, NULL)) { | 466 | if (write_acpi_int(brightness_set_handle, NULL, value, NULL)) { |
464 | printk(ASUS_WARNING "Error changing brightness\n"); | 467 | pr_warning("Error changing brightness\n"); |
465 | ret = -EIO; | 468 | ret = -EIO; |
466 | } | 469 | } |
467 | 470 | ||
@@ -591,7 +594,7 @@ static ssize_t store_ledd(struct device *dev, struct device_attribute *attr, | |||
591 | rv = parse_arg(buf, count, &value); | 594 | rv = parse_arg(buf, count, &value); |
592 | if (rv > 0) { | 595 | if (rv > 0) { |
593 | if (write_acpi_int(ledd_set_handle, NULL, value, NULL)) | 596 | if (write_acpi_int(ledd_set_handle, NULL, value, NULL)) |
594 | printk(ASUS_WARNING "LED display write failed\n"); | 597 | pr_warning("LED display write failed\n"); |
595 | else | 598 | else |
596 | hotk->ledd_status = (u32) value; | 599 | hotk->ledd_status = (u32) value; |
597 | } | 600 | } |
@@ -636,7 +639,7 @@ static void set_display(int value) | |||
636 | { | 639 | { |
637 | /* no sanity check needed for now */ | 640 | /* no sanity check needed for now */ |
638 | if (write_acpi_int(display_set_handle, NULL, value, NULL)) | 641 | if (write_acpi_int(display_set_handle, NULL, value, NULL)) |
639 | printk(ASUS_WARNING "Error setting display\n"); | 642 | pr_warning("Error setting display\n"); |
640 | return; | 643 | return; |
641 | } | 644 | } |
642 | 645 | ||
@@ -651,7 +654,7 @@ static int read_display(void) | |||
651 | rv = acpi_evaluate_integer(display_get_handle, NULL, | 654 | rv = acpi_evaluate_integer(display_get_handle, NULL, |
652 | NULL, &value); | 655 | NULL, &value); |
653 | if (ACPI_FAILURE(rv)) | 656 | if (ACPI_FAILURE(rv)) |
654 | printk(ASUS_WARNING "Error reading display status\n"); | 657 | pr_warning("Error reading display status\n"); |
655 | } | 658 | } |
656 | 659 | ||
657 | value &= 0x0F; /* needed for some models, shouldn't hurt others */ | 660 | value &= 0x0F; /* needed for some models, shouldn't hurt others */ |
@@ -693,7 +696,7 @@ static ssize_t store_disp(struct device *dev, struct device_attribute *attr, | |||
693 | static void set_light_sens_switch(int value) | 696 | static void set_light_sens_switch(int value) |
694 | { | 697 | { |
695 | if (write_acpi_int(ls_switch_handle, NULL, value, NULL)) | 698 | if (write_acpi_int(ls_switch_handle, NULL, value, NULL)) |
696 | printk(ASUS_WARNING "Error setting light sensor switch\n"); | 699 | pr_warning("Error setting light sensor switch\n"); |
697 | hotk->light_switch = value; | 700 | hotk->light_switch = value; |
698 | } | 701 | } |
699 | 702 | ||
@@ -718,7 +721,7 @@ static ssize_t store_lssw(struct device *dev, struct device_attribute *attr, | |||
718 | static void set_light_sens_level(int value) | 721 | static void set_light_sens_level(int value) |
719 | { | 722 | { |
720 | if (write_acpi_int(ls_level_handle, NULL, value, NULL)) | 723 | if (write_acpi_int(ls_level_handle, NULL, value, NULL)) |
721 | printk(ASUS_WARNING "Error setting light sensor level\n"); | 724 | pr_warning("Error setting light sensor level\n"); |
722 | hotk->light_level = value; | 725 | hotk->light_level = value; |
723 | } | 726 | } |
724 | 727 | ||
@@ -979,11 +982,11 @@ static int asus_hotk_get_info(void) | |||
979 | */ | 982 | */ |
980 | status = acpi_get_table(ACPI_SIG_DSDT, 1, &asus_info); | 983 | status = acpi_get_table(ACPI_SIG_DSDT, 1, &asus_info); |
981 | if (ACPI_FAILURE(status)) | 984 | if (ACPI_FAILURE(status)) |
982 | printk(ASUS_WARNING "Couldn't get the DSDT table header\n"); | 985 | pr_warning("Couldn't get the DSDT table header\n"); |
983 | 986 | ||
984 | /* We have to write 0 on init this far for all ASUS models */ | 987 | /* We have to write 0 on init this far for all ASUS models */ |
985 | if (write_acpi_int(hotk->handle, "INIT", 0, &buffer)) { | 988 | if (write_acpi_int(hotk->handle, "INIT", 0, &buffer)) { |
986 | printk(ASUS_ERR "Hotkey initialization failed\n"); | 989 | pr_err("Hotkey initialization failed\n"); |
987 | return -ENODEV; | 990 | return -ENODEV; |
988 | } | 991 | } |
989 | 992 | ||
@@ -991,9 +994,9 @@ static int asus_hotk_get_info(void) | |||
991 | status = | 994 | status = |
992 | acpi_evaluate_integer(hotk->handle, "BSTS", NULL, &bsts_result); | 995 | acpi_evaluate_integer(hotk->handle, "BSTS", NULL, &bsts_result); |
993 | if (ACPI_FAILURE(status)) | 996 | if (ACPI_FAILURE(status)) |
994 | printk(ASUS_WARNING "Error calling BSTS\n"); | 997 | pr_warning("Error calling BSTS\n"); |
995 | else if (bsts_result) | 998 | else if (bsts_result) |
996 | printk(ASUS_NOTICE "BSTS called, 0x%02x returned\n", | 999 | pr_notice("BSTS called, 0x%02x returned\n", |
997 | (uint) bsts_result); | 1000 | (uint) bsts_result); |
998 | 1001 | ||
999 | /* This too ... */ | 1002 | /* This too ... */ |
@@ -1024,7 +1027,7 @@ static int asus_hotk_get_info(void) | |||
1024 | return -ENOMEM; | 1027 | return -ENOMEM; |
1025 | 1028 | ||
1026 | if (*string) | 1029 | if (*string) |
1027 | printk(ASUS_NOTICE " %s model detected\n", string); | 1030 | pr_notice(" %s model detected\n", string); |
1028 | 1031 | ||
1029 | ASUS_HANDLE_INIT(mled_set); | 1032 | ASUS_HANDLE_INIT(mled_set); |
1030 | ASUS_HANDLE_INIT(tled_set); | 1033 | ASUS_HANDLE_INIT(tled_set); |
@@ -1081,7 +1084,7 @@ static int asus_input_init(void) | |||
1081 | 1084 | ||
1082 | hotk->inputdev = input_allocate_device(); | 1085 | hotk->inputdev = input_allocate_device(); |
1083 | if (!hotk->inputdev) { | 1086 | if (!hotk->inputdev) { |
1084 | printk(ASUS_INFO "Unable to allocate input device\n"); | 1087 | pr_info("Unable to allocate input device\n"); |
1085 | return 0; | 1088 | return 0; |
1086 | } | 1089 | } |
1087 | hotk->inputdev->name = "Asus Laptop extra buttons"; | 1090 | hotk->inputdev->name = "Asus Laptop extra buttons"; |
@@ -1100,7 +1103,7 @@ static int asus_input_init(void) | |||
1100 | } | 1103 | } |
1101 | result = input_register_device(hotk->inputdev); | 1104 | result = input_register_device(hotk->inputdev); |
1102 | if (result) { | 1105 | if (result) { |
1103 | printk(ASUS_INFO "Unable to register input device\n"); | 1106 | pr_info("Unable to register input device\n"); |
1104 | input_free_device(hotk->inputdev); | 1107 | input_free_device(hotk->inputdev); |
1105 | } | 1108 | } |
1106 | return result; | 1109 | return result; |
@@ -1117,7 +1120,7 @@ static int asus_hotk_check(void) | |||
1117 | if (hotk->device->status.present) { | 1120 | if (hotk->device->status.present) { |
1118 | result = asus_hotk_get_info(); | 1121 | result = asus_hotk_get_info(); |
1119 | } else { | 1122 | } else { |
1120 | printk(ASUS_ERR "Hotkey device not present, aborting\n"); | 1123 | pr_err("Hotkey device not present, aborting\n"); |
1121 | return -EINVAL; | 1124 | return -EINVAL; |
1122 | } | 1125 | } |
1123 | 1126 | ||
@@ -1133,7 +1136,7 @@ static int asus_hotk_add(struct acpi_device *device) | |||
1133 | if (!device) | 1136 | if (!device) |
1134 | return -EINVAL; | 1137 | return -EINVAL; |
1135 | 1138 | ||
1136 | printk(ASUS_NOTICE "Asus Laptop Support version %s\n", | 1139 | pr_notice("Asus Laptop Support version %s\n", |
1137 | ASUS_LAPTOP_VERSION); | 1140 | ASUS_LAPTOP_VERSION); |
1138 | 1141 | ||
1139 | hotk = kzalloc(sizeof(struct asus_hotk), GFP_KERNEL); | 1142 | hotk = kzalloc(sizeof(struct asus_hotk), GFP_KERNEL); |
@@ -1247,8 +1250,7 @@ static int asus_backlight_init(struct device *dev) | |||
1247 | bd = backlight_device_register(ASUS_HOTK_FILE, dev, | 1250 | bd = backlight_device_register(ASUS_HOTK_FILE, dev, |
1248 | NULL, &asusbl_ops); | 1251 | NULL, &asusbl_ops); |
1249 | if (IS_ERR(bd)) { | 1252 | if (IS_ERR(bd)) { |
1250 | printk(ASUS_ERR | 1253 | pr_err("Could not register asus backlight device\n"); |
1251 | "Could not register asus backlight device\n"); | ||
1252 | asus_backlight_device = NULL; | 1254 | asus_backlight_device = NULL; |
1253 | return PTR_ERR(bd); | 1255 | return PTR_ERR(bd); |
1254 | } | 1256 | } |
@@ -1375,7 +1377,7 @@ static int __init asus_laptop_init(void) | |||
1375 | if (result) | 1377 | if (result) |
1376 | goto fail_backlight; | 1378 | goto fail_backlight; |
1377 | } else | 1379 | } else |
1378 | printk(ASUS_INFO "Brightness ignored, must be controlled by " | 1380 | pr_info("Brightness ignored, must be controlled by " |
1379 | "ACPI video driver\n"); | 1381 | "ACPI video driver\n"); |
1380 | 1382 | ||
1381 | return 0; | 1383 | return 0; |