Skip to content

Commit

Permalink
platform/x86: wmi: Pass the acpi_device through to parse_wdg
Browse files Browse the repository at this point in the history
We will need the device to convert to a bus architecture and bind WMI to
the platform device.

Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Mario Limonciello <[email protected]>
Cc: Pali Rohár <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Darren Hart (VMware) <[email protected]>
  • Loading branch information
amluto authored and dvhart committed Jun 6, 2017
1 parent 0f97ebd commit 7f5809b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drivers/platform/x86/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,8 @@ static struct class wmi_class = {
};

static int wmi_create_device(const struct guid_block *gblock,
struct wmi_block *wblock, acpi_handle handle)
struct wmi_block *wblock,
struct acpi_device *device)
{
wblock->dev.class = &wmi_class;

Expand Down Expand Up @@ -645,7 +646,7 @@ static bool guid_already_parsed(const char *guid_string)
/*
* Parse the _WDG method for the GUID data blocks
*/
static int parse_wdg(acpi_handle handle)
static int parse_wdg(struct acpi_device *device)
{
struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
union acpi_object *obj;
Expand All @@ -655,7 +656,7 @@ static int parse_wdg(acpi_handle handle)
int retval;
u32 i, total;

status = acpi_evaluate_object(handle, "_WDG", NULL, &out);
status = acpi_evaluate_object(device->handle, "_WDG", NULL, &out);
if (ACPI_FAILURE(status))
return -ENXIO;

Expand All @@ -679,7 +680,7 @@ static int parse_wdg(acpi_handle handle)
if (!wblock)
return -ENOMEM;

wblock->handle = handle;
wblock->handle = device->handle;
wblock->gblock = gblock[i];

/*
Expand All @@ -689,7 +690,7 @@ static int parse_wdg(acpi_handle handle)
for device creation.
*/
if (!guid_already_parsed(gblock[i].guid)) {
retval = wmi_create_device(&gblock[i], wblock, handle);
retval = wmi_create_device(&gblock[i], wblock, device);
if (retval) {
wmi_free_devices();
goto out_free_pointer;
Expand Down Expand Up @@ -806,7 +807,7 @@ static int acpi_wmi_add(struct acpi_device *device)
return -ENODEV;
}

error = parse_wdg(device->handle);
error = parse_wdg(device);
if (error) {
acpi_remove_address_space_handler(device->handle,
ACPI_ADR_SPACE_EC,
Expand Down

0 comments on commit 7f5809b

Please sign in to comment.