qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 09/13] acpi: Use PCMachineState::acpi_dev to get ACP


From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH 09/13] acpi: Use PCMachineState::acpi_dev to get ACPI dev
Date: Wed, 2 Dec 2015 20:22:54 -0200

Instead of calling piix4_pm_find() and ich9_lpc_find(), simply
use PCMachineState::acpi_dev to get the object containing the
ACPI-related properties.

Signed-off-by: Eduardo Habkost <address@hidden>
---
 hw/i386/acpi-build.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 617cd53..440d4e2 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -146,21 +146,13 @@ static bool acpi_pci_hotplug_enabled(Object *acpi_dev)
     return object_property_find(acpi_dev, ACPI_PCIHP_IO_BASE_PROP, NULL);
 }
 
-static void acpi_get_pm_info(AcpiPmInfo *pm)
+static void acpi_get_pm_info(AcpiPmInfo *pm, PCMachineState *pcms)
 {
-    Object *piix = piix4_pm_find();
-    Object *lpc = ich9_lpc_find();
-    Object *obj = NULL;
+    Object *obj = OBJECT(pcms->acpi_dev);
 
+    assert(obj);
     pm->pcihp_io_base = 0;
     pm->pcihp_io_len = 0;
-    if (piix) {
-        obj = piix;
-    }
-    if (lpc) {
-        obj = lpc;
-    }
-    assert(obj);
 
     if (acpi_pci_hotplug_enabled(obj)) {
         pm->pcihp_io_base =
@@ -1642,7 +1634,7 @@ void acpi_build(PCMachineState *pcms, AcpiBuildTables 
*tables)
     GArray *tables_blob = tables->table_data;
 
     acpi_get_cpu_info(&cpu);
-    acpi_get_pm_info(&pm);
+    acpi_get_pm_info(&pm, pcms);
     acpi_get_misc_info(&misc);
     acpi_get_pci_info(&pci, pcms);
 
-- 
2.1.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]