devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] perf: imx9_ddr_perf: resolve resource map conflict
@ 2023-09-14 10:20 Xu Yang
  2023-09-14 10:20 ` [PATCH 2/2] arm64: dts: imx93: add DDR controller node Xu Yang
  2023-09-14 10:21 ` [PATCH 1/2] perf: imx9_ddr_perf: resolve resource map conflict Krzysztof Kozlowski
  0 siblings, 2 replies; 10+ messages in thread
From: Xu Yang @ 2023-09-14 10:20 UTC (permalink / raw)
  To: will, mark.rutland, robh+dt, shawnguo
  Cc: krzysztof.kozlowski+dt, conor+dt, linux-imx, devicetree,
	linux-arm-kernel, ye.li

Usually, the ddr pmu node will be a subnode of DDR controller, then using
devm_platform_ioremap_resource will report conflict with DDR controller
resource. So update the driver to use devm_ioremap to avoid such
resource check.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
 drivers/perf/fsl_imx9_ddr_perf.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c
index 5cf770a1bc31..885024665968 100644
--- a/drivers/perf/fsl_imx9_ddr_perf.c
+++ b/drivers/perf/fsl_imx9_ddr_perf.c
@@ -602,8 +602,15 @@ static int ddr_perf_probe(struct platform_device *pdev)
 	void __iomem *base;
 	int ret, irq;
 	char *name;
+	struct resource *r;
 
-	base = devm_platform_ioremap_resource(pdev, 0);
+	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!r) {
+		dev_err(&pdev->dev, "platform_get_resource() failed\n");
+		return -ENOMEM;
+	}
+
+	base = devm_ioremap(&pdev->dev, r->start, resource_size(r));
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-09-15  7:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-14 10:20 [PATCH 1/2] perf: imx9_ddr_perf: resolve resource map conflict Xu Yang
2023-09-14 10:20 ` [PATCH 2/2] arm64: dts: imx93: add DDR controller node Xu Yang
2023-09-14 10:19   ` Krzysztof Kozlowski
2023-09-15  2:39     ` [EXT] " Xu Yang
2023-09-15  6:54       ` Krzysztof Kozlowski
2023-09-15  7:33         ` Xu Yang
2023-09-14 14:20   ` [EXT] " Frank Li
2023-09-15  1:33     ` Ye Li
2023-09-14 10:21 ` [PATCH 1/2] perf: imx9_ddr_perf: resolve resource map conflict Krzysztof Kozlowski
2023-09-15  2:46   ` [EXT] " Xu Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).