mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
dm: pci: Add a driver-model version of pci_find_device()
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:
@ -1166,6 +1166,18 @@ struct udevice *pci_get_controller(struct udevice *dev);
|
||||
int pci_get_regions(struct udevice *dev, struct pci_region **iop,
|
||||
struct pci_region **memp, struct pci_region **prefp);
|
||||
|
||||
/**
|
||||
* dm_pci_find_device() - find a device by vendor/device ID
|
||||
*
|
||||
* @vendor: Vendor ID
|
||||
* @device: Device ID
|
||||
* @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_device(unsigned int vendor, unsigned int device, int index,
|
||||
struct udevice **devp);
|
||||
|
||||
/**
|
||||
* struct dm_pci_emul_ops - PCI device emulator operations
|
||||
*/
|
||||
|
Reference in New Issue
Block a user