public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ACPI: scan: Move acpi_scan_dep_init() higher up in scan.c
@ 2021-03-28 11:19 Hans de Goede
  2021-03-28 11:20 ` [PATCH 2/2] ACPI: scan: Fix _STA getting called on devices with unmet dependencies Hans de Goede
  2021-03-29 12:52 ` [PATCH 1/2] ACPI: scan: Move acpi_scan_dep_init() higher up in scan.c Rafael J. Wysocki
  0 siblings, 2 replies; 7+ messages in thread
From: Hans de Goede @ 2021-03-28 11:19 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown; +Cc: Hans de Goede, linux-acpi

Move acpi_scan_dep_init() higher up in scan.c to avoid needing a forward
declaration in the next patch in this set.

Fixes: 71da201f38df ("ACPI: scan: Defer enumeration of devices with _DEP lists")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/acpi/scan.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 1584c9e463bd..19f8fd6ea17a 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1655,6 +1655,20 @@ void acpi_device_add_finalize(struct acpi_device *device)
 	kobject_uevent(&device->dev.kobj, KOBJ_ADD);
 }
 
+static void acpi_scan_dep_init(struct acpi_device *adev)
+{
+	struct acpi_dep_data *dep;
+
+	mutex_lock(&acpi_dep_list_lock);
+
+	list_for_each_entry(dep, &acpi_dep_list, node) {
+		if (dep->consumer == adev->handle)
+			adev->dep_unmet++;
+	}
+
+	mutex_unlock(&acpi_dep_list_lock);
+}
+
 static int acpi_add_single_object(struct acpi_device **child,
 				  acpi_handle handle, int type,
 				  unsigned long long sta)
@@ -1906,20 +1920,6 @@ static u32 acpi_scan_check_dep(acpi_handle handle)
 	return count;
 }
 
-static void acpi_scan_dep_init(struct acpi_device *adev)
-{
-	struct acpi_dep_data *dep;
-
-	mutex_lock(&acpi_dep_list_lock);
-
-	list_for_each_entry(dep, &acpi_dep_list, node) {
-		if (dep->consumer == adev->handle)
-			adev->dep_unmet++;
-	}
-
-	mutex_unlock(&acpi_dep_list_lock);
-}
-
 static bool acpi_bus_scan_second_pass;
 
 static acpi_status acpi_bus_check_add(acpi_handle handle, bool check_dep,
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-29 14:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-28 11:19 [PATCH 1/2] ACPI: scan: Move acpi_scan_dep_init() higher up in scan.c Hans de Goede
2021-03-28 11:20 ` [PATCH 2/2] ACPI: scan: Fix _STA getting called on devices with unmet dependencies Hans de Goede
2021-03-29 13:39   ` Rafael J. Wysocki
2021-03-29 14:45     ` Hans de Goede
2021-03-29 14:56       ` Rafael J. Wysocki
2021-03-29 12:52 ` [PATCH 1/2] ACPI: scan: Move acpi_scan_dep_init() higher up in scan.c Rafael J. Wysocki
2021-03-29 14:29   ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox