aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
authorRafael J. Wysocki2022-08-10 18:17:23 +0200
committerRafael J. Wysocki2022-08-23 18:19:27 +0200
commit6e1850b2f3747942d3813a2fde82f1e46aa593d1 (patch)
tree353f946a3b6144e78fbd0ccbf019d9895816d43e /drivers/acpi/scan.c
parent5c5e1237032aaa39107e2d0bb8e6cb84b3c41161 (diff)
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/scan.c')
-rw-r--r--drivers/acpi/scan.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 75a32f2d0f33..0d9c350608bf 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -643,7 +643,7 @@ static int acpi_device_set_name(struct acpi_device *device,
return 0;
}
-static int acpi_tie_acpi_dev(struct acpi_device *adev)
+int acpi_tie_acpi_dev(struct acpi_device *adev)
{
acpi_handle handle = adev->handle;
acpi_status status;
@@ -673,7 +673,7 @@ static void acpi_store_pld_crc(struct acpi_device *adev)
ACPI_FREE(pld);
}
-static int __acpi_device_add(struct acpi_device *device)
+int acpi_device_add(struct acpi_device *device)
{
struct acpi_device_bus_id *acpi_device_bus_id;
int result;
@@ -755,17 +755,6 @@ err_unlock:
return result;
}
-int acpi_device_add(struct acpi_device *adev)
-{
- int ret;
-
- ret = acpi_tie_acpi_dev(adev);
- if (ret)
- return ret;
-
- return __acpi_device_add(adev);
-}
-
/* --------------------------------------------------------------------------
Device Enumeration
-------------------------------------------------------------------------- */
@@ -1867,7 +1856,7 @@ static int acpi_add_single_object(struct acpi_device **child,
mutex_unlock(&acpi_dep_list_lock);
if (!result)
- result = __acpi_device_add(device);
+ result = acpi_device_add(device);
if (result) {
acpi_device_release(&device->dev);