From 6e1850b2f3747942d3813a2fde82f1e46aa593d1 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Wed, 10 Aug 2022 18:17:23 +0200 Subject: 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 Reviewed-by: Punit Agrawal --- drivers/acpi/power.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/acpi/power.c') 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; -- cgit v1.2.3