Patrick Georgi | 7333a11 | 2020-05-08 20:48:04 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Uwe Hermann | 622fb79 | 2010-01-24 01:47:58 +0000 | [diff] [blame] | 2 | |
| 3 | #include "superiotool.h" |
| 4 | |
| 5 | struct pci_access *pacc; |
| 6 | |
| 7 | struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device) |
| 8 | { |
| 9 | struct pci_dev *temp; |
| 10 | struct pci_filter filter; |
| 11 | |
| 12 | pci_filter_init(NULL, &filter); |
| 13 | filter.vendor = vendor; |
| 14 | filter.device = device; |
| 15 | |
| 16 | for (temp = pacc->devices; temp; temp = temp->next) |
| 17 | if (pci_filter_match(&filter, temp)) |
| 18 | return temp; |
| 19 | |
| 20 | return NULL; |
| 21 | } |