summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
authorToshi Kani <toshi.kani@hp.com>2013-02-07 22:19:13 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-02-13 13:41:39 +0100
commit5f27ee8e1261e47ec2e9dbebf17e87e55f568d75 (patch)
tree8f58246c89ff53769b9c2daa4a6c2d61524da6f7 /drivers/acpi/scan.c
parentACPI: sysfs eject support for ACPI scan handlers (diff)
downloadlinux-5f27ee8e1261e47ec2e9dbebf17e87e55f568d75.tar.xz
linux-5f27ee8e1261e47ec2e9dbebf17e87e55f568d75.zip
ACPI: Unbind ACPI drv when probe failed
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>
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r--drivers/acpi/scan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 95547efcffe0..bf6e2c26f52d 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -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;
}
}