aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/toshiba-wmi.c
diff options
context:
space:
mode:
authorArmin Wolf <W_Armin@gmx.de>2024-09-01 05:10:52 +0200
committerHans de Goede <hdegoede@redhat.com>2024-09-05 17:21:59 +0200
commite04e2b760ddbe3d7b283a05898c3a029085cd8cd (patch)
treea117f11681ed87f6aad05a70e3570283c3d9edf5 /drivers/platform/x86/toshiba-wmi.c
parentMerge tag 'hwmon-for-v6.11-rc7' into review-hans (diff)
downloadlinux-e04e2b760ddbe3d7b283a05898c3a029085cd8cd.tar.gz
linux-e04e2b760ddbe3d7b283a05898c3a029085cd8cd.zip
platform/x86: wmi: Pass event data directly to legacy notify handlers
The current legacy WMI handlers are susceptible to picking up wrong WMI event data on systems where different WMI devices share some notification IDs. Prevent this by letting the WMI driver core taking care of retrieving the event data. This also simplifies the legacy WMI handlers and their implementation inside the WMI driver core. Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/20240901031055.3030-3-W_Armin@gmx.de Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/toshiba-wmi.c')
-rw-r--r--drivers/platform/x86/toshiba-wmi.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/platform/x86/toshiba-wmi.c b/drivers/platform/x86/toshiba-wmi.c
index 77c35529ab6f..12c46455e8dc 100644
--- a/drivers/platform/x86/toshiba-wmi.c
+++ b/drivers/platform/x86/toshiba-wmi.c
@@ -32,26 +32,13 @@ static const struct key_entry toshiba_wmi_keymap[] __initconst = {
{ KE_END, 0 }
};
-static void toshiba_wmi_notify(u32 value, void *context)
+static void toshiba_wmi_notify(union acpi_object *obj, void *context)
{
- struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
- union acpi_object *obj;
- acpi_status status;
-
- status = wmi_get_event_data(value, &response);
- if (ACPI_FAILURE(status)) {
- pr_err("Bad event status 0x%x\n", status);
- return;
- }
-
- obj = (union acpi_object *)response.pointer;
if (!obj)
return;
/* TODO: Add proper checks once we have data */
pr_debug("Unknown event received, obj type %x\n", obj->type);
-
- kfree(response.pointer);
}
static const struct dmi_system_id toshiba_wmi_dmi_table[] __initconst = {