aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2017-04-07 10:16:17 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-06-15 17:10:11 +1000
commit2b841bf0ef1b20d9544ffe641d6271b65b9efcc4 (patch)
treeed8dd65aaefb81a64fa3c5b5276ce08e3640b0c3 /core
parente835c2fb7ce1e9bff7ca5948c1343037e906395f (diff)
downloadskiboot-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')
-rw-r--r--core/pci-quirk.c9
-rw-r--r--core/pci.c2
2 files changed, 4 insertions, 7 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++;
}
diff --git a/core/pci.c b/core/pci.c
index f71482a..95ed269 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -1467,7 +1467,7 @@ static void pci_add_one_device_node(struct phb *phb,
if (intpin)
dt_add_property_cells(np, "interrupts", intpin);
- pci_handle_quirk(phb, pd, vdid & 0xffff, vdid >> 16);
+ pci_handle_quirk(phb, pd);
/* XXX FIXME: Add a few missing ones such as
*