[06/18] drm: bridge: dw_hdmi: Use devm_platform_get_and_ioremap_resource()

Message ID 20230707072034.48977-6-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
  Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Neil Armstrong July 7, 2023, 7:27 a.m. UTC | #1
On 07/07/2023 09:20, Yangtao Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>   drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 7b66f362afd8..b2b320ba2196 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -3417,8 +3417,7 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
>   			return ERR_PTR(-EINVAL);
>   		}
>   
> -		iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -		hdmi->regs = devm_ioremap_resource(dev, iores);
> +		hdmi->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &iores);
>   		if (IS_ERR(hdmi->regs)) {
>   			ret = PTR_ERR(hdmi->regs);
>   			goto err_res;

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
  

Patch

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 7b66f362afd8..b2b320ba2196 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -3417,8 +3417,7 @@  struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
 			return ERR_PTR(-EINVAL);
 		}
 
-		iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-		hdmi->regs = devm_ioremap_resource(dev, iores);
+		hdmi->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &iores);
 		if (IS_ERR(hdmi->regs)) {
 			ret = PTR_ERR(hdmi->regs);
 			goto err_res;