Skip to content

Commit

Permalink
platform/x86: wmi: Destroy on cleanup rather than unregister
Browse files Browse the repository at this point in the history
device_create documentation says to cleanup using device_destroy

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
  • Loading branch information
Mario Limonciello authored and dvhart committed Sep 27, 2017
1 parent 303d1fc commit 7b11e89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/platform/x86/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,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_unregister((struct device *)dev_get_drvdata(&device->dev));
device_destroy(&wmi_bus_class, MKDEV(0, 0));

return 0;
}
Expand Down Expand Up @@ -1199,7 +1199,7 @@ static int acpi_wmi_probe(struct platform_device *device)
return 0;

err_remove_busdev:
device_unregister(wmi_bus_dev);
device_destroy(&wmi_bus_class, MKDEV(0, 0));

err_remove_notify_handler:
acpi_remove_notify_handler(acpi_device->handle, ACPI_DEVICE_NOTIFY,
Expand Down

0 comments on commit 7b11e89

Please sign in to comment.