[PATCHv3 2/5] drm: exynos: hdmi: simplify extracting hpd-gpio from DT

Tomasz Stanislawski t.stanislaws at samsung.com
Wed Apr 16 08:12:55 PDT 2014


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

Signed-off-by: Tomasz Stanislawski <t.stanislaws at samsung.com>
---
 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



More information about the dri-devel mailing list