Skip to content

Commit 79a56f4

Browse files
Wer-Wolfjwrdegoede
authored andcommitted
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>
1 parent e04e2b7 commit 79a56f4

2 files changed

Lines changed: 0 additions & 58 deletions

File tree

drivers/platform/x86/wmi.c

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -199,23 +199,6 @@ static int wmidev_match_guid(struct device *dev, const void *data)
199199
return 0;
200200
}
201201

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-
219202
static const struct bus_type wmi_bus_type;
220203

221204
static struct wmi_device *wmi_find_device_by_guid(const char *guid_string)
@@ -235,17 +218,6 @@ static struct wmi_device *wmi_find_device_by_guid(const char *guid_string)
235218
return dev_to_wdev(dev);
236219
}
237220

238-
static struct wmi_device *wmi_find_event_by_notify_id(const u32 notify_id)
239-
{
240-
struct device *dev;
241-
242-
dev = bus_find_device(&wmi_bus_type, NULL, &notify_id, wmidev_match_notify_id);
243-
if (!dev)
244-
return ERR_PTR(-ENODEV);
245-
246-
return to_wmi_device(dev);
247-
}
248-
249221
static void wmi_device_put(struct wmi_device *wdev)
250222
{
251223
put_device(&wdev->dev);
@@ -649,35 +621,6 @@ acpi_status wmi_remove_notify_handler(const char *guid)
649621
}
650622
EXPORT_SYMBOL_GPL(wmi_remove_notify_handler);
651623

652-
/**
653-
* wmi_get_event_data - Get WMI data associated with an event (deprecated)
654-
*
655-
* @event: Event to find
656-
* @out: Buffer to hold event data
657-
*
658-
* Get extra data associated with an WMI event, the caller needs to free @out.
659-
*
660-
* Return: acpi_status signaling success or error.
661-
*/
662-
acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out)
663-
{
664-
struct wmi_block *wblock;
665-
struct wmi_device *wdev;
666-
acpi_status status;
667-
668-
wdev = wmi_find_event_by_notify_id(event);
669-
if (IS_ERR(wdev))
670-
return AE_NOT_FOUND;
671-
672-
wblock = container_of(wdev, struct wmi_block, dev);
673-
status = get_event_data(wblock, out);
674-
675-
wmi_device_put(wdev);
676-
677-
return status;
678-
}
679-
EXPORT_SYMBOL_GPL(wmi_get_event_data);
680-
681624
/**
682625
* wmi_has_guid - Check if a GUID is available
683626
* @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba

include/linux/acpi.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ extern acpi_status wmi_set_block(const char *guid, u8 instance,
401401
extern acpi_status wmi_install_notify_handler(const char *guid,
402402
wmi_notify_handler handler, void *data);
403403
extern acpi_status wmi_remove_notify_handler(const char *guid);
404-
extern acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out);
405404
extern bool wmi_has_guid(const char *guid);
406405
extern char *wmi_get_acpi_device_uid(const char *guid);
407406

0 commit comments

Comments
 (0)