From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4Uck-0004pE-Iz for qemu-devel@nongnu.org; Thu, 03 Dec 2015 09:12:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4Ucg-0007OC-IK for qemu-devel@nongnu.org; Thu, 03 Dec 2015 09:12:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4Ucg-0007O5-D6 for qemu-devel@nongnu.org; Thu, 03 Dec 2015 09:12:38 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id E9E023CB27C for ; Thu, 3 Dec 2015 14:12:37 +0000 (UTC) From: Eduardo Habkost Date: Wed, 2 Dec 2015 20:22:54 -0200 Message-Id: <1449094978-22986-10-git-send-email-ehabkost@redhat.com> In-Reply-To: <1449094978-22986-1-git-send-email-ehabkost@redhat.com> References: <1449094978-22986-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 09/13] acpi: Use PCMachineState::acpi_dev to get ACPI dev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Igor Mammedov , Marcel Apfelbaum , "Michael S. Tsirkin" 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 --- 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