ACPI: Unbind ACPI drv when probe failed
authorToshi Kani <toshi.kani@hp.com>
Thu, 7 Feb 2013 21:19:13 +0000 (21:19 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 13 Feb 2013 12:41:39 +0000 (13:41 +0100)
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>
drivers/acpi/scan.c

index 95547ef..bf6e2c2 100644 (file)
@@ -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;
                        }
                }