diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2015-04-10 15:27:18 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-04-10 15:27:18 +0200 |
commit | 5468d5a64bf1e002e5081fa280186d0eba09fa0e (patch) | |
tree | a9c1500d4b0cfb9db1f822dc1357c184b0f2f188 /drivers/pci/pci.c | |
parent | Merge branches 'pci/host-exynos', 'pci/host-iproc', 'pci/host-keystone', 'pci... (diff) | |
parent | PCI: Read capability list as dwords, not bytes (diff) | |
download | linux-5468d5a64bf1e002e5081fa280186d0eba09fa0e.tar.xz linux-5468d5a64bf1e002e5081fa280186d0eba09fa0e.zip |
Merge branch 'pci/misc' into next
* pci/misc:
PCI: Read capability list as dwords, not bytes
PCI: Don't clear ASPM bits when the FADT declares it's unsupported
PCI: Clarify policy for vendor IDs in pci.txt
PCI/ACPI: Optimize device state transition delays
PCI: Export pci_find_host_bridge() for use inside PCI core
PCI: Make a shareable UUID for PCI firmware ACPI _DSM
PCI: Fix typo in Thunderbolt kernel message
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 061fdce8f8e1..acc4b6ef78c4 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -146,19 +146,22 @@ static int __pci_find_next_cap_ttl(struct pci_bus *bus, unsigned int devfn, u8 pos, int cap, int *ttl) { u8 id; + u16 ent; + + pci_bus_read_config_byte(bus, devfn, pos, &pos); while ((*ttl)--) { - pci_bus_read_config_byte(bus, devfn, pos, &pos); if (pos < 0x40) break; pos &= ~3; - pci_bus_read_config_byte(bus, devfn, pos + PCI_CAP_LIST_ID, - &id); + pci_bus_read_config_word(bus, devfn, pos, &ent); + + id = ent & 0xff; if (id == 0xff) break; if (id == cap) return pos; - pos += PCI_CAP_LIST_NEXT; + pos = (ent >> 8); } return 0; } |