Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/mthca: Use PCI Express Capability accessors

Use PCI Express Capability access functions to simplify mthca driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Roland Dreier <roland@purestorage.com>

authored by

Jiang Liu and committed by
Bjorn Helgaas
3c55569b 332badc3

+4 -4
+4 -4
drivers/infiniband/hw/mthca/mthca_reset.c
··· 241 241 242 242 if (hca_pcie_cap) { 243 243 devctl = hca_header[(hca_pcie_cap + PCI_EXP_DEVCTL) / 4]; 244 - if (pci_write_config_word(mdev->pdev, hca_pcie_cap + PCI_EXP_DEVCTL, 245 - devctl)) { 244 + if (pcie_capability_write_word(mdev->pdev, PCI_EXP_DEVCTL, 245 + devctl)) { 246 246 err = -ENODEV; 247 247 mthca_err(mdev, "Couldn't restore HCA PCI Express " 248 248 "Device Control register, aborting.\n"); 249 249 goto out; 250 250 } 251 251 linkctl = hca_header[(hca_pcie_cap + PCI_EXP_LNKCTL) / 4]; 252 - if (pci_write_config_word(mdev->pdev, hca_pcie_cap + PCI_EXP_LNKCTL, 253 - linkctl)) { 252 + if (pcie_capability_write_word(mdev->pdev, PCI_EXP_LNKCTL, 253 + linkctl)) { 254 254 err = -ENODEV; 255 255 mthca_err(mdev, "Couldn't restore HCA PCI Express " 256 256 "Link control register, aborting.\n");