[PATCH 2/5] drm/exynos: Use devm_gpio_request in exynos_hdmi.c

Inki Dae inki.dae at samsung.com
Thu Nov 22 22:51:48 PST 2012



> -----Original Message-----
> From: Sachin Kamat [mailto:sachin.kamat at linaro.org]
> Sent: Friday, November 23, 2012 12:42 PM
> To: dri-devel at lists.freedesktop.org
> Cc: inki.dae at samsung.com; jy0922.shim at samsung.com; airlied at linux.ie;
> sachin.kamat at linaro.org; patches at linaro.org
> Subject: [PATCH 2/5] drm/exynos: Use devm_gpio_request in exynos_hdmi.c
> 
> devm_gpio_request is device managed and makes error handling and exit code
> simpler.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat at linaro.org>
> ---
>  drivers/gpu/drm/exynos/exynos_hdmi.c |    8 ++------
>  1 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c
> b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index 59839cc..3fe2d61 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -2428,7 +2428,7 @@ static int __devinit hdmi_probe(struct
> platform_device *pdev)
>  		goto err_resource;
>  	}
> 
> -	ret = gpio_request(hdata->hpd_gpio, "HPD");
> +	ret = devm_gpio_request(&pdev->dev, hdata->hpd_gpio, "HPD");
>  	if (ret) {
>  		DRM_ERROR("failed to request HPD gpio\n");
>  		goto err_resource;
> @@ -2438,7 +2438,7 @@ static int __devinit hdmi_probe(struct
> platform_device *pdev)
>  	if (i2c_add_driver(&ddc_driver)) {
>  		DRM_ERROR("failed to register ddc i2c driver\n");
>  		ret = -ENOENT;
> -		goto err_gpio;
> +		goto err_resource;
>  	}
> 
>  	hdata->ddc_port = hdmi_ddc;
> @@ -2501,8 +2501,6 @@ err_hdmiphy:
>  	i2c_del_driver(&hdmiphy_driver);
>  err_ddc:
>  	i2c_del_driver(&ddc_driver);
> -err_gpio:
> -	gpio_free(hdata->hpd_gpio);
>  err_resource:
>  	hdmi_resources_cleanup(hdata);

With cleanup to hdmi_resources_init, we can remove hdmi_resource_cleanup
function. So could you please re-send updated patches?

You've been submitting patches into too small pieces.
Because they are trivial enough and in the same context, please merge this
kind of patches as long as they are related with the same class or topics. I
think you can combine them. :)

Thanks,
Inki Dae

>  err_data:
> @@ -2522,8 +2520,6 @@ static int __devexit hdmi_remove(struct
> platform_device *pdev)
>  	free_irq(hdata->internal_irq, hdata);
>  	free_irq(hdata->external_irq, hdata);
> 
> -	gpio_free(hdata->hpd_gpio);
> -
>  	hdmi_resources_cleanup(hdata);
> 
>  	/* hdmiphy i2c driver */
> --
> 1.7.4.1



More information about the dri-devel mailing list