aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDejin Zheng <[email protected]>2021-03-28 22:41:18 +0800
committerLorenzo Pieralisi <[email protected]>2021-03-31 10:28:38 +0100
commitd4707d79fae08c8996a1ba45965a491045a22dda (patch)
tree38aebddc8d32d34e25038b93f39bc688f9a233ab
parenta38fd8748464831584a19438cbb3082b5a2dab15 (diff)
PCI: xgene: Fix cfg resource mapping
In commit e2dcd20b1645 a change was made to use devm_platform_ioremap_resource_byname() to simplify code and remove the res variable; this was wrong since the res variable is still needed and as an outcome the port->cfg_addr gets an erroneous address. Revert the change going back to original behaviour. Link: https://lore.kernel.org/r/[email protected] Fixes: e2dcd20b1645a ("PCI: controller: Convert to devm_platform_ioremap_resource_byname()") Reported-by: [email protected] Tested-by: dann frazier <[email protected]> Signed-off-by: Dejin Zheng <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Cc: [email protected] # v5.9+
-rw-r--r--drivers/pci/controller/pci-xgene.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/controller/pci-xgene.c b/drivers/pci/controller/pci-xgene.c
index 2afdc865253e..7f503dd4ff81 100644
--- a/drivers/pci/controller/pci-xgene.c
+++ b/drivers/pci/controller/pci-xgene.c
@@ -354,7 +354,8 @@ static int xgene_pcie_map_reg(struct xgene_pcie_port *port,
if (IS_ERR(port->csr_base))
return PTR_ERR(port->csr_base);
- port->cfg_base = devm_platform_ioremap_resource_byname(pdev, "cfg");
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg");
+ port->cfg_base = devm_ioremap_resource(dev, res);
if (IS_ERR(port->cfg_base))
return PTR_ERR(port->cfg_base);
port->cfg_addr = res->start;