Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fadd1daa authored by Jiang Liu's avatar Jiang Liu Committed by Bjorn Helgaas
Browse files

mlx4: Use PCI Express Capability accessors



Use PCI Express Capability access functions to simplify mlx4 driver.

Signed-off-by: default avatarJiang Liu <jiang.liu@huawei.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent d892aa00
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -141,7 +141,7 @@ 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 "
@@ -149,7 +149,7 @@ int mlx4_reset(struct mlx4_dev *dev)
			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 "