* [PATCH] ACPI: Unbind ACPI drv when probe failed
@ 2013-02-07 21:19 Toshi Kani
2013-02-07 22:18 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Toshi Kani @ 2013-02-07 21:19 UTC (permalink / raw)
To: rjw, linux-acpi; +Cc: linux-kernel, isimatu.yasuaki, Toshi Kani
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>
---
This patch is based on linux-pm.git/bleeding-edge.
---
drivers/acpi/scan.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index d6caf1d..39659bb 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;
}
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI: Unbind ACPI drv when probe failed
2013-02-07 22:18 ` Rafael J. Wysocki
@ 2013-02-07 22:12 ` Toshi Kani
0 siblings, 0 replies; 3+ messages in thread
From: Toshi Kani @ 2013-02-07 22:12 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: linux-acpi, linux-kernel, isimatu.yasuaki
On Thu, 2013-02-07 at 23:18 +0100, Rafael J. Wysocki wrote:
> On Thursday, February 07, 2013 02:19:13 PM Toshi Kani wrote:
> > 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>
> > ---
> > This patch is based on linux-pm.git/bleeding-edge.
>
> Good catch, thanks. I'm going to apply it.
Great! Thanks,
-Toshi
>
> Rafael
>
>
> > ---
> > drivers/acpi/scan.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> > index d6caf1d..39659bb 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;
> > }
> > }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI: Unbind ACPI drv when probe failed
2013-02-07 21:19 [PATCH] ACPI: Unbind ACPI drv when probe failed Toshi Kani
@ 2013-02-07 22:18 ` Rafael J. Wysocki
2013-02-07 22:12 ` Toshi Kani
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2013-02-07 22:18 UTC (permalink / raw)
To: Toshi Kani; +Cc: linux-acpi, linux-kernel, isimatu.yasuaki
On Thursday, February 07, 2013 02:19:13 PM Toshi Kani wrote:
> 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>
> ---
> This patch is based on linux-pm.git/bleeding-edge.
Good catch, thanks. I'm going to apply it.
Rafael
> ---
> drivers/acpi/scan.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index d6caf1d..39659bb 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;
> }
> }
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-02-07 22:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-07 21:19 [PATCH] ACPI: Unbind ACPI drv when probe failed Toshi Kani
2013-02-07 22:18 ` Rafael J. Wysocki
2013-02-07 22:12 ` Toshi Kani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome