diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-03-12 20:45:49 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-03-16 10:19:07 -0400 |
commit | 2eb1eb02dda368fb224bf5a379d2448c742b71db (patch) | |
tree | b0833f765d39fbea7265d11f93acf4fc9e237b02 /drivers/pnp | |
parent | 06e5801b8cb3fc057d88cb4dc03c0b64b2744cda (diff) |
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 <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/pnp')
-rw-r--r-- | drivers/pnp/pnpacpi/core.c | 5 |
1 files changed, 2 insertions, 3 deletions
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) | |||
248 | if (!dev) | 248 | if (!dev) |
249 | return -ENOMEM; | 249 | return -ENOMEM; |
250 | 250 | ||
251 | ACPI_COMPANION_SET(&dev->dev, device); | ||
251 | dev->data = device; | 252 | dev->data = device; |
252 | /* .enabled means the device can decode the resources */ | 253 | /* .enabled means the device can decode the resources */ |
253 | dev->active = device->status.enabled; | 254 | dev->active = device->status.enabled; |
@@ -290,11 +291,9 @@ static int __init pnpacpi_add_device(struct acpi_device *device) | |||
290 | return error; | 291 | return error; |
291 | } | 292 | } |
292 | 293 | ||
293 | error = acpi_bind_one(&dev->dev, device); | ||
294 | |||
295 | num++; | 294 | num++; |
296 | 295 | ||
297 | return error; | 296 | return 0; |
298 | } | 297 | } |
299 | 298 | ||
300 | static acpi_status __init pnpacpi_add_device_handler(acpi_handle handle, | 299 | static acpi_status __init pnpacpi_add_device_handler(acpi_handle handle, |