Skip to contentSkip to conversation

drm/tve200: Use devm_platform_ioremap_resource()

PATCH In review Yang Li 2 participants 2 messages Apr 21, 2023 – Apr 24, 2023

Subsystems (3)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 drm/tve200: Use devm_platform_ioremap_resource()

Convert platform_get_resource(),devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does.

---
 drivers/gpu/drm/tve200/tve200_drv.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/tve200/tve200_drv.c +1 -3
index abd557332b28..40b1168ad671 100644
@@ -156,7 +156,6 @@ static int tve200_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct tve200_drm_dev_private *priv;
 	struct drm_device *drm;
-	struct resource *res;
 	int irq;
 	int ret;
 
@@ -192,8 +191,7 @@ static int tve200_probe(struct platform_device *pdev)
 		goto clk_disable;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	priv->regs = devm_ioremap_resource(dev, res);
+	priv->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(priv->regs)) {
 		dev_err(dev, "%s failed mmio\n", __func__);
 		ret = -EINVAL;
Signature · 1 line
2.20.1.7.g153144c
#1 lore raw
Quoted 5 lines · Yang Li

Convert platform_get_resource(),devm_ioremap_resource() to a single call to devm_platform_ioremap_resource(), as this is exactly what this function does.

That's a nice optimization.
Patch applied!

Yours,
Linus Walleij