diff options
| author | Hans de Goede <[email protected]> | 2021-11-28 19:00:29 +0000 |
|---|---|---|
| committer | Hans de Goede <[email protected]> | 2021-12-06 21:33:39 +0000 |
| commit | 8c33915d77a565b8b5d44e6368e22b6ea300b7a8 (patch) | |
| tree | 2573addfe6b8bf1ae11d85cdb447c127fbc82468 /drivers/platform/x86/wmi.c | |
| parent | platform/x86: wmi: Fix driver->notify() vs ->probe() race (diff) | |
| download | kernel-8c33915d77a565b8b5d44e6368e22b6ea300b7a8.tar.gz kernel-8c33915d77a565b8b5d44e6368e22b6ea300b7a8.zip | |
platform/x86: wmi: Add no_notify_data flag to struct wmi_driver
Some WMI implementations do notifies on WMI objects without a _WED method
allow WMI drivers to indicate that _WED should not be called for notifies
on the WMI objects the driver is bound to.
Instead the driver's notify callback will simply be called with a NULL
data argument.
Reported-by: Yauhen Kharuzhy <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/platform/x86/wmi.c')
| -rw-r--r-- | drivers/platform/x86/wmi.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 02aba274c4bc..58a23a9adbef 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -1331,10 +1331,12 @@ static void acpi_wmi_notify_handler(acpi_handle handle, u32 event, struct acpi_buffer evdata = { ACPI_ALLOCATE_BUFFER, NULL }; acpi_status status; - status = get_event_data(wblock, &evdata); - if (ACPI_FAILURE(status)) { - dev_warn(&wblock->dev.dev, "failed to get event data\n"); - return; + if (!driver->no_notify_data) { + status = get_event_data(wblock, &evdata); + if (ACPI_FAILURE(status)) { + dev_warn(&wblock->dev.dev, "failed to get event data\n"); + return; + } } if (driver->notify) |
