[PATCH 3/4] drm/imx: Remove goto label that are only used once

Laurentiu Palcu laurentiu.palcu at oss.nxp.com
Wed Aug 6 07:32:44 UTC 2025


Hi Liao,

On Tue, Aug 05, 2025 at 03:46:18PM +0800, Liao Yuanhong wrote:
> Remove unnecessary goto labels to improve code readability. 
> 
> Signed-off-by: Liao Yuanhong <liaoyuanhong at vivo.com>
> ---
>  drivers/gpu/drm/imx/dcss/dcss-drv.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/dcss/dcss-drv.c b/drivers/gpu/drm/imx/dcss/dcss-drv.c
> index 19b027cc1dc4..3df060a2f6bf 100644
> --- a/drivers/gpu/drm/imx/dcss/dcss-drv.c
> +++ b/drivers/gpu/drm/imx/dcss/dcss-drv.c
> @@ -65,15 +65,11 @@ static int dcss_drv_platform_probe(struct platform_device *pdev)
>  	if (IS_ERR(mdrv->kms)) {
>  		err = PTR_ERR(mdrv->kms);
>  		dev_err_probe(dev, err, "Failed to initialize KMS\n");
> -		goto dcss_shutoff;
> +		dcss_dev_destroy(mdrv->dcss);
> +		return err;

I suppose you can now get rid of 'err' variable and 'return
dev_err_probe()' directly.

Thanks,
Laurentiu

>  	}
>  
>  	return 0;
> -
> -dcss_shutoff:
> -	dcss_dev_destroy(mdrv->dcss);
> -
> -	return err;
>  }
>  
>  static void dcss_drv_platform_remove(struct platform_device *pdev)
> -- 
> 2.34.1
> 


More information about the dri-devel mailing list