From patchwork Mon Oct 21 14:18:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Stanislawski X-Patchwork-Id: 3078191 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 B7485BF924 for ; Mon, 21 Oct 2013 14:26:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B002920171 for ; Mon, 21 Oct 2013 14:26:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8FF922014A for ; Mon, 21 Oct 2013 14:26:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6A189E71B8 for ; Mon, 21 Oct 2013 07:26:48 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B7B7E67BA for ; Mon, 21 Oct 2013 07:19:30 -0700 (PDT) Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MV000E2AVSHQYO0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 21 Oct 2013 23:19:29 +0900 (KST) X-AuditID: cbfee61b-b7fd56d000001fc6-88-526537f152f1 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id B2.C0.08134.1F735625; Mon, 21 Oct 2013 23:19:29 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MV000F8PVR0T800@mmp1.samsung.com>; Mon, 21 Oct 2013 23:19:29 +0900 (KST) From: Tomasz Stanislawski To: devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC 08/12] drm: exynos: hdmi: simplify extracting hpd-gpio from DT Date: Mon, 21 Oct 2013 16:18:27 +0200 Message-id: <1382365111-6533-9-git-send-email-t.stanislaws@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1382365111-6533-1-git-send-email-t.stanislaws@samsung.com> References: <1382365111-6533-1-git-send-email-t.stanislaws@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLLMWRmVeSWpSXmKPExsVy+t9jAd2P5qlBBrtvKlnMP3KO1eLK1/ds FpPuT2Cx6F1wlc3iwtMeNouzTW/YLS7vmsNmMeP8PiaLpxMusllMWXSY1eLwm3ZWixmTX7JZ rJ/xmsViXvtLVotjM5YwOvB73Lm2h83jfvdxJo++LasYPY7f2M7k8XmTXABrFJdNSmpOZllq kb5dAlfG3LMbmQrWclZcvv6dsYHxDnsXIyeHhICJxK4fT5ghbDGJC/fWs3UxcnEICSxilGia O48dwuliktiwdQ5YFRtQx7ElnxlBbBGBRIlfzXeZQYqYBQ4xSexumQJWJCzgI/FqVi+YzSKg KvFh6zMwm1fAXeJAzyOodfIST+/3sYHYnAIeEqdergUbKgRU8+7bPJYJjLwLGBlWMYqmFiQX FCel5xrpFSfmFpfmpesl5+duYgQH6jPpHYyrGiwOMQpwMCrx8Aa4pAQJsSaWFVfmHmKU4GBW EuGtMk0NEuJNSaysSi3Kjy8qzUktPsQozcGiJM57sNU6UEggPbEkNTs1tSC1CCbLxMEp1cDo 1/xPT+xJalE701Pj5rtT3K+XzGf5/r1VL4+psPeEsU3f/3VODhMztW9kLg1OObtuxV/ensLl q3a/SbRo6PKsW1yp9OiweNCkJt97DO5yF9RzG3SSlTwv3QoPePO0Q6Z4ysWcm3EPW20fRusf ybnuUpvpcnZOYZr3hPNpjzdOd/RZq8RrI63EUpyRaKjFXFScCAB6Vq7lUAIAAA== Cc: Tomasz Stanislawski , kgene.kim@samsung.com, mturquette@linaro.org, sw0312.kim@samsung.com, dri-devel@lists.freedesktop.org, kishon@ti.com, kyungmin.park@samsung.com, s.nawrocki@samsung.com, rahul.sharma@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.6 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 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[] = {