diff options
author | Simon Glass <sjg@chromium.org> | 2015-11-20 03:27:00 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-12-01 13:26:36 (GMT) |
commit | 9f60fb0db4b70c65760cb1799b76de1c9b71644d (patch) | |
tree | 9c8f9d5815a9a2bb315b683d87fd446b2dbfc689 /include | |
parent | 9289db6c60bc9caa285fc6459db9236d92ba94f6 (diff) | |
download | u-boot-9f60fb0db4b70c65760cb1799b76de1c9b71644d.tar.xz |
dm: pci: Add a function to get the controller for a bus
A PCI bus may be a bridge device where the controller is the bridge's
parent. Add a function to return the controller device, given a PCI device.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/pci.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/pci.h b/include/pci.h index ec2d104..f3dda70 100644 --- a/include/pci.h +++ b/include/pci.h @@ -1123,6 +1123,14 @@ ulong pci_conv_size_to_32(ulong old, ulong value, uint offset, enum pci_size_t size); /** + * pci_get_controller() - obtain the controller to use for a bus + * + * @dev: Device to check + * @return pointer to the controller device for this bus + */ +struct udevice *pci_get_controller(struct udevice *dev); + +/** * struct dm_pci_emul_ops - PCI device emulator operations */ struct dm_pci_emul_ops { |