From 4b515e4fc53f7675935a40a37ebf0c384e776914 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 6 Jul 2015 16:47:46 -0600 Subject: dm: pci: Add a function to get the BDF for a device It is useful to be able to find the full PCI address (bus, device and function) for a PCI device. Add a function to provide this. Adjust the existing code to use this. Signed-off-by: Simon Glass --- include/pci.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/pci.h') diff --git a/include/pci.h b/include/pci.h index 021928f534..94bca97512 100644 --- a/include/pci.h +++ b/include/pci.h @@ -807,6 +807,14 @@ struct dm_pci_ops { /* Get access to a PCI bus' operations */ #define pci_get_ops(dev) ((struct dm_pci_ops *)(dev)->driver->ops) +/** + * pci_get_bdf() - Get the BDF value for a device + * + * @dev: Device to check + * @return bus/device/function value (see PCI_BDF()) + */ +pci_dev_t pci_get_bdf(struct udevice *dev); + /** * pci_bind_bus_devices() - scan a PCI bus and bind devices * -- cgit v1.2.3