From: Lucas Kannebley Tavares <lucaskt@linux.vnet.ibm.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: dri-devel@lists.freedesktop.org, David Airlie <airlied@linux.ie>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
brking@linux.vnet.ibm.com, benh@au1.ibm.com,
Betty Dall <betty.dall@hp.com>,
Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Subject: [PATCH] drm: change pci_read_config_dword calls to pcie_capability_read_dword ones
Date: Sat, 22 Dec 2012 17:07:55 -0200 [thread overview]
Message-ID: <50D6050B.8080400@linux.vnet.ibm.com> (raw)
In-Reply-To: <50D60349.7080400@linux.vnet.ibm.com>
Replacing these calls avoids compatibility problems with PCIe v1/v2
Capability structures.
Signed-off-by: Lucas Kannebley Tavares <lucaskt@linux.vnet.ibm.com>
---
drivers/gpu/drm/drm_pci.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
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;
lnkcap2 &= 0xfe;
--
Lucas Kannebley Tavares
Software Engineer
IBM Linux Technology Center
prev parent reply other threads:[~2012-12-22 19:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-13 23:04 drm: Added ppc64 root device getter Lucas Kannebley Tavares
2012-12-13 23:31 ` Bjorn Helgaas
2012-12-22 19:00 ` Lucas Kannebley Tavares
2012-12-22 19:01 ` [PATCH] drm: fixed access to PCI host bridges Lucas Kannebley Tavares
2012-12-26 22:40 ` Bjorn Helgaas
2012-12-26 22:47 ` Dave Airlie
2012-12-22 19:07 ` Lucas Kannebley Tavares [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50D6050B.8080400@linux.vnet.ibm.com \
--to=lucaskt@linux.vnet.ibm.com \
--cc=airlied@linux.ie \
--cc=benh@au1.ibm.com \
--cc=betty.dall@hp.com \
--cc=bhelgaas@google.com \
--cc=brking@linux.vnet.ibm.com \
--cc=cascardo@linux.vnet.ibm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.