Push 'struct pci_device' into USB code (instead of using u16 bdf).
[seabios.git] / src / usb-ohci.c
index 72b9f68b7f50f3b40cd0ca7af9d5d4855f340022..317f200c65f0348ae1c2082d28a5265716e2e266 100644 (file)
@@ -204,16 +204,17 @@ free:
 }
 
 void
-ohci_init(u16 bdf, int busid)
+ohci_init(struct pci_device *pci, int busid)
 {
     if (! CONFIG_USB_OHCI)
         return;
     struct usb_ohci_s *cntl = malloc_tmphigh(sizeof(*cntl));
     memset(cntl, 0, sizeof(*cntl));
     cntl->usb.busid = busid;
-    cntl->usb.bdf = bdf;
+    cntl->usb.pci = pci;
     cntl->usb.type = USB_TYPE_OHCI;
 
+    u16 bdf = pci->bdf;
     u32 baseaddr = pci_config_readl(bdf, PCI_BASE_ADDRESS_0);
     cntl->regs = (void*)(baseaddr & PCI_BASE_ADDRESS_MEM_MASK);