2023-07-04 09:57:01

by 李扬韬

[permalink] [raw]
Subject: [PATCH] perf: xgene_pmu: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <[email protected]>
---
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



2023-07-27 13:09:33

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH] perf: xgene_pmu: Convert to devm_platform_ioremap_resource()

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