dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Joonyoung Shim <jy0922.shim@samsung.com>
To: Tomasz Stanislawski <t.stanislaws@samsung.com>,
	DRI mailing list <dri-devel@lists.freedesktop.org>,
	linux-samsung-soc <linux-samsung-soc@vger.kernel.org>
Cc: "Inki Dae" <inki.dae@samsung.com>, 김승우 <sw0312.kim@samsung.com>,
	'박경민' <kyungmin.park@samsung.com>,
	"David Airlie" <airlied@linux.ie>, 김국진 <kgene.kim@samsung.com>,
	"Tomasz Figa" <t.figa@samsung.com>,
	"Bartlomiej Zolnierkiewicz" <b.zolnierkie@samsung.com>
Subject: Re: [PATCH]  drm: exynos: hdmi: simplify extracting hpd-gpio from DT
Date: Mon, 14 Apr 2014 21:05:27 +0900	[thread overview]
Message-ID: <534BCF07.9060703@samsung.com> (raw)
In-Reply-To: <534BB34F.7040308@samsung.com>

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.

      reply	other threads:[~2014-04-14 12:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=534BCF07.9060703@samsung.com \
    --to=jy0922.shim@samsung.com \
    --cc=airlied@linux.ie \
    --cc=b.zolnierkie@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=sw0312.kim@samsung.com \
    --cc=t.figa@samsung.com \
    --cc=t.stanislaws@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox