Skip to content

Commit d4707d7

Browse files
Dejin ZhengLorenzo Pieralisi
authored andcommitted
PCI: xgene: Fix cfg resource mapping
In commit e2dcd20 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/20210328144118.305074-1-zhengdejin5@gmail.com Fixes: e2dcd20 ("PCI: controller: Convert to devm_platform_ioremap_resource_byname()") Reported-by: dann.frazier@canonical.com Tested-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: stable@vger.kernel.org # v5.9+
1 parent a38fd87 commit d4707d7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/pci/controller/pci-xgene.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ static int xgene_pcie_map_reg(struct xgene_pcie_port *port,
354354
if (IS_ERR(port->csr_base))
355355
return PTR_ERR(port->csr_base);
356356

357-
port->cfg_base = devm_platform_ioremap_resource_byname(pdev, "cfg");
357+
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg");
358+
port->cfg_base = devm_ioremap_resource(dev, res);
358359
if (IS_ERR(port->cfg_base))
359360
return PTR_ERR(port->cfg_base);
360361
port->cfg_addr = res->start;

0 commit comments

Comments
 (0)