[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <596b3bda-3bef-4e28-b9dd-08b96da97097@web.de>
Date: Tue, 6 Feb 2024 15:15:23 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Robin Murphy <robin.murphy@....com>, iommu@...ts.linux.dev,
kernel-janitors@...r.kernel.org, Jörg Rödel
<joro@...tes.org>, Will Deacon <will@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH v2] iommu/ipmmu-vmsa: Use devm_platform_ioremap_resource() in
ipmmu_probe()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 6 Feb 2024 15:00:23 +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/iommu/ipmmu-vmsa.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index ace1fc4bd34b..7e28aac1e383 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -1005,7 +1005,6 @@ static const struct of_device_id ipmmu_of_ids[] = {
static int ipmmu_probe(struct platform_device *pdev)
{
struct ipmmu_vmsa_device *mmu;
- struct resource *res;
int irq;
int ret;
@@ -1025,8 +1024,7 @@ static int ipmmu_probe(struct platform_device *pdev)
return ret;
/* Map I/O memory and request IRQ. */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- mmu->base = devm_ioremap_resource(&pdev->dev, res);
+ mmu->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(mmu->base))
return PTR_ERR(mmu->base);
--
2.43.0
Powered by blists - more mailing lists