linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PNP / ACPI: Use ACPI_COMPANION_SET() during initialization
@ 2015-03-13  0:45 Rafael J. Wysocki
  2015-03-13 15:34 ` Mika Westerberg
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2015-03-13  0:45 UTC (permalink / raw)
  To: ACPI Devel Maling List
  Cc: Linux Kernel Mailing List, Bjorn Helgaas, Mika Westerberg

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

pnpacpi_add_device() calls acpi_bind_one() on an already registered
device, which is a mistake, but it can initialize the ACPI companion
field of the struct device to be registered using ACPI_COMPANION_SET()
instead, so make it do that.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/pnp/pnpacpi/core.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Index: linux-pm/drivers/pnp/pnpacpi/core.c
===================================================================
--- linux-pm.orig/drivers/pnp/pnpacpi/core.c
+++ linux-pm/drivers/pnp/pnpacpi/core.c
@@ -248,6 +248,7 @@ static int __init pnpacpi_add_device(str
 	if (!dev)
 		return -ENOMEM;
 
+	ACPI_COMPANION_SET(&dev->dev, device);
 	dev->data = device;
 	/* .enabled means the device can decode the resources */
 	dev->active = device->status.enabled;
@@ -290,11 +291,9 @@ static int __init pnpacpi_add_device(str
 		return error;
 	}
 
-	error = acpi_bind_one(&dev->dev, device);
-
 	num++;
 
-	return error;
+	return 0;
 }
 
 static acpi_status __init pnpacpi_add_device_handler(acpi_handle handle,


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] PNP / ACPI: Use ACPI_COMPANION_SET() during initialization
  2015-03-13  0:45 [PATCH] PNP / ACPI: Use ACPI_COMPANION_SET() during initialization Rafael J. Wysocki
@ 2015-03-13 15:34 ` Mika Westerberg
  0 siblings, 0 replies; 2+ messages in thread
From: Mika Westerberg @ 2015-03-13 15:34 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: ACPI Devel Maling List, Linux Kernel Mailing List, Bjorn Helgaas

On Fri, Mar 13, 2015 at 01:45:49AM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> pnpacpi_add_device() calls acpi_bind_one() on an already registered
> device, which is a mistake, but it can initialize the ACPI companion
> field of the struct device to be registered using ACPI_COMPANION_SET()
> instead, so make it do that.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Makes sense.

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-13 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-13  0:45 [PATCH] PNP / ACPI: Use ACPI_COMPANION_SET() during initialization Rafael J. Wysocki
2015-03-13 15:34 ` Mika Westerberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).