mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
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>
This commit is contained in:
parent
9fbdb94667
commit
a0eb835635
2 changed files with 30 additions and 0 deletions
|
@ -1178,6 +1178,16 @@ int pci_get_regions(struct udevice *dev, struct pci_region **iop,
|
|||
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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue