diff options
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/wmi.c | 64 |
1 files changed, 29 insertions, 35 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index dc528ba8617b..dd30b2aa7a29 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c | |||
@@ -27,6 +27,8 @@ | |||
27 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 27 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
31 | |||
30 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
31 | #include <linux/init.h> | 33 | #include <linux/init.h> |
32 | #include <linux/types.h> | 34 | #include <linux/types.h> |
@@ -44,8 +46,6 @@ MODULE_LICENSE("GPL"); | |||
44 | 46 | ||
45 | #define ACPI_WMI_CLASS "wmi" | 47 | #define ACPI_WMI_CLASS "wmi" |
46 | 48 | ||
47 | #define PREFIX "ACPI: WMI: " | ||
48 | |||
49 | static DEFINE_MUTEX(wmi_data_lock); | 49 | static DEFINE_MUTEX(wmi_data_lock); |
50 | static LIST_HEAD(wmi_block_list); | 50 | static LIST_HEAD(wmi_block_list); |
51 | 51 | ||
@@ -480,25 +480,24 @@ static void wmi_dump_wdg(const struct guid_block *g) | |||
480 | char guid_string[37]; | 480 | char guid_string[37]; |
481 | 481 | ||
482 | wmi_gtoa(g->guid, guid_string); | 482 | wmi_gtoa(g->guid, guid_string); |
483 | printk(KERN_INFO PREFIX "%s:\n", guid_string); | 483 | |
484 | printk(KERN_INFO PREFIX "\tobject_id: %c%c\n", | 484 | pr_info("%s:\n", guid_string); |
485 | g->object_id[0], g->object_id[1]); | 485 | pr_info("\tobject_id: %c%c\n", g->object_id[0], g->object_id[1]); |
486 | printk(KERN_INFO PREFIX "\tnotify_id: %02X\n", g->notify_id); | 486 | pr_info("\tnotify_id: %02X\n", g->notify_id); |
487 | printk(KERN_INFO PREFIX "\treserved: %02X\n", g->reserved); | 487 | pr_info("\treserved: %02X\n", g->reserved); |
488 | printk(KERN_INFO PREFIX "\tinstance_count: %d\n", g->instance_count); | 488 | pr_info("\tinstance_count: %d\n", g->instance_count); |
489 | printk(KERN_INFO PREFIX "\tflags: %#x", g->flags); | 489 | pr_info("\tflags: %#x ", g->flags); |
490 | if (g->flags) { | 490 | if (g->flags) { |
491 | printk(" "); | ||
492 | if (g->flags & ACPI_WMI_EXPENSIVE) | 491 | if (g->flags & ACPI_WMI_EXPENSIVE) |
493 | printk("ACPI_WMI_EXPENSIVE "); | 492 | pr_cont("ACPI_WMI_EXPENSIVE "); |
494 | if (g->flags & ACPI_WMI_METHOD) | 493 | if (g->flags & ACPI_WMI_METHOD) |
495 | printk("ACPI_WMI_METHOD "); | 494 | pr_cont("ACPI_WMI_METHOD "); |
496 | if (g->flags & ACPI_WMI_STRING) | 495 | if (g->flags & ACPI_WMI_STRING) |
497 | printk("ACPI_WMI_STRING "); | 496 | pr_cont("ACPI_WMI_STRING "); |
498 | if (g->flags & ACPI_WMI_EVENT) | 497 | if (g->flags & ACPI_WMI_EVENT) |
499 | printk("ACPI_WMI_EVENT "); | 498 | pr_cont("ACPI_WMI_EVENT "); |
500 | } | 499 | } |
501 | printk("\n"); | 500 | pr_cont("\n"); |
502 | 501 | ||
503 | } | 502 | } |
504 | 503 | ||
@@ -510,7 +509,7 @@ static void wmi_notify_debug(u32 value, void *context) | |||
510 | 509 | ||
511 | status = wmi_get_event_data(value, &response); | 510 | status = wmi_get_event_data(value, &response); |
512 | if (status != AE_OK) { | 511 | if (status != AE_OK) { |
513 | printk(KERN_INFO "wmi: bad event status 0x%x\n", status); | 512 | pr_info("bad event status 0x%x\n", status); |
514 | return; | 513 | return; |
515 | } | 514 | } |
516 | 515 | ||
@@ -519,22 +518,22 @@ static void wmi_notify_debug(u32 value, void *context) | |||
519 | if (!obj) | 518 | if (!obj) |
520 | return; | 519 | return; |
521 | 520 | ||
522 | printk(KERN_INFO PREFIX "DEBUG Event "); | 521 | pr_info("DEBUG Event "); |
523 | switch(obj->type) { | 522 | switch(obj->type) { |
524 | case ACPI_TYPE_BUFFER: | 523 | case ACPI_TYPE_BUFFER: |
525 | printk("BUFFER_TYPE - length %d\n", obj->buffer.length); | 524 | pr_cont("BUFFER_TYPE - length %d\n", obj->buffer.length); |
526 | break; | 525 | break; |
527 | case ACPI_TYPE_STRING: | 526 | case ACPI_TYPE_STRING: |
528 | printk("STRING_TYPE - %s\n", obj->string.pointer); | 527 | pr_cont("STRING_TYPE - %s\n", obj->string.pointer); |
529 | break; | 528 | break; |
530 | case ACPI_TYPE_INTEGER: | 529 | case ACPI_TYPE_INTEGER: |
531 | printk("INTEGER_TYPE - %llu\n", obj->integer.value); | 530 | pr_cont("INTEGER_TYPE - %llu\n", obj->integer.value); |
532 | break; | 531 | break; |
533 | case ACPI_TYPE_PACKAGE: | 532 | case ACPI_TYPE_PACKAGE: |
534 | printk("PACKAGE_TYPE - %d elements\n", obj->package.count); | 533 | pr_cont("PACKAGE_TYPE - %d elements\n", obj->package.count); |
535 | break; | 534 | break; |
536 | default: | 535 | default: |
537 | printk("object type 0x%X\n", obj->type); | 536 | pr_cont("object type 0x%X\n", obj->type); |
538 | } | 537 | } |
539 | kfree(obj); | 538 | kfree(obj); |
540 | } | 539 | } |
@@ -845,8 +844,7 @@ static acpi_status parse_wdg(acpi_handle handle) | |||
845 | */ | 844 | */ |
846 | if (guid_already_parsed(gblock[i].guid) == true) { | 845 | if (guid_already_parsed(gblock[i].guid) == true) { |
847 | wmi_gtoa(gblock[i].guid, guid_string); | 846 | wmi_gtoa(gblock[i].guid, guid_string); |
848 | printk(KERN_INFO PREFIX "Skipping duplicate GUID %s\n", | 847 | pr_info("Skipping duplicate GUID %s\n", guid_string); |
849 | guid_string); | ||
850 | continue; | 848 | continue; |
851 | } | 849 | } |
852 | if (debug_dump_wdg) | 850 | if (debug_dump_wdg) |
@@ -937,8 +935,7 @@ static void acpi_wmi_notify(struct acpi_device *device, u32 event) | |||
937 | wblock->handler(event, wblock->handler_data); | 935 | wblock->handler(event, wblock->handler_data); |
938 | if (debug_event) { | 936 | if (debug_event) { |
939 | wmi_gtoa(wblock->gblock.guid, guid_string); | 937 | wmi_gtoa(wblock->gblock.guid, guid_string); |
940 | printk(KERN_INFO PREFIX "DEBUG Event GUID:" | 938 | pr_info("DEBUG Event GUID: %s\n", guid_string); |
941 | " %s\n", guid_string); | ||
942 | } | 939 | } |
943 | 940 | ||
944 | acpi_bus_generate_netlink_event( | 941 | acpi_bus_generate_netlink_event( |
@@ -967,7 +964,7 @@ static int acpi_wmi_add(struct acpi_device *device) | |||
967 | &acpi_wmi_ec_space_handler, | 964 | &acpi_wmi_ec_space_handler, |
968 | NULL, NULL); | 965 | NULL, NULL); |
969 | if (ACPI_FAILURE(status)) { | 966 | if (ACPI_FAILURE(status)) { |
970 | printk(KERN_ERR PREFIX "Error installing EC region handler\n"); | 967 | pr_err("Error installing EC region handler\n"); |
971 | return -ENODEV; | 968 | return -ENODEV; |
972 | } | 969 | } |
973 | 970 | ||
@@ -976,7 +973,7 @@ static int acpi_wmi_add(struct acpi_device *device) | |||
976 | acpi_remove_address_space_handler(device->handle, | 973 | acpi_remove_address_space_handler(device->handle, |
977 | ACPI_ADR_SPACE_EC, | 974 | ACPI_ADR_SPACE_EC, |
978 | &acpi_wmi_ec_space_handler); | 975 | &acpi_wmi_ec_space_handler); |
979 | printk(KERN_ERR PREFIX "Failed to parse WDG method\n"); | 976 | pr_err("Failed to parse WDG method\n"); |
980 | return -ENODEV; | 977 | return -ENODEV; |
981 | } | 978 | } |
982 | 979 | ||
@@ -991,9 +988,8 @@ static int __init acpi_wmi_init(void) | |||
991 | return -ENODEV; | 988 | return -ENODEV; |
992 | 989 | ||
993 | result = acpi_bus_register_driver(&acpi_wmi_driver); | 990 | result = acpi_bus_register_driver(&acpi_wmi_driver); |
994 | |||
995 | if (result < 0) { | 991 | if (result < 0) { |
996 | printk(KERN_INFO PREFIX "Error loading mapper\n"); | 992 | pr_err("Error loading mapper\n"); |
997 | return -ENODEV; | 993 | return -ENODEV; |
998 | } | 994 | } |
999 | 995 | ||
@@ -1003,20 +999,18 @@ static int __init acpi_wmi_init(void) | |||
1003 | return result; | 999 | return result; |
1004 | } | 1000 | } |
1005 | 1001 | ||
1006 | printk(KERN_INFO PREFIX "Mapper loaded\n"); | 1002 | pr_info("Mapper loaded\n"); |
1007 | 1003 | ||
1008 | return result; | 1004 | return 0; |
1009 | } | 1005 | } |
1010 | 1006 | ||
1011 | static void __exit acpi_wmi_exit(void) | 1007 | static void __exit acpi_wmi_exit(void) |
1012 | { | 1008 | { |
1013 | wmi_class_exit(); | 1009 | wmi_class_exit(); |
1014 | |||
1015 | acpi_bus_unregister_driver(&acpi_wmi_driver); | 1010 | acpi_bus_unregister_driver(&acpi_wmi_driver); |
1016 | |||
1017 | free_wmi_blocks(); | 1011 | free_wmi_blocks(); |
1018 | 1012 | ||
1019 | printk(KERN_INFO PREFIX "Mapper unloaded\n"); | 1013 | pr_info("Mapper unloaded\n"); |
1020 | } | 1014 | } |
1021 | 1015 | ||
1022 | subsys_initcall(acpi_wmi_init); | 1016 | subsys_initcall(acpi_wmi_init); |