mlx4: Use PCI Express Capability accessors
authorJiang Liu <jiang.liu@huawei.com>
Tue, 24 Jul 2012 09:20:20 +0000 (17:20 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 23 Aug 2012 16:11:13 +0000 (10:11 -0600)
Use PCI Express Capability access functions to simplify mlx4 driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/net/ethernet/mellanox/mlx4/reset.c

index 11e7c1c..dd1b509 100644 (file)
@@ -141,16 +141,16 @@ int mlx4_reset(struct mlx4_dev *dev)
        /* Now restore the PCI headers */
        if (pcie_cap) {
                devctl = hca_header[(pcie_cap + PCI_EXP_DEVCTL) / 4];
-               if (pci_write_config_word(dev->pdev, pcie_cap + PCI_EXP_DEVCTL,
-                                          devctl)) {
+               if (pcie_capability_write_word(dev->pdev, PCI_EXP_DEVCTL,
+                                              devctl)) {
                        err = -ENODEV;
                        mlx4_err(dev, "Couldn't restore HCA PCI Express "
                                 "Device Control register, aborting.\n");
                        goto out;
                }
                linkctl = hca_header[(pcie_cap + PCI_EXP_LNKCTL) / 4];
-               if (pci_write_config_word(dev->pdev, pcie_cap + PCI_EXP_LNKCTL,
-                                          linkctl)) {
+               if (pcie_capability_write_word(dev->pdev, PCI_EXP_LNKCTL,
+                                              linkctl)) {
                        err = -ENODEV;
                        mlx4_err(dev, "Couldn't restore HCA PCI Express "
                                 "Link control register, aborting.\n");