Skip to content

Commit 56afb8d

Browse files
liux2085jwrdegoede
authored andcommitted
Revert "platform/x86: wmi: Destroy on cleanup rather than unregister"
This reverts commit 7b11e89. 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
1 parent 411269b commit 56afb8d

File tree

1 file changed

+2
-2
lines changed
  • drivers/platform/x86

1 file changed

+2
-2
lines changed

drivers/platform/x86/wmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ static int acpi_wmi_remove(struct platform_device *device)
13471347
acpi_remove_address_space_handler(acpi_device->handle,
13481348
ACPI_ADR_SPACE_EC, &acpi_wmi_ec_space_handler);
13491349
wmi_free_devices(acpi_device);
1350-
device_destroy(&wmi_bus_class, MKDEV(0, 0));
1350+
device_unregister((struct device *)dev_get_drvdata(&device->dev));
13511351

13521352
return 0;
13531353
}
@@ -1401,7 +1401,7 @@ static int acpi_wmi_probe(struct platform_device *device)
14011401
return 0;
14021402

14031403
err_remove_busdev:
1404-
device_destroy(&wmi_bus_class, MKDEV(0, 0));
1404+
device_unregister(wmi_bus_dev);
14051405

14061406
err_remove_notify_handler:
14071407
acpi_remove_notify_handler(acpi_device->handle, ACPI_DEVICE_NOTIFY,

0 commit comments

Comments
 (0)