seabios: acpi: clean up of finding pm device.
authorIsaku Yamahata <yamahata@valinux.co.jp>
Tue, 20 Jul 2010 07:37:19 +0000 (16:37 +0900)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 24 Jul 2010 17:30:04 +0000 (13:30 -0400)
Make it table driven to other chip set.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
src/acpi.c

index 5818d4cf19a77b7f1586ee3da731bf6ba621574b..e91f8e001f941868d1784d5d47210fd5487bcfcd 100644 (file)
@@ -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;