[13/18] drm/stm: ltdc: Convert to devm_platform_ioremap_resource()

Message ID 20230707072034.48977-13-frank.li@vivo.com
State New
Headers
Series [01/18] drm/renesas: Convert to devm_platform_ioremap_resource() |

Commit Message

李扬韬 July 7, 2023, 7:20 a.m. UTC
  Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/gpu/drm/stm/ltdc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Comments

Raphael Gallais-Pou July 7, 2023, 1:37 p.m. UTC | #1
Hi

On 7/7/23 09:20, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  drivers/gpu/drm/stm/ltdc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)


Acked-by: Raphaël Gallais-Pou <raphael.gallais-pou@foss.st.com>

Thanks for your contribution,

Raphaël
  

Patch

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);