Skip to contentSkip to conversation

EDAC/ti: use devm_platform_ioremap_resource to simplify probe

PATCH New Rosen Penev 1 participant 1 message Jul 29

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 EDAC/ti: use devm_platform_ioremap_resource to simplify probe

Replace the open-coded platform_get_resource() + devm_ioremap_resource() pair with the single helper devm_platform_ioremap_resource(), dropping the now-unused struct resource pointer.

Assisted-by opencode:hy3-free
---
 drivers/edac/ti_edac.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/edac/ti_edac.c +1 -3
index 39cc2ef9cac4..aac6bd6b0572 100644
@@ -231,7 +231,6 @@ static int ti_edac_probe(struct platform_device *pdev)
 {
 	int error_irq = 0, ret = -ENODEV;
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	void __iomem *reg;
 	struct mem_ctl_info *mci;
 	struct edac_mc_layer layers[1];
@@ -243,8 +242,7 @@ static int ti_edac_probe(struct platform_device *pdev)
 	if (!id)
 		return -ENODEV;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	reg = devm_ioremap_resource(dev, res);
+	reg = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(reg))
 		return PTR_ERR(reg);
 
Signature · 1 line
2.55.0