Patchwork [7/7] seabios: acpi: clean up of finding pm device.

login
register
mail settings
Submitter Isaku Yamahata
Date July 12, 2010, 11:47 a.m.
Message ID <13d2edba84d4eb949c3ba273970ccaf5c3a832b7.1278935094.git.yamahata@valinux.co.jp>
Download mbox | patch
Permalink /patch/58594/
State New
Headers show

Comments

Isaku Yamahata - July 12, 2010, 11:47 a.m.
Make it table driven to other chip set.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 src/acpi.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

Patch

diff --git a/src/acpi.c b/src/acpi.c
index 32d436f..fa07c37 100644
--- a/src/acpi.c
+++ b/src/acpi.c
@@ -527,6 +527,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
@@ -539,8 +546,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;