From patchwork Mon Apr 14 10:07:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Stanislawski X-Patchwork-Id: 3979221 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6AA339F3D5 for ; Mon, 14 Apr 2014 10:07:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD4A32010E for ; Mon, 14 Apr 2014 10:07:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B9F3D2018E for ; Mon, 14 Apr 2014 10:07:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 75B076E752; Mon, 14 Apr 2014 03:07:19 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org 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) X-AuditID: cbfec7f5-b7fc96d000004885-5d-534bb353a1db Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 35.FE.18565.353BB435; Mon, 14 Apr 2014 11:07:15 +0100 (BST) Received: from [106.116.147.108] by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N40005DNMS35P80@eusync2.samsung.com>; Mon, 14 Apr 2014 11:07:15 +0100 (BST) Message-id: <534BB34F.7040308@samsung.com> Date: Mon, 14 Apr 2014 12:07:11 +0200 From: Tomasz Stanislawski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-version: 1.0 To: DRI mailing list , linux-samsung-soc Subject: [PATCH] drm: exynos: hdmi: simplify extracting hpd-gpio from DT X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrALMWRmVeSWpSXmKPExsVy+t/xK7rBm72DDX4e0bPoPXeSyWLjjPWs Fle+vmezmHR/AovFi3sXWSx6F1xlszjb9IbdYsb5fUwWMya/ZLNYP+M1iwOXx/ZvD1g97ncf Z/Lo27KK0ePzJrkAligum5TUnMyy1CJ9uwSujPe/frAUzOas6J05n7GB8TJ7FyMnh4SAicTt fe+YIGwxiQv31rN1MXJxCAksZZS4s+QXI4TzGciZsIANpIpXQEti0aS9rCA2i4CqxMV3i8Am sQFNOrbkMyOILSoQITF34maoekGJH5PvsYDYIgL5Ejee7wPbwCwwiVni67M7QKs5OIQFPCUm nAkCqWEWUJeYNG8RM4QtL7F5zVvmCYx8s5CMmoWkbBaSsgWMzKsYRVNLkwuKk9JzjfSKE3OL S/PS9ZLzczcxQkL56w7GpcesDjEKcDAq8fB2zPEOFmJNLCuuzD3EKMHBrCTCuy3DK1iINyWx siq1KD++qDQntfgQIxMHp1QD415ROb8vW0IU9JT/iHysebGDRXh1b/XCsC/q1jPjq+JFrlz+ 8EV03UwR1swulYOshdET0uJaG/9qWub8WSJyeMPDDzl/3XsbXC63u79ImlI3Y/uMe4//u9g9 tXu6Voj1p/Z/de2P+vHGE7wupH+c536Mi2Hjoz4WP7Gs3ELR33tspzIw/tC7o8RSnJFoqMVc VJwIAAKkCmdDAgAA Cc: =?UTF-8?B?6rmA6rWt7KeE?= , Bartlomiej Zolnierkiewicz , =?UTF-8?B?6rmA7Iq57Jqw?= , =?UTF-8?B?J+uwleqyveuvvCc=?= 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 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 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[] = {