From patchwork Tue Jul 20 07:37:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [5/5] seabios: acpi: clean up of finding pm device. From: Isaku Yamahata X-Patchwork-Id: 59284 Message-Id: To: seabios@seabios.org Cc: yamahata@valinux.co.jp, qemu-devel@nongnu.org Date: Tue, 20 Jul 2010 16:37:19 +0900 Make it table driven to other chip set. Signed-off-by: Isaku Yamahata --- src/acpi.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/acpi.c b/src/acpi.c index 5818d4c..e91f8e0 100644 --- a/src/acpi.c +++ b/src/acpi.c @@ -522,6 +522,13 @@ build_srat(void) return srat; } +static const struct pci_device_id acpi_find_tbl[] = { + /* PIIX4 Power Management device. */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, NULL), + + PCI_DEVICE_END, +}; + struct rsdp_descriptor *RsdpAddr; #define MAX_ACPI_TABLES 20 @@ -534,8 +541,7 @@ acpi_bios_init(void) dprintf(3, "init ACPI tables\n"); // This code is hardcoded for PIIX4 Power Management device. - int bdf = pci_find_device(PCI_VENDOR_ID_INTEL - , PCI_DEVICE_ID_INTEL_82371AB_3); + int bdf = pci_find_init_device(acpi_find_tbl, NULL); if (bdf < 0) // Device not found return;