diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-08-10 18:17:23 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-08-23 18:19:27 +0200 |
commit | 6e1850b2f3747942d3813a2fde82f1e46aa593d1 (patch) | |
tree | 353f946a3b6144e78fbd0ccbf019d9895816d43e /drivers/acpi/power.c | |
parent | ACPI: scan: Rearrange initialization of ACPI device objects (diff) | |
download | linux-6e1850b2f3747942d3813a2fde82f1e46aa593d1.tar.xz linux-6e1850b2f3747942d3813a2fde82f1e46aa593d1.zip |
ACPI: scan: Eliminate __acpi_device_add()
Instead of having acpi_device_add() defined as a wrapper around
__acpi_device_add(), export acpi_tie_acpi_dev() so it can be called
directly by acpi_add_power_resource(), fold acpi_device_add() into the
latter and rename __acpi_device_add() to acpi_device_add().
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Punit Agrawal <punit.agrawal@bytedance.com>
Diffstat (limited to 'drivers/acpi/power.c')
-rw-r--r-- | drivers/acpi/power.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 2ae48ab88396..f2588aba8421 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -952,6 +952,7 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle) strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_POWER_CLASS); device->power.state = ACPI_STATE_UNKNOWN; + device->flags.match_driver = true; /* Evaluate the object to get the system level and resource order. */ status = acpi_evaluate_object(handle, NULL, NULL, &buffer); @@ -968,7 +969,10 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle) pr_info("%s [%s]\n", acpi_device_name(device), acpi_device_bid(device)); - device->flags.match_driver = true; + result = acpi_tie_acpi_dev(device); + if (result) + goto err; + result = acpi_device_add(device); if (result) goto err; |