Hello Felix Singer,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/46298
to review the following change.
Change subject: device/pci: Add a common pci_dev_final() method ......................................................................
device/pci: Add a common pci_dev_final() method
This common pci_dev_final() function should be called for every non- bridge PCI device. Hence, we also add it to the device operations of matched PCI drivers. If a PCI driver already has its `.final` operation set, it is responsible to call pci_dev_final().
Change-Id: I20e98dc5aeb88f3f139079668beb52c9e722751b Signed-off-by: Nico Huber nico.huber@secunet.com --- M src/device/pci_device.c 1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/98/46298/1
diff --git a/src/device/pci_device.c b/src/device/pci_device.c index 62c4535..cec28bc 100644 --- a/src/device/pci_device.c +++ b/src/device/pci_device.c @@ -769,6 +769,10 @@ timestamp_add_now(TS_OPROM_END); }
+static void pci_dev_final(struct device *dev) +{ +} + /** Default device operation for PCI devices */ struct pci_operations pci_dev_ops_pci = { .set_subsystem = pci_dev_set_subsystem, @@ -783,6 +787,7 @@ .acpi_fill_ssdt = pci_rom_ssdt, #endif .init = pci_dev_init, + .final = pci_dev_final, .ops_pci = &pci_dev_ops_pci, };
@@ -962,6 +967,8 @@ if (dev->ops) { printk(BIOS_SPEW, "%s [%04x/%04x] %sops\n", dev_path(dev), driver->vendor, driver->device, (driver->ops->scan_bus ? "bus " : "")); + if ((dev->hdr_type & 0x7f) == PCI_HEADER_TYPE_NORMAL && !dev->ops->final) + dev->ops->final = pci_dev_final; return; }