提交 3c55569b 编写于 作者: J Jiang Liu 提交者: Bjorn Helgaas

IB/mthca: Use PCI Express Capability accessors

Use PCI Express Capability access functions to simplify mthca driver.
Signed-off-by: NJiang Liu <jiang.liu@huawei.com>
Signed-off-by: NYijing Wang <wangyijing@huawei.com>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
Acked-by: NRoland Dreier <roland@purestorage.com>
上级 332badc3
...@@ -241,16 +241,16 @@ int mthca_reset(struct mthca_dev *mdev) ...@@ -241,16 +241,16 @@ int mthca_reset(struct mthca_dev *mdev)
if (hca_pcie_cap) { if (hca_pcie_cap) {
devctl = hca_header[(hca_pcie_cap + PCI_EXP_DEVCTL) / 4]; devctl = hca_header[(hca_pcie_cap + PCI_EXP_DEVCTL) / 4];
if (pci_write_config_word(mdev->pdev, hca_pcie_cap + PCI_EXP_DEVCTL, if (pcie_capability_write_word(mdev->pdev, PCI_EXP_DEVCTL,
devctl)) { devctl)) {
err = -ENODEV; err = -ENODEV;
mthca_err(mdev, "Couldn't restore HCA PCI Express " mthca_err(mdev, "Couldn't restore HCA PCI Express "
"Device Control register, aborting.\n"); "Device Control register, aborting.\n");
goto out; goto out;
} }
linkctl = hca_header[(hca_pcie_cap + PCI_EXP_LNKCTL) / 4]; linkctl = hca_header[(hca_pcie_cap + PCI_EXP_LNKCTL) / 4];
if (pci_write_config_word(mdev->pdev, hca_pcie_cap + PCI_EXP_LNKCTL, if (pcie_capability_write_word(mdev->pdev, PCI_EXP_LNKCTL,
linkctl)) { linkctl)) {
err = -ENODEV; err = -ENODEV;
mthca_err(mdev, "Couldn't restore HCA PCI Express " mthca_err(mdev, "Couldn't restore HCA PCI Express "
"Link control register, aborting.\n"); "Link control register, aborting.\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册