diff mbox

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

Message ID 1353642119-10253-3-git-send-email-sachin.kamat@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sachin Kamat Nov. 23, 2012, 3:41 a.m. UTC
devm_gpio_request is device managed and makes error handling and exit code
simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

Comments

Inki Dae Nov. 23, 2012, 6:51 a.m. UTC | #1
> -----Original Message-----
> From: Sachin Kamat [mailto:sachin.kamat@linaro.org]
> Sent: Friday, November 23, 2012 12:42 PM
> To: dri-devel@lists.freedesktop.org
> Cc: inki.dae@samsung.com; jy0922.shim@samsung.com; airlied@linux.ie;
> sachin.kamat@linaro.org; patches@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@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
Sachin Kamat Nov. 23, 2012, 7:03 a.m. UTC | #2
On 23 November 2012 12:21, Inki Dae <inki.dae@samsung.com> wrote:
[snip]

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

OK. I will update and re-send.

>
> 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. :)

Generally, the accepted practice is to combine patches if they do
similar changes in the same file.
Else, separate patches is preferred as it makes things easier for
reviewers and maintainer by improving readability and less rework
effort.
Since you have specifically requested for combining the patches I will
squash patches related to clk_get together and resend the series.

>
> Thanks,
> Inki Dae
>
diff mbox

Patch

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);
 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 */