All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]  drm: exynos: hdmi: simplify extracting hpd-gpio from DT
@ 2014-04-14 10:07 Tomasz Stanislawski
  2014-04-14 12:05 ` Joonyoung Shim
  0 siblings, 1 reply; 2+ messages in thread
From: Tomasz Stanislawski @ 2014-04-14 10:07 UTC (permalink / raw)
  To: DRI mailing list, linux-samsung-soc
  Cc: 김국진, Bartlomiej Zolnierkiewicz,
	김승우, '박경민'

This patch eliminates redundant checks while retrieving HPD gpio from DT during
HDMI's probe().

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c |   13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index e1a2e88..300c2af 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -2011,23 +2011,18 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
 {
 	struct device_node *np = dev->of_node;
 	struct s5p_hdmi_platform_data *pd;
-	u32 value;

 	pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
 	if (!pd)
-		goto err_data;
+		return NULL;

-	if (!of_find_property(np, "hpd-gpio", &value)) {
+	pd->hpd_gpio = of_get_named_gpio_flags(np, "hpd-gpio", 0, NULL);
+	if (pd->hpd_gpio < 0) {
 		DRM_ERROR("no hpd gpio property found\n");
-		goto err_data;
+		return NULL;
 	}

-	pd->hpd_gpio = of_get_named_gpio(np, "hpd-gpio", 0);
-
 	return pd;
-
-err_data:
-	return NULL;
 }

 static struct of_device_id hdmi_match_types[] = {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH]  drm: exynos: hdmi: simplify extracting hpd-gpio from DT
  2014-04-14 10:07 [PATCH] drm: exynos: hdmi: simplify extracting hpd-gpio from DT Tomasz Stanislawski
@ 2014-04-14 12:05 ` Joonyoung Shim
  0 siblings, 0 replies; 2+ messages in thread
From: Joonyoung Shim @ 2014-04-14 12:05 UTC (permalink / raw)
  To: Tomasz Stanislawski, DRI mailing list, linux-samsung-soc
  Cc: Inki Dae, 김승우,
	'박경민', David Airlie,
	김국진, Tomasz Figa, Bartlomiej Zolnierkiewicz

Hi Tomasz,

On 04/14/2014 07:07 PM, Tomasz Stanislawski wrote:
> This patch eliminates redundant checks while retrieving HPD gpio from DT during
> HDMI's probe().
>
> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
> ---
>   drivers/gpu/drm/exynos/exynos_hdmi.c |   13 ++++---------
>   1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index e1a2e88..300c2af 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -2011,23 +2011,18 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
>   {
>   	struct device_node *np = dev->of_node;
>   	struct s5p_hdmi_platform_data *pd;
> -	u32 value;
>
>   	pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
>   	if (!pd)
> -		goto err_data;
> +		return NULL;
>
> -	if (!of_find_property(np, "hpd-gpio", &value)) {
> +	pd->hpd_gpio = of_get_named_gpio_flags(np, "hpd-gpio", 0, NULL);

This is same with
pd->hpd_gpio = of_get_named_gpio(np, "hpd-gpio", 0);

> +	if (pd->hpd_gpio < 0) {

How about use gpio_is_valid()?

>   		DRM_ERROR("no hpd gpio property found\n");
> -		goto err_data;
> +		return NULL;
>   	}
>
> -	pd->hpd_gpio = of_get_named_gpio(np, "hpd-gpio", 0);
> -
>   	return pd;
> -
> -err_data:
> -	return NULL;
>   }
>
>   static struct of_device_id hdmi_match_types[] = {
>
>

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-14 12:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-14 10:07 [PATCH] drm: exynos: hdmi: simplify extracting hpd-gpio from DT Tomasz Stanislawski
2014-04-14 12:05 ` Joonyoung Shim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.