Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -3
+2 -3
drivers/pnp/pnpacpi/core.c
··· 248 248 if (!dev) 249 249 return -ENOMEM; 250 250 251 + ACPI_COMPANION_SET(&dev->dev, device); 251 252 dev->data = device; 252 253 /* .enabled means the device can decode the resources */ 253 254 dev->active = device->status.enabled; ··· 291 290 return error; 292 291 } 293 292 294 - error = acpi_bind_one(&dev->dev, device); 295 - 296 293 num++; 297 294 298 - return error; 295 + return 0; 299 296 } 300 297 301 298 static acpi_status __init pnpacpi_add_device_handler(acpi_handle handle,