diff mbox series

[28/40] x86: Move device-specific ACPI tables to a writer function

Message ID 20211201160315.2203099-29-sjg@chromium.org
State Accepted
Commit a7e53b93b1ca4de745ab5fbdd3db2bd7888adb0f
Delegated to: Tom Rini
Headers show
Series RFC: rpi: Enable ACPI booting on ARM with Raspberry Pi 4 | expand

Commit Message

Simon Glass Dec. 1, 2021, 4:03 p.m. UTC
Move this over to use a writer function, moving the code from the x86
implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/x86/lib/acpi_table.c |  2 --
 lib/acpi/acpi_writer.c    | 12 ++++++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

Comments

Simon Glass Jan. 23, 2022, 9:53 p.m. UTC | #1
Move this over to use a writer function, moving the code from the x86
implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/x86/lib/acpi_table.c |  2 --
 lib/acpi/acpi_writer.c    | 12 ++++++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c
index b7557f7f3fd..8275c36ad31 100644
--- a/arch/x86/lib/acpi_table.c
+++ b/arch/x86/lib/acpi_table.c
@@ -519,8 +519,6 @@  ACPI_WRITER(5mcfg, "MCFG", acpi_write_mcfg, 0);
 int write_acpi_tables_x86(struct acpi_ctx *ctx,
 			  const struct acpi_writer *entry)
 {
-	acpi_write_dev_tables(ctx);
-
 	acpi_rsdp_addr = (unsigned long)ctx->rsdp;
 	debug("ACPI: done\n");
 
diff --git a/lib/acpi/acpi_writer.c b/lib/acpi/acpi_writer.c
index d2505e6eaa4..59f951cba45 100644
--- a/lib/acpi/acpi_writer.c
+++ b/lib/acpi/acpi_writer.c
@@ -90,6 +90,18 @@  ulong write_acpi_tables(ulong start_addr)
 
 	return addr;
 }
+
+int write_dev_tables(struct acpi_ctx *ctx, const struct acpi_writer *entry)
+{
+	int ret;
+
+	ret = acpi_write_dev_tables(ctx);
+	if (ret)
+		return log_msg_ret("write", ret);
+
+	return 0;
+}
+ACPI_WRITER(8dev, NULL, write_dev_tables, 0);
 #endif /* QEMU */
 
 void acpi_setup_ctx(struct acpi_ctx *ctx, ulong start)