From: Tomasz Stanislawski Subject: [PATCHv3 2/5] drm: exynos: hdmi: simplify extracting hpd-gpio from DT Date: Wed, 16 Apr 2014 17:12:55 +0200 Message-ID: <1397661178-6016-3-git-send-email-t.stanislaws@samsung.com> References: <1397661178-6016-1-git-send-email-t.stanislaws@samsung.com> Return-path: In-reply-to: <1397661178-6016-1-git-send-email-t.stanislaws@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org To: linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: m.chehab@samsung.com, robh+dt@kernel.org, inki.dae@samsung.com, kyungmin.park@samsung.com, sw0312.kim@samsung.com, t.figa@samsung.com, b.zolnierkie@samsung.com, jy0922.shim@samsung.com, rahul.sharma@samsung.com, pawel.moll@arm.com, l.stach@pengutronix.de, Tomasz Stanislawski List-Id: dri-devel@lists.freedesktop.org This patch eliminates redundant checks while retrieving HPD gpio from DT during HDMI's probe(). Signed-off-by: Tomasz Stanislawski --- drivers/gpu/drm/exynos/exynos_hdmi.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 482ca77..176e764 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -2012,15 +2012,12 @@ fail: static int drm_hdmi_dt_parse(struct hdmi_context *hdata, struct device_node *np) { - u32 value; - - if (!of_find_property(np, "hpd-gpio", &value)) { + hdata->hpd_gpio = of_get_named_gpio(np, "hpd-gpio", 0); + if (!gpio_is_valid(hdata->hpd_gpio)) { DRM_ERROR("no hpd gpio property found\n"); return -ENOENT; } - hdata->hpd_gpio = of_get_named_gpio(np, "hpd-gpio", 0); - return 0; } -- 1.7.9.5