From 2eb1eb02dda368fb224bf5a379d2448c742b71db Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 13 Mar 2015 01:45:49 +0100 Subject: PNP / ACPI: Use ACPI_COMPANION_SET() during initialization 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 Reviewed-by: Mika Westerberg --- drivers/pnp/pnpacpi/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/pnp') diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index d2b780aade89..5153d1d69aee 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c @@ -248,6 +248,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device) 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(struct acpi_device *device) 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, -- cgit v1.2.3-59-g8ed1b