diff options
author | Jiang Liu <jiang.liu@huawei.com> | 2012-07-24 05:20:20 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-08-23 12:11:13 -0400 |
commit | fadd1daa0b62bccb10acab6d693b9de990671456 (patch) | |
tree | 1d332f401a6266a1b6a0834639f1b9fa81bb4454 | |
parent | d892aa00bc89c977acc71dc10aa79c2984710c12 (diff) |
mlx4: Use PCI Express Capability accessors
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>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/reset.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/reset.c b/drivers/net/ethernet/mellanox/mlx4/reset.c index 11e7c1cb99bf..dd1b5093d8b1 100644 --- a/drivers/net/ethernet/mellanox/mlx4/reset.c +++ b/drivers/net/ethernet/mellanox/mlx4/reset.c | |||
@@ -141,16 +141,16 @@ int mlx4_reset(struct mlx4_dev *dev) | |||
141 | /* Now restore the PCI headers */ | 141 | /* Now restore the PCI headers */ |
142 | if (pcie_cap) { | 142 | if (pcie_cap) { |
143 | devctl = hca_header[(pcie_cap + PCI_EXP_DEVCTL) / 4]; | 143 | devctl = hca_header[(pcie_cap + PCI_EXP_DEVCTL) / 4]; |
144 | if (pci_write_config_word(dev->pdev, pcie_cap + PCI_EXP_DEVCTL, | 144 | if (pcie_capability_write_word(dev->pdev, PCI_EXP_DEVCTL, |
145 | devctl)) { | 145 | devctl)) { |
146 | err = -ENODEV; | 146 | err = -ENODEV; |
147 | mlx4_err(dev, "Couldn't restore HCA PCI Express " | 147 | mlx4_err(dev, "Couldn't restore HCA PCI Express " |
148 | "Device Control register, aborting.\n"); | 148 | "Device Control register, aborting.\n"); |
149 | goto out; | 149 | goto out; |
150 | } | 150 | } |
151 | linkctl = hca_header[(pcie_cap + PCI_EXP_LNKCTL) / 4]; | 151 | linkctl = hca_header[(pcie_cap + PCI_EXP_LNKCTL) / 4]; |
152 | if (pci_write_config_word(dev->pdev, pcie_cap + PCI_EXP_LNKCTL, | 152 | if (pcie_capability_write_word(dev->pdev, PCI_EXP_LNKCTL, |
153 | linkctl)) { | 153 | linkctl)) { |
154 | err = -ENODEV; | 154 | err = -ENODEV; |
155 | mlx4_err(dev, "Couldn't restore HCA PCI Express " | 155 | mlx4_err(dev, "Couldn't restore HCA PCI Express " |
156 | "Link control register, aborting.\n"); | 156 | "Link control register, aborting.\n"); |