ACPI: Unbind ACPI drv when probe failed
PATCH 1/1 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.
---
This patch is based on linux-pm.git/bleeding-edge.
--- drivers/acpi/scan.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/acpi/scan.c +2 -0
@@ -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; } }
Quoted 8 lines · Toshi Kani
When
acpi_device_install_notify_handler()failed inacpi_device_probe(), it callsacpi_drv->ops.remove()and fails the probe. However, the ACPI driver is left bound to theacpi_device. Fix it by clearing the driver anddriver_datafields.Signed-off-by Toshi Kani <[email protected]>---
This patch is based on linux-pm.git/bleeding-edge.
Good catch, thanks. I'm going to apply it.
Rafael
Quoted 17 lines
--- drivers/acpi/scan.c | 2 ++ 1 file changed, 2 insertions(+)drivers/acpi/scan.c +2
-0@@ -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; } }
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
Quoted 11 lines · Rafael J. Wysocki
Quoted 8 lines · Toshi Kani
When
acpi_device_install_notify_handler()failed inacpi_device_probe(), it callsacpi_drv->ops.remove()and fails the probe. However, the ACPI driver is left bound to theacpi_device. Fix it by clearing the driver anddriver_datafields.Signed-off-by Toshi Kani <[email protected]>---
This patch is based on linux-pm.git/bleeding-edge.Good catch, thanks. I'm going to apply it.
Great! Thanks,
-Toshi
Quoted 21 lines
Rafael
Quoted 17 lines
--- drivers/acpi/scan.c | 2 ++ 1 file changed, 2 insertions(+)drivers/acpi/scan.c +2
-0@@ -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; } }