Commit 56afb8d4 authored by Yongxin Liu's avatar Yongxin Liu Committed by Hans de Goede

Revert "platform/x86: wmi: Destroy on cleanup rather than unregister"

This reverts commit 7b11e898.

Consider the following hardware setting.

|-PNP0C14:00
|  |-- device #1
|-PNP0C14:01
|  |-- device #2

When unloading wmi driver module, device #2 will be first unregistered.
But device_destroy() using MKDEV(0, 0) will locate PNP0C14:00 first
and unregister it. This is incorrect. Should use device_unregister() to
unregister the real parent device.
Signed-off-by: default avatarYongxin Liu <yongxin.liu@windriver.com>
Link: https://lore.kernel.org/r/20191115052710.46880-1-yongxin.liu@windriver.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 411269ba
...@@ -1347,7 +1347,7 @@ static int acpi_wmi_remove(struct platform_device *device) ...@@ -1347,7 +1347,7 @@ static int acpi_wmi_remove(struct platform_device *device)
acpi_remove_address_space_handler(acpi_device->handle, acpi_remove_address_space_handler(acpi_device->handle,
ACPI_ADR_SPACE_EC, &acpi_wmi_ec_space_handler); ACPI_ADR_SPACE_EC, &acpi_wmi_ec_space_handler);
wmi_free_devices(acpi_device); wmi_free_devices(acpi_device);
device_destroy(&wmi_bus_class, MKDEV(0, 0)); device_unregister((struct device *)dev_get_drvdata(&device->dev));
return 0; return 0;
} }
...@@ -1401,7 +1401,7 @@ static int acpi_wmi_probe(struct platform_device *device) ...@@ -1401,7 +1401,7 @@ static int acpi_wmi_probe(struct platform_device *device)
return 0; return 0;
err_remove_busdev: err_remove_busdev:
device_destroy(&wmi_bus_class, MKDEV(0, 0)); device_unregister(wmi_bus_dev);
err_remove_notify_handler: err_remove_notify_handler:
acpi_remove_notify_handler(acpi_device->handle, ACPI_DEVICE_NOTIFY, acpi_remove_notify_handler(acpi_device->handle, ACPI_DEVICE_NOTIFY,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment