[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6e6ce5f8-b701-4660-a71b-478b29197a21@web.de>
Date: Tue, 6 Feb 2024 17:34:59 +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 v2] EDAC/xgene: Use devm_platform_ioremap_resource() in
xgene_edac_probe()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 6 Feb 2024 17:30:11 +0100
A wrapper function is available since the commit 7945f929f1a77a1c8887a97ca07f87626858ff42
("drivers: provide devm_platform_ioremap_resource()").
* Thus reuse existing functionality instead of keeping duplicate source code.
* Delete a local variable which became unnecessary with this refactoring.
This issue was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
v2:
The transformation pattern was adjusted based on advices by known contributors.
Examples:
* Doug Anderson
* Geert Uytterhoeven
* Robin Murphy
drivers/edac/xgene_edac.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c
index 1b50f8160013..59eb0e97adef 100644
--- a/drivers/edac/xgene_edac.c
+++ b/drivers/edac/xgene_edac.c
@@ -1845,7 +1845,6 @@ static int xgene_edac_probe(struct platform_device *pdev)
{
struct xgene_edac *edac;
struct device_node *child;
- struct resource *res;
int rc;
edac = devm_kzalloc(&pdev->dev, sizeof(*edac), GFP_KERNEL);
@@ -1903,8 +1902,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_ioremap_resource(pdev, 0);
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