diff options
author | Armin Wolf <W_Armin@gmx.de> | 2023-12-18 22:24:16 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2023-12-19 18:32:46 +0300 |
commit | 22574e17626391ad969af9a13aaa58a1b37ad384 (patch) | |
tree | 0281198769e59428af0844dcf424872773527764 /drivers/platform/x86/wmi.c | |
parent | 41dd6822949ec6e83416a0e245f32a726110056a (diff) | |
download | linux-22574e17626391ad969af9a13aaa58a1b37ad384.tar.xz |
platform/x86: wmi: Remove ACPI handlers after WMI devices
When removing the ACPI notify/address space handlers, the WMI devices
are still active and might still depend on ACPI EC access or
WMI events.
Fix this by removing the ACPI handlers after all WMI devices
associated with an ACPI device have been removed.
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20231218192420.305411-3-W_Armin@gmx.de
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/wmi.c')
-rw-r--r-- | drivers/platform/x86/wmi.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 906d3a2831ae..2120c13e1676 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -1239,13 +1239,12 @@ static void acpi_wmi_remove(struct platform_device *device) struct acpi_device *acpi_device = ACPI_COMPANION(&device->dev); struct device *wmi_bus_device = dev_get_drvdata(&device->dev); - acpi_remove_notify_handler(acpi_device->handle, ACPI_ALL_NOTIFY, - acpi_wmi_notify_handler); - acpi_remove_address_space_handler(acpi_device->handle, - ACPI_ADR_SPACE_EC, &acpi_wmi_ec_space_handler); - device_for_each_child_reverse(wmi_bus_device, NULL, wmi_remove_device); device_unregister(wmi_bus_device); + + acpi_remove_notify_handler(acpi_device->handle, ACPI_ALL_NOTIFY, acpi_wmi_notify_handler); + acpi_remove_address_space_handler(acpi_device->handle, ACPI_ADR_SPACE_EC, + &acpi_wmi_ec_space_handler); } static int acpi_wmi_probe(struct platform_device *device) |