aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYongxin Liu <yongxin.liu@windriver.com>2019-11-27 16:46:58 +0800
committerBruce Ashfield <bruce.ashfield@gmail.com>2019-11-27 17:52:00 -0500
commit370ab92a1eaf673bae8766943cf6700c083bcaae (patch)
treeaf35718c72dcf9452bd673030e0cee9dfa734129
parent6b09519590f71fe49d1284dbf799d428a218d92d (diff)
downloadlinux-yocto-370ab92a1eaf673bae8766943cf6700c083bcaae.tar.gz
linux-yocto-370ab92a1eaf673bae8766943cf6700c083bcaae.tar.bz2
linux-yocto-370ab92a1eaf673bae8766943cf6700c083bcaae.zip
Revert "platform/x86: wmi: Destroy on cleanup rather than unregister"
This reverts commit 7b11e8989618581bc0226ad313264cdc05d48d86. 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: Yongxin Liu <yongxin.liu@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--drivers/platform/x86/wmi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 22f4b92c5da4..a719acac6031 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -1307,7 +1307,7 @@ static int acpi_wmi_remove(struct platform_device *device)
acpi_remove_address_space_handler(acpi_device->handle,
ACPI_ADR_SPACE_EC, &acpi_wmi_ec_space_handler);
wmi_free_devices(acpi_device);
- device_destroy(&wmi_bus_class, MKDEV(0, 0));
+ device_unregister((struct device *)dev_get_drvdata(&device->dev));
return 0;
}
@@ -1361,7 +1361,7 @@ static int acpi_wmi_probe(struct platform_device *device)
return 0;
err_remove_busdev:
- device_destroy(&wmi_bus_class, MKDEV(0, 0));
+ device_unregister(wmi_bus_dev);
err_remove_notify_handler:
acpi_remove_notify_handler(acpi_device->handle, ACPI_DEVICE_NOTIFY,