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>
This commit is contained in:
Jiang Liu 2012-07-24 17:20:20 +08:00 коммит произвёл Bjorn Helgaas
Родитель d892aa00bc
Коммит fadd1daa0b
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

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