introduce helper function to find device from table and initialize it.
pci_find_init_device(). This will be used later.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
}
return -1;
}
+
+int pci_find_init_device(const struct pci_device_id *ids, void *arg)
+{
+ int bdf, max;
+
+ foreachpci(bdf, max) {
+ if (pci_init_device(ids, bdf, arg) == 0) {
+ return bdf;
+ }
+ }
+ return -1;
+}
}
int pci_init_device(const struct pci_device_id *table, u16 bdf, void *arg);
+int pci_find_init_device(const struct pci_device_id *ids, void *arg);
// pirtable.c
void create_pirtable(void);