diff options
author | Simon Glass <sjg@chromium.org> | 2015-11-29 20:17:52 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-01-12 17:19:09 (GMT) |
commit | a0eb835635abe0952529e3eb5207a24ac36fa000 (patch) | |
tree | aac75f8b2e09e09890e6a74ef7f5c3078b1d689f /include | |
parent | 9fbdb94667b7316ef2a48fce325ae2da147d7d66 (diff) | |
download | u-boot-fsl-qoriq-a0eb835635abe0952529e3eb5207a24ac36fa000.tar.xz |
dm: pci: Add a driver-model version of pci_find_class()
Add a function which scans the driver model device information rather
than scanning the PCI bus again.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/pci.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/pci.h b/include/pci.h index 347dd0a..443af83 100644 --- a/include/pci.h +++ b/include/pci.h @@ -1179,6 +1179,16 @@ int dm_pci_find_device(unsigned int vendor, unsigned int device, int index, struct udevice **devp); /** + * dm_pci_find_class() - find a device by class + * + * @find_class: 3-byte (24-bit) class value to find + * @index: 0 to find the first match, 1 for second, etc. + * @devp: Returns pointer to the device, if found + * @return 0 if found, -ve on error + */ +int dm_pci_find_class(uint find_class, int index, struct udevice **devp); + +/** * struct dm_pci_emul_ops - PCI device emulator operations */ struct dm_pci_emul_ops { |