From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomasz Stanislawski Subject: [PATCH] drm: exynos: hdmi: simplify extracting hpd-gpio from DT Date: Mon, 14 Apr 2014 12:07:11 +0200 Message-ID: <534BB34F.7040308@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by gabe.freedesktop.org (Postfix) with ESMTP id 616376E752 for ; Mon, 14 Apr 2014 03:07:18 -0700 (PDT) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4000JT4MS37G00@mailout1.w1.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 14 Apr 2014 11:07:15 +0100 (BST) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: DRI mailing list , linux-samsung-soc Cc: =?UTF-8?B?6rmA6rWt7KeE?= , Bartlomiej Zolnierkiewicz , =?UTF-8?B?6rmA7Iq57Jqw?= , =?UTF-8?B?J+uwleqyveuvvCc=?= 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 | 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[] = {