From patchwork Sat Dec 22 19:07:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: drm: change pci_read_config_dword calls to pcie_capability_read_dword ones Date: Sat, 22 Dec 2012 09:07:55 -0000 From: Lucas Kannebley Tavares X-Patchwork-Id: 207936 Message-Id: <50D6050B.8080400@linux.vnet.ibm.com> To: Bjorn Helgaas Cc: dri-devel@lists.freedesktop.org, David Airlie , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, brking@linux.vnet.ibm.com, benh@au1.ibm.com, Betty Dall , Thadeu Lima de Souza Cascardo Replacing these calls avoids compatibility problems with PCIe v1/v2 Capability structures. Signed-off-by: Lucas Kannebley Tavares --- drivers/gpu/drm/drm_pci.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) lnkcap2 &= 0xfe; diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index ea41234..b824d4c 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -486,17 +486,13 @@ int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask) if (root == NULL) root = dev->pdev; - pos = pci_pcie_cap(root); - if (!pos) - return -EINVAL; - /* we've been informed via and serverworks don't make the cut */ if (root->vendor == PCI_VENDOR_ID_VIA || root->vendor == PCI_VENDOR_ID_SERVERWORKS) return -EINVAL; - pci_read_config_dword(root, pos + PCI_EXP_LNKCAP, &lnkcap); - pci_read_config_dword(root, pos + PCI_EXP_LNKCAP2, &lnkcap2); + pcie_capability_read_dword(root, PCI_EXP_LNKCAP, &lnkcap); + pcie_capability_read_dword(root, PCI_EXP_LNKCAP, &lnkcap2); lnkcap &= PCI_EXP_LNKCAP_SLS;