From ab275f0915f2ba8abffed8f1384aa5353287c5ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 4 Jul 2019 07:16:59 +0300 Subject: device/pci: Declare pcidev_path_on_bus() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is recommended to never reference PCI busses using a static number. There is exception with OPROM execution, where we want to translate the bus number captured from the actual IO operation into a matching device node in the devicetree. Change-Id: I733c645ac5581c000b4cd6cdc05829cd039324d5 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/34077 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/include/device/device.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/include/device') diff --git a/src/include/device/device.h b/src/include/device/device.h index a200de0876..007c51f629 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -288,6 +288,7 @@ DEVTREE_CONST struct device *dev_bus_each_child(const struct bus *parent, DEVTREE_CONST struct device *pcidev_path_behind(const struct bus *parent, pci_devfn_t devfn); DEVTREE_CONST struct device *pcidev_path_on_root(pci_devfn_t devfn); +DEVTREE_CONST struct device *pcidev_path_on_bus(unsigned int bus, pci_devfn_t devfn); DEVTREE_CONST struct device *pcidev_on_root(uint8_t dev, uint8_t fn); DEVTREE_CONST struct bus *pci_root_bus(void); -- cgit v1.2.3