linuxkpi: add pci_dev_present
pci_dev_present shows if a set of pci ids are present in the system. It just wraps pci_find_device. Needed by DRMv5.2 Submitted by: Austing Shafer (ashafer@badland.io) Differential Revision: https://reviews.freebsd.org/D24796
This commit is contained in:
parent
ff443195bf
commit
5e30a739c7
@ -1050,4 +1050,16 @@ extern int linux_pci_attach_device(device_t, struct pci_driver *,
|
||||
const struct pci_device_id *, struct pci_dev *);
|
||||
extern int linux_pci_detach_device(struct pci_dev *);
|
||||
|
||||
static inline int
|
||||
pci_dev_present(const struct pci_device_id *cur)
|
||||
{
|
||||
while (cur != NULL && (cur->vendor || cur->device)) {
|
||||
if (pci_find_device(cur->vendor, cur->device) != NULL) {
|
||||
return (1);
|
||||
}
|
||||
cur++;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
#endif /* _LINUX_PCI_H_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user