lkml.org 
[lkml]   [2013]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 08/12] drm: exynos: hdmi: simplify extracting hpd-gpio from DT
Date
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 e36588a..5adb5c1 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -1858,23 +1858,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[] = {
--
1.7.9.5


\
 
 \ /
  Last update: 2013-10-21 16:41    [W:0.308 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site