[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <0b255d17-deab-4d6e-bf44-d950b512dc14@web.de>
Date: Mon, 5 Feb 2024 08:18:31 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: linux-edac@...r.kernel.org, kernel-janitors@...r.kernel.org,
Borislav Petkov <bp@...en8.de>, James Morse <james.morse@....com>,
Khuong Dinh <khuong@...amperecomputing.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>, Robert Richter
<rric@...nel.org>, Tony Luck <tony.luck@...el.com>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] EDAC/xgene: Use devm_platform_get_and_ioremap_resource() in
xgene_edac_probe()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 5 Feb 2024 08:12:24 +0100
A wrapper function is available since the commit 890cc39a879906b63912482dfc41944579df2dc6
("drivers: provide devm_platform_get_and_ioremap_resource()").
Thus reuse existing functionality instead of keeping duplicate source code.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/edac/xgene_edac.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c
index 1b50f8160013..8776765b6d2e 100644
--- a/drivers/edac/xgene_edac.c
+++ b/drivers/edac/xgene_edac.c
@@ -1903,8 +1903,7 @@ static int xgene_edac_probe(struct platform_device *pdev)
edac->rb_map = NULL;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- edac->pcp_csr = devm_ioremap_resource(&pdev->dev, res);
+ edac->pcp_csr = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(edac->pcp_csr)) {
dev_err(&pdev->dev, "no PCP resource address\n");
rc = PTR_ERR(edac->pcp_csr);
--
2.43.0
Powered by blists - more mailing lists