[17/18] drm/arcpgu: Convert to devm_platform_ioremap_resource()

Message ID 20230707072034.48977-17-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/tiny/arcpgu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Comments

Alexey Brodkin July 7, 2023, 1:24 p.m. UTC | #1
Hi Yangtao,

> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Thanks for the improvement.

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>

> ---
>  drivers/gpu/drm/tiny/arcpgu.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
> index e5b10e41554a..3a5e66d909a4 100644
> --- a/drivers/gpu/drm/tiny/arcpgu.c
> +++ b/drivers/gpu/drm/tiny/arcpgu.c
> @@ -251,7 +251,6 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
>          struct device_node *encoder_node = NULL, *endpoint_node = NULL;
>          struct drm_connector *connector = NULL;
>          struct drm_device *drm = &arcpgu->drm;
> -       struct resource *res;
>          int ret;
>  
>          arcpgu->clk = devm_clk_get(drm->dev, "pxlclk");
> @@ -268,8 +267,7 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
>          drm->mode_config.max_height = 1080;
>          drm->mode_config.funcs = &arcpgu_drm_modecfg_funcs;
>  
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       arcpgu->regs = devm_ioremap_resource(&pdev->dev, res);
> +       arcpgu->regs = devm_platform_ioremap_resource(pdev, 0);
>          if (IS_ERR(arcpgu->regs))
>                  return PTR_ERR(arcpgu->regs);
>  
> --
> 2.39.0
  

Patch

diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
index e5b10e41554a..3a5e66d909a4 100644
--- a/drivers/gpu/drm/tiny/arcpgu.c
+++ b/drivers/gpu/drm/tiny/arcpgu.c
@@ -251,7 +251,6 @@  static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 	struct device_node *encoder_node = NULL, *endpoint_node = NULL;
 	struct drm_connector *connector = NULL;
 	struct drm_device *drm = &arcpgu->drm;
-	struct resource *res;
 	int ret;
 
 	arcpgu->clk = devm_clk_get(drm->dev, "pxlclk");
@@ -268,8 +267,7 @@  static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 	drm->mode_config.max_height = 1080;
 	drm->mode_config.funcs = &arcpgu_drm_modecfg_funcs;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	arcpgu->regs = devm_ioremap_resource(&pdev->dev, res);
+	arcpgu->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(arcpgu->regs))
 		return PTR_ERR(arcpgu->regs);