[PATCH 12/18] drm/tegra: dpaux: Convert to devm_platform_ioremap_resource()

Thierry Reding thierry.reding at gmail.com
Fri Jul 7 12:28:19 UTC 2023


On Fri, Jul 07, 2023 at 03:20:28PM +0800, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li at vivo.com>
> ---
>  drivers/gpu/drm/tegra/dpaux.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c
> index 4d2677dcd831..f120897ce4b3 100644
> --- a/drivers/gpu/drm/tegra/dpaux.c
> +++ b/drivers/gpu/drm/tegra/dpaux.c
> @@ -447,7 +447,6 @@ static const struct pinmux_ops tegra_dpaux_pinmux_ops = {
>  static int tegra_dpaux_probe(struct platform_device *pdev)
>  {
>  	struct tegra_dpaux *dpaux;
> -	struct resource *regs;
>  	u32 value;
>  	int err;
>  
> @@ -461,14 +460,13 @@ static int tegra_dpaux_probe(struct platform_device *pdev)
>  	INIT_LIST_HEAD(&dpaux->list);
>  	dpaux->dev = &pdev->dev;
>  
> -	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	dpaux->regs = devm_ioremap_resource(&pdev->dev, regs);
> +	dpaux->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(dpaux->regs))
>  		return PTR_ERR(dpaux->regs);
>  
>  	dpaux->irq = platform_get_irq(pdev, 0);
>  	if (dpaux->irq < 0)
> -		return -ENXIO;
> +		return dpaux->irq;

This change has nothing to do with what the commit message says. It
looks correct, but it should be a separate patch.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20230707/203b54d5/attachment.sig>


More information about the dri-devel mailing list