[PATCH 29/30] bus: acpi: register bus even if without ACPI EFI table

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Nov 22 00:47:31 PST 2021


The ACPI bus must be registered if there are ACPI drivers compiled in.
Thus the ACPI bus registration must be decoupled from the existence of
the ACPI table.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/bus/acpi.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/bus/acpi.c b/drivers/bus/acpi.c
index efba3f4c1671..54c60856570d 100644
--- a/drivers/bus/acpi.c
+++ b/drivers/bus/acpi.c
@@ -223,6 +223,7 @@ static void acpi_bus_remove(struct device_d *dev)
 }
 
 struct bus_type acpi_bus = {
+	.name = "acpi",
 	.match = acpi_bus_match,
 	.probe = acpi_bus_probe,
 	.remove = acpi_bus_remove,
@@ -240,17 +241,17 @@ static int efi_acpi_probe(void)
 			acpi_bus.name = "acpi2";
 			table = ect;
 		} else if (!table && !efi_guidcmp(ect->guid, EFI_ACPI_TABLE_GUID)) {
-			acpi_bus.name = "acpi";
+			acpi_bus.name = "acpi1";
 			table = ect;
 		}
 	}
 
+	bus_register(&acpi_bus);
+
 	if (!table)
 		return 0;
 
-	bus_register(&acpi_bus);
 	acpi_bus.dev->priv = table;
-
 	return acpi_register_devices(&acpi_bus);
 }
 postcore_initcall(efi_acpi_probe);
-- 
2.30.2




More information about the barebox mailing list