summaryrefslogtreecommitdiffstats
path: root/drivers/pci/controller/dwc/pcie-spear13xx.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2020-08-20 21:54:10 -0600
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2020-09-08 16:37:02 +0100
commitfb7652327101cdcaceae472c3b87fc5c8de28abe (patch)
tree97bff200718ccb427e93a97bedd36ea2b011c22f /drivers/pci/controller/dwc/pcie-spear13xx.c
parent7b87ddc04b364b94142d3b1295d92f1fe1145781 (diff)
downloadlinux-stable-fb7652327101cdcaceae472c3b87fc5c8de28abe.tar.gz
linux-stable-fb7652327101cdcaceae472c3b87fc5c8de28abe.tar.bz2
linux-stable-fb7652327101cdcaceae472c3b87fc5c8de28abe.zip
PCI: dwc: Remove hardcoded PCI_CAP_ID_EXP offset
While the Designware controller appears to hard code the PCI_CAP_ID_EXP capability register at 0x70, there's no need to hard code this in the driver as it is discoverable. Link: https://lore.kernel.org/r/20200821035420.380495-31-robh@kernel.org Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Kishon Vijay Abraham I <kishon@ti.com> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Murali Karicheri <m-karicheri2@ti.com> Cc: Pratyush Anand <pratyush.anand@gmail.com> Cc: linux-omap@vger.kernel.org
Diffstat (limited to 'drivers/pci/controller/dwc/pcie-spear13xx.c')
-rw-r--r--drivers/pci/controller/dwc/pcie-spear13xx.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/pci/controller/dwc/pcie-spear13xx.c b/drivers/pci/controller/dwc/pcie-spear13xx.c
index 62846562da0b..056c94541a22 100644
--- a/drivers/pci/controller/dwc/pcie-spear13xx.c
+++ b/drivers/pci/controller/dwc/pcie-spear13xx.c
@@ -65,8 +65,6 @@ struct pcie_app_reg {
/* CR6 */
#define MSI_CTRL_INT (1 << 26)
-#define EXP_CAP_ID_OFFSET 0x70
-
#define to_spear13xx_pcie(x) dev_get_drvdata((x)->dev)
static int spear13xx_pcie_establish_link(struct spear13xx_pcie *spear13xx_pcie)
@@ -75,7 +73,7 @@ static int spear13xx_pcie_establish_link(struct spear13xx_pcie *spear13xx_pcie)
struct pcie_port *pp = &pci->pp;
struct pcie_app_reg *app_reg = spear13xx_pcie->app_base;
u32 val;
- u32 exp_cap_off = EXP_CAP_ID_OFFSET;
+ u32 exp_cap_off = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
if (dw_pcie_link_up(pci)) {
dev_err(pci->dev, "link already up\n");