aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/platform/x86/wmi.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 004358140239..c6e11b573ef3 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -606,7 +606,8 @@ static struct class wmi_class = {
606}; 606};
607 607
608static int wmi_create_device(const struct guid_block *gblock, 608static int wmi_create_device(const struct guid_block *gblock,
609 struct wmi_block *wblock, acpi_handle handle) 609 struct wmi_block *wblock,
610 struct acpi_device *device)
610{ 611{
611 wblock->dev.class = &wmi_class; 612 wblock->dev.class = &wmi_class;
612 613
@@ -645,7 +646,7 @@ static bool guid_already_parsed(const char *guid_string)
645/* 646/*
646 * Parse the _WDG method for the GUID data blocks 647 * Parse the _WDG method for the GUID data blocks
647 */ 648 */
648static int parse_wdg(acpi_handle handle) 649static int parse_wdg(struct acpi_device *device)
649{ 650{
650 struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL}; 651 struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
651 union acpi_object *obj; 652 union acpi_object *obj;
@@ -655,7 +656,7 @@ static int parse_wdg(acpi_handle handle)
655 int retval; 656 int retval;
656 u32 i, total; 657 u32 i, total;
657 658
658 status = acpi_evaluate_object(handle, "_WDG", NULL, &out); 659 status = acpi_evaluate_object(device->handle, "_WDG", NULL, &out);
659 if (ACPI_FAILURE(status)) 660 if (ACPI_FAILURE(status))
660 return -ENXIO; 661 return -ENXIO;
661 662
@@ -679,7 +680,7 @@ static int parse_wdg(acpi_handle handle)
679 if (!wblock) 680 if (!wblock)
680 return -ENOMEM; 681 return -ENOMEM;
681 682
682 wblock->handle = handle; 683 wblock->handle = device->handle;
683 wblock->gblock = gblock[i]; 684 wblock->gblock = gblock[i];
684 685
685 /* 686 /*
@@ -689,7 +690,7 @@ static int parse_wdg(acpi_handle handle)
689 for device creation. 690 for device creation.
690 */ 691 */
691 if (!guid_already_parsed(gblock[i].guid)) { 692 if (!guid_already_parsed(gblock[i].guid)) {
692 retval = wmi_create_device(&gblock[i], wblock, handle); 693 retval = wmi_create_device(&gblock[i], wblock, device);
693 if (retval) { 694 if (retval) {
694 wmi_free_devices(); 695 wmi_free_devices();
695 goto out_free_pointer; 696 goto out_free_pointer;
@@ -806,7 +807,7 @@ static int acpi_wmi_add(struct acpi_device *device)
806 return -ENODEV; 807 return -ENODEV;
807 } 808 }
808 809
809 error = parse_wdg(device->handle); 810 error = parse_wdg(device);
810 if (error) { 811 if (error) {
811 acpi_remove_address_space_handler(device->handle, 812 acpi_remove_address_space_handler(device->handle,
812 ACPI_ADR_SPACE_EC, 813 ACPI_ADR_SPACE_EC,