Skip to content

Commit

Permalink
ACPI: Unbind ACPI drv when probe failed
Browse files Browse the repository at this point in the history
When acpi_device_install_notify_handler() failed in acpi_device_probe(),
it calls acpi_drv->ops.remove() and fails the probe.  However, the ACPI
driver is left bound to the acpi_device.  Fix it by clearing the driver
and driver_data fields.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Toshi Kani authored and Rafael J. Wysocki committed Feb 13, 2013
1 parent ce7685a commit 5f27ee8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,8 @@ static int acpi_device_probe(struct device * dev)
if (ret) {
if (acpi_drv->ops.remove)
acpi_drv->ops.remove(acpi_dev);
acpi_dev->driver = NULL;
acpi_dev->driver_data = NULL;
return ret;
}
}
Expand Down

0 comments on commit 5f27ee8

Please sign in to comment.