summaryrefslogtreecommitdiff
path: root/drivers/pci/pci_compat.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-07-06 16:47:46 -0600
committerSimon Glass <sjg@chromium.org>2015-07-21 17:39:39 -0600
commit4b515e4fc53f7675935a40a37ebf0c384e776914 (patch)
tree4d32fa142fc6d0a095a89a932707cd07d2c49db5 /drivers/pci/pci_compat.c
parentd0a5a0b2d800ddf248a7a843e5efba72d19059cc (diff)
downloadu-boot-4b515e4fc53f7675935a40a37ebf0c384e776914.tar.gz
u-boot-4b515e4fc53f7675935a40a37ebf0c384e776914.tar.bz2
u-boot-4b515e4fc53f7675935a40a37ebf0c384e776914.zip
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 <sjg@chromium.org>
Diffstat (limited to 'drivers/pci/pci_compat.c')
-rw-r--r--drivers/pci/pci_compat.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/pci/pci_compat.c b/drivers/pci/pci_compat.c
index d6938c198f..05c35105ab 100644
--- a/drivers/pci/pci_compat.c
+++ b/drivers/pci/pci_compat.c
@@ -31,13 +31,9 @@ PCI_HOSE_OP(write, dword, 32, u32)
pci_dev_t pci_find_devices(struct pci_device_id *ids, int index)
{
- struct pci_child_platdata *pplat;
- struct udevice *bus, *dev;
+ struct udevice *dev;
if (pci_find_device_id(ids, index, &dev))
return -1;
- bus = dev->parent;
- pplat = dev_get_parent_platdata(dev);
-
- return PCI_ADD_BUS(bus->seq, pplat->devfn);
+ return pci_get_bdf(dev);
}