From patchwork Tue Apr 15 09:27:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Stanislawski X-Patchwork-Id: 3990211 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E0F54BFF02 for ; Tue, 15 Apr 2014 09:27:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2BE8220222 for ; Tue, 15 Apr 2014 09:27:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2AD4020220 for ; Tue, 15 Apr 2014 09:27:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 80CF46E8A2; Tue, 15 Apr 2014 02:27:39 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id A388A6E8A2 for ; Tue, 15 Apr 2014 02:27:38 -0700 (PDT) Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4200AUGFM11G30@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Tue, 15 Apr 2014 18:27:37 +0900 (KST) X-AuditID: cbfee61a-b7fb26d00000724f-b9-534cfb89ba5c Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id AA.97.29263.98BFC435; Tue, 15 Apr 2014 18:27:37 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N42001CMFLM6080@mmp2.samsung.com>; Tue, 15 Apr 2014 18:27:37 +0900 (KST) From: Tomasz Stanislawski To: linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org Subject: [PATCHv2 1/4] drm: exynos: hdmi: simplify extracting hpd-gpio from DT Date: Tue, 15 Apr 2014 11:27:17 +0200 Message-id: <1397554040-4037-2-git-send-email-t.stanislaws@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1397554040-4037-1-git-send-email-t.stanislaws@samsung.com> References: <1397554040-4037-1-git-send-email-t.stanislaws@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCLMWRmVeSWpSXmKPExsVy+t9jQd3O3z7BBj3zVCw2zljPanHl63s2 i0n3J7BYvLh3kcXibNMbdoueDVtZLWac38dkcXGdvMWE6WtZLKYsOsxq0br3CLvFjMkv2SzW z3jNYjGv/SWrA5/HmnlrGD02repk87jffZzJo2/LKkaPz5vkAlijuGxSUnMyy1KL9O0SuDKW /tjOUrCWs+LhoZvsDYz32bsYOTgkBEwkls927WLkBDLFJC7cW8/WxcjFISQwnVHiyOuTbCAJ IYEuJokr30VBbDag+mNLPjOC2CICqRLzV3cwgzQwCyxgkpi6tYcdJCEs4CfROe0DE4jNIqAq 0bX0PJjNK+AuMevkVBaIbYoS3c8msIEcwSngIXH5ajDELneJjzfXME1g5F3AyLCKUTS1ILmg OCk911CvODG3uDQvXS85P3cTIzgsn0ntYFzZYHGIUYCDUYmH12OCT7AQa2JZcWXuIUYJDmYl Ed4vL4FCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeQ+0WgcKCaQnlqRmp6YWpBbBZJk4OKUaGN33 pEVW6Fz8lzHp//6j1gnTrk0NvSMfu/psEF+8p9eaPvOVbNk6O3tntKR8quLyLtz3ftK9uaW+ y9nfs6TsYd2/495d4Xf6hhY50YfYu5MOBAvVFJWw/i88LvGEdYES0wrRfP7Lpxk57rj4qPDP Eq7c0TSHVfjm1rMK/QaCXb1xpWd+bDlkpsRSnJFoqMVcVJwIACnnIGxHAgAA Cc: Tomasz Stanislawski , pawel.moll@arm.com, b.zolnierkie@samsung.com, sw0312.kim@samsung.com, kyungmin.park@samsung.com, robh+dt@kernel.org, rahul.sharma@samsung.com, m.chehab@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 9a6d652..47c6e85 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -2016,23 +2016,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(np, "hpd-gpio", 0); + if (!gpio_is_valid(pd->hpd_gpio)) { 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[] = {