Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86: wmi: Remove wmi_get_event_data()

Since the WMI driver core now takes care of retrieving the
WMI event data even for legacy WMI notify handlers, this
function is no longer used.

Remove it to prevent WMI drivers from messing up the ACPI
firmware on some machines.

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-4-W_Armin@gmx.de
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Armin Wolf and committed by
Hans de Goede
79a56f4c e04e2b76

-58
-57
drivers/platform/x86/wmi.c
··· 199 199 return 0; 200 200 } 201 201 202 - static int wmidev_match_notify_id(struct device *dev, const void *data) 203 - { 204 - struct wmi_block *wblock = dev_to_wblock(dev); 205 - const u32 *notify_id = data; 206 - 207 - /* Legacy GUID-based functions are restricted to only see 208 - * a single WMI device for each GUID. 209 - */ 210 - if (test_bit(WMI_GUID_DUPLICATED, &wblock->flags)) 211 - return 0; 212 - 213 - if (wblock->gblock.flags & ACPI_WMI_EVENT && wblock->gblock.notify_id == *notify_id) 214 - return 1; 215 - 216 - return 0; 217 - } 218 - 219 202 static const struct bus_type wmi_bus_type; 220 203 221 204 static struct wmi_device *wmi_find_device_by_guid(const char *guid_string) ··· 216 233 return ERR_PTR(-ENODEV); 217 234 218 235 return dev_to_wdev(dev); 219 - } 220 - 221 - static struct wmi_device *wmi_find_event_by_notify_id(const u32 notify_id) 222 - { 223 - struct device *dev; 224 - 225 - dev = bus_find_device(&wmi_bus_type, NULL, &notify_id, wmidev_match_notify_id); 226 - if (!dev) 227 - return ERR_PTR(-ENODEV); 228 - 229 - return to_wmi_device(dev); 230 236 } 231 237 232 238 static void wmi_device_put(struct wmi_device *wdev) ··· 620 648 return status; 621 649 } 622 650 EXPORT_SYMBOL_GPL(wmi_remove_notify_handler); 623 - 624 - /** 625 - * wmi_get_event_data - Get WMI data associated with an event (deprecated) 626 - * 627 - * @event: Event to find 628 - * @out: Buffer to hold event data 629 - * 630 - * Get extra data associated with an WMI event, the caller needs to free @out. 631 - * 632 - * Return: acpi_status signaling success or error. 633 - */ 634 - acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out) 635 - { 636 - struct wmi_block *wblock; 637 - struct wmi_device *wdev; 638 - acpi_status status; 639 - 640 - wdev = wmi_find_event_by_notify_id(event); 641 - if (IS_ERR(wdev)) 642 - return AE_NOT_FOUND; 643 - 644 - wblock = container_of(wdev, struct wmi_block, dev); 645 - status = get_event_data(wblock, out); 646 - 647 - wmi_device_put(wdev); 648 - 649 - return status; 650 - } 651 - EXPORT_SYMBOL_GPL(wmi_get_event_data); 652 651 653 652 /** 654 653 * wmi_has_guid - Check if a GUID is available
-1
include/linux/acpi.h
··· 401 401 extern acpi_status wmi_install_notify_handler(const char *guid, 402 402 wmi_notify_handler handler, void *data); 403 403 extern acpi_status wmi_remove_notify_handler(const char *guid); 404 - extern acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out); 405 404 extern bool wmi_has_guid(const char *guid); 406 405 extern char *wmi_get_acpi_device_uid(const char *guid); 407 406