PCI/portdrv: Use PCI Express Capability accessors
authorBjorn Helgaas <bhelgaas@google.com>
Wed, 5 Dec 2012 20:51:18 +0000 (13:51 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 7 Dec 2012 18:16:35 +0000 (11:16 -0700)
Use PCI Express Capability access functions to simplify portdrv.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pcie/portdrv_core.c

index d03a7a39b2d85e14baef54a8255e787094528229..70d3555903ae5c6bc42d4ee16165c6073da8c743 100644 (file)
@@ -120,8 +120,7 @@ static int pcie_port_enable_msix(struct pci_dev *dev, int *vectors, int mask)
                 * the value in this field indicates which MSI-X Table entry is
                 * used to generate the interrupt message."
                 */
-               pos = pci_pcie_cap(dev);
-               pci_read_config_word(dev, pos + PCI_EXP_FLAGS, &reg16);
+               pcie_capability_read_word(dev, PCI_EXP_FLAGS, &reg16);
                entry = (reg16 & PCI_EXP_FLAGS_IRQ) >> 9;
                if (entry >= nr_entries)
                        goto Error;