diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2017-04-07 10:16:17 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-06-15 17:10:11 +1000 |
commit | 2b841bf0ef1b20d9544ffe641d6271b65b9efcc4 (patch) | |
tree | ed8dd65aaefb81a64fa3c5b5276ce08e3640b0c3 /core/pci-quirk.c | |
parent | e835c2fb7ce1e9bff7ca5948c1343037e906395f (diff) | |
download | skiboot-2b841bf0ef1b20d9544ffe641d6271b65b9efcc4.zip skiboot-2b841bf0ef1b20d9544ffe641d6271b65b9efcc4.tar.gz skiboot-2b841bf0ef1b20d9544ffe641d6271b65b9efcc4.tar.bz2 |
core/pci: Use cached vendor/device IDs in quirks
The PCI device vendor/device IDs have been cached to pd->vdid, no
need to pass them in pci_handle_quirk(). This also introduces two
macros to extract vendor/device fields and they are useful afterwards.
No logical changes introduced.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/pci-quirk.c')
-rw-r--r-- | core/pci-quirk.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/core/pci-quirk.c b/core/pci-quirk.c index 383d92c..0153bdb 100644 --- a/core/pci-quirk.c +++ b/core/pci-quirk.c @@ -70,17 +70,14 @@ static const struct pci_quirk quirk_table[] = { {NULL} }; -void pci_handle_quirk(struct phb *phb, - struct pci_device *pd, - uint16_t vendor_id, - uint16_t device_id) +void pci_handle_quirk(struct phb *phb, struct pci_device *pd) { const struct pci_quirk *quirks = quirk_table; while (quirks->vendor_id) { - if (vendor_id == quirks->vendor_id && + if (quirks->vendor_id == PCI_VENDOR_ID(pd->vdid) && (quirks->device_id == PCI_ANY_ID || - device_id == quirks->device_id)) + quirks->device_id == PCI_DEVICE_ID(pd->vdid))) quirks->fixup(phb, pd); quirks++; } |