Commit 7f5809bf authored by Andy Lutomirski's avatar Andy Lutomirski Committed by Darren Hart (VMware)

platform/x86: wmi: Pass the acpi_device through to parse_wdg

We will need the device to convert to a bus architecture and bind WMI to
the platform device.
Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Mario Limonciello <mario_limonciello@dell.com>
Cc: Pali Rohár <pali.rohar@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-acpi@vger.kernel.org
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
parent 0f97ebd1
...@@ -606,7 +606,8 @@ static struct class wmi_class = { ...@@ -606,7 +606,8 @@ static struct class wmi_class = {
}; };
static int wmi_create_device(const struct guid_block *gblock, 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; wblock->dev.class = &wmi_class;
...@@ -645,7 +646,7 @@ static bool guid_already_parsed(const char *guid_string) ...@@ -645,7 +646,7 @@ static bool guid_already_parsed(const char *guid_string)
/* /*
* Parse the _WDG method for the GUID data blocks * 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}; struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
union acpi_object *obj; union acpi_object *obj;
...@@ -655,7 +656,7 @@ static int parse_wdg(acpi_handle handle) ...@@ -655,7 +656,7 @@ static int parse_wdg(acpi_handle handle)
int retval; int retval;
u32 i, total; u32 i, total;
status = acpi_evaluate_object(handle, "_WDG", NULL, &out); status = acpi_evaluate_object(device->handle, "_WDG", NULL, &out);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return -ENXIO; return -ENXIO;
...@@ -679,7 +680,7 @@ static int parse_wdg(acpi_handle handle) ...@@ -679,7 +680,7 @@ static int parse_wdg(acpi_handle handle)
if (!wblock) if (!wblock)
return -ENOMEM; return -ENOMEM;
wblock->handle = handle; wblock->handle = device->handle;
wblock->gblock = gblock[i]; wblock->gblock = gblock[i];
/* /*
...@@ -689,7 +690,7 @@ static int parse_wdg(acpi_handle handle) ...@@ -689,7 +690,7 @@ static int parse_wdg(acpi_handle handle)
for device creation. for device creation.
*/ */
if (!guid_already_parsed(gblock[i].guid)) { 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) { if (retval) {
wmi_free_devices(); wmi_free_devices();
goto out_free_pointer; goto out_free_pointer;
...@@ -806,7 +807,7 @@ static int acpi_wmi_add(struct acpi_device *device) ...@@ -806,7 +807,7 @@ static int acpi_wmi_add(struct acpi_device *device)
return -ENODEV; return -ENODEV;
} }
error = parse_wdg(device->handle); error = parse_wdg(device);
if (error) { if (error) {
acpi_remove_address_space_handler(device->handle, acpi_remove_address_space_handler(device->handle,
ACPI_ADR_SPACE_EC, ACPI_ADR_SPACE_EC,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment