[PATCH] perf: xgene_pmu: Convert to devm_platform_ioremap_resource()

Yangtao Li posted 1 patch 2 years, 7 months ago
drivers/perf/xgene_pmu.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
[PATCH] perf: xgene_pmu: Convert to devm_platform_ioremap_resource()
Posted by Yangtao Li 2 years, 7 months ago
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/perf/xgene_pmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/perf/xgene_pmu.c b/drivers/perf/xgene_pmu.c
index 0c32dffc7ede..9972bfc11a5c 100644
--- a/drivers/perf/xgene_pmu.c
+++ b/drivers/perf/xgene_pmu.c
@@ -1833,7 +1833,6 @@ static int xgene_pmu_probe(struct platform_device *pdev)
 	const struct xgene_pmu_data *dev_data;
 	const struct of_device_id *of_id;
 	struct xgene_pmu *xgene_pmu;
-	struct resource *res;
 	int irq, rc;
 	int version;
 
@@ -1883,8 +1882,7 @@ static int xgene_pmu_probe(struct platform_device *pdev)
 	xgene_pmu->version = version;
 	dev_info(&pdev->dev, "X-Gene PMU version %d\n", xgene_pmu->version);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	xgene_pmu->pcppmu_csr = devm_ioremap_resource(&pdev->dev, res);
+	xgene_pmu->pcppmu_csr = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(xgene_pmu->pcppmu_csr)) {
 		dev_err(&pdev->dev, "ioremap failed for PCP PMU resource\n");
 		return PTR_ERR(xgene_pmu->pcppmu_csr);
-- 
2.39.0
Re: [PATCH] perf: xgene_pmu: Convert to devm_platform_ioremap_resource()
Posted by Will Deacon 2 years, 6 months ago
On Tue, 4 Jul 2023 17:35:55 +0800, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> 

Applied to will (for-next/perf), thanks!

[1/1] perf: xgene_pmu: Convert to devm_platform_ioremap_resource()
      https://git.kernel.org/will/c/c47ea342d85d

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev