Skip to contentSkip to conversation

drm/mcde: Make use of the helper function devm_platform_ioremap_resource()

PATCH In review Cai Huoqing 2 participants 2 messages Aug 31, 2021 – Sep 7, 2021

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

PATCH 1/1 drm/mcde: Make use of the helper function devm_platform_ioremap_resource()

Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately

---
 drivers/gpu/drm/mcde/mcde_drv.c | 4 +---
 drivers/gpu/drm/mcde/mcde_dsi.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/mcde/mcde_drv.c +1 -3
index e60566a5739c..5b5afc6aaf8e 100644
@@ -276,7 +276,6 @@ static int mcde_probe(struct platform_device *pdev)
 	struct drm_device *drm;
 	struct mcde *mcde;
 	struct component_match *match = NULL;
-	struct resource *res;
 	u32 pid;
 	int irq;
 	int ret;
@@ -344,8 +343,7 @@ static int mcde_probe(struct platform_device *pdev)
 		goto clk_disable;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mcde->regs = devm_ioremap_resource(dev, res);
+	mcde->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mcde->regs)) {
 		dev_err(dev, "no MCDE regs\n");
 		ret = -EINVAL;
drivers/gpu/drm/mcde/mcde_dsi.c +1 -3
index 180ebbccbeda..5651734ce977 100644
@@ -1169,7 +1169,6 @@ static int mcde_dsi_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct mcde_dsi *d;
 	struct mipi_dsi_host *host;
-	struct resource *res;
 	u32 dsi_id;
 	int ret;
 
@@ -1187,8 +1186,7 @@ static int mcde_dsi_probe(struct platform_device *pdev)
 		return PTR_ERR(d->prcmu);
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	d->regs = devm_ioremap_resource(dev, res);
+	d->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(d->regs))
 		return PTR_ERR(d->regs);
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 5 lines · Cai Huoqing

Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately

Patch applied!

Yours,
Linus Walleij