[PATCH v2 14/19] drm/stm: ltdc: Convert to devm_platform_ioremap_resource()

From: Yangtao Li
Date: Sun Jul 09 2023 - 23:26:03 EST


Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@xxxxxxxx>
Acked-by: Raphaël Gallais-Pou <raphael.gallais-pou@xxxxxxxxxxx>
---
drivers/gpu/drm/stm/ltdc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index b8be4c1db423..734dca4d7dd8 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -1925,7 +1925,6 @@ int ltdc_load(struct drm_device *ddev)
struct drm_panel *panel;
struct drm_crtc *crtc;
struct reset_control *rstc;
- struct resource *res;
int irq, i, nb_endpoints;
int ret = -ENODEV;

@@ -1992,8 +1991,7 @@ int ltdc_load(struct drm_device *ddev)
reset_control_deassert(rstc);
}

- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- ldev->regs = devm_ioremap_resource(dev, res);
+ ldev->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(ldev->regs)) {
DRM_ERROR("Unable to get ltdc registers\n");
ret = PTR_ERR(ldev->regs);
--
2.39.0