From patchwork Tue Aug 23 09:13:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milo Kim X-Patchwork-Id: 9295307 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 83E7A60757 for ; Tue, 23 Aug 2016 09:15:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7277128BED for ; Tue, 23 Aug 2016 09:15:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66B8E28BF4; Tue, 23 Aug 2016 09:15:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7246028BED for ; Tue, 23 Aug 2016 09:15:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757647AbcHWJPQ (ORCPT ); Tue, 23 Aug 2016 05:15:16 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35464 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752299AbcHWJOc (ORCPT ); Tue, 23 Aug 2016 05:14:32 -0400 Received: by mail-pf0-f194.google.com with SMTP id h186so7921785pfg.2; Tue, 23 Aug 2016 02:14:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Si7THXAdOLmcQ9AAuLZIr4UIzotsIiBCVr/cYwLVzMs=; b=s2qHLVtZ+xQ4hBdcbzujTKY65m5ASn4wKNoIkhqgHTLkz0ZvgShjCqY3N1eWp9/SPK rtKe6CgwMIuMUdQYdNSN22JqsTMOFP1T5FY7ZX/z3KMSN6Fhp1BvS69UxOJaTtUBmyMj SVSJ/2nWwJh2362/4rw1K9UUhpvfOOzBda3bRD8a8Z8oHPumJyCCXzLZUwAGpa/S4fTV fK1Mkcb6bFmR/tnc+sO78cT7a6GRFw6Nevilw6sS440d/s5rYHLgPtbOP0xgqVsiGmkw ghOKZFL4/kzwjXKSI38grLTvwaaAw+ET9SIiJBJeg92TZ4rroRC+JwkL9uorvzJ+FSL+ B0Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Si7THXAdOLmcQ9AAuLZIr4UIzotsIiBCVr/cYwLVzMs=; b=AmLT7HjofNOn3asHiT2mTow1cNr0T+2EDUKT/LWz0txpgzCJPBhASRIQPS3ULA0r5L esbf4nFJcObOQ8RD1+MRf91+IApIxpvnTG4MViwkUtlIurPR7XemTY0w4z58YHBezUVY 9TbwgbBgWeT1Ai+HXrhI2QJBR3sJCPTomMg0wlLVm7TGleWRFrasJifTI/3ariluH5ep Wd8T3PveGDS+Mpv4BnPJbTW1bu7Up5kMLotTdX75/tFI2ZUcX6Lhuts5r/pDxdXNKdSK ORlNzUOYppnnf3bepiC/NepfxDHTbAndzobqmzhiGuSAj/pcN2oJZ1c8SqLT8azi/ru7 fALA== X-Gm-Message-State: AEkoouuT8isB37tMWgWU25/qF1h1AQHPKQ81lShUT8z15XYuaPN24dZJp5XrdKdIENsvXA== X-Received: by 10.98.103.70 with SMTP id b67mr51699158pfc.30.1471943671208; Tue, 23 Aug 2016 02:14:31 -0700 (PDT) Received: from localhost.localdomain ([110.70.58.54]) by smtp.gmail.com with ESMTPSA id uz4sm3817375pac.13.2016.08.23.02.14.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Aug 2016 02:14:30 -0700 (PDT) From: Milo Kim To: Inki Dae , Joonyoung Shim , Seung-Woo Kim , Rob Herring Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Milo Kim Subject: [PATCH 3/4] gpu: drm: exynos_hdmi: Use consolidated function on binding DDC DT property Date: Tue, 23 Aug 2016 18:13:38 +0900 Message-Id: <1471943619-6102-4-git-send-email-woogyom.kim@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1471943619-6102-1-git-send-email-woogyom.kim@gmail.com> References: <1471943619-6102-1-git-send-email-woogyom.kim@gmail.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Handle legacy and raw 'ddc' parsing in single function. And it also removes goto condition. Cc: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Cc: Rob Herring Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Milo Kim --- drivers/gpu/drm/exynos/exynos_hdmi.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 2275efe..6a636f2 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -1760,7 +1760,7 @@ static const struct component_ops hdmi_component_ops = { .unbind = hdmi_unbind, }; -static struct device_node *hdmi_legacy_ddc_dt_binding(struct device *dev) +static struct device_node *hdmi_ddc_dt_binding(struct device *dev) { const char *compatible_str = "samsung,exynos4210-hdmiddc"; struct device_node *np; @@ -1769,7 +1769,13 @@ static struct device_node *hdmi_legacy_ddc_dt_binding(struct device *dev) if (np) return of_get_next_parent(np); - return NULL; + np = of_parse_phandle(dev->of_node, "ddc", 0); + if (!np) + return NULL; + + of_node_put(dev->of_node); + + return np; } static struct device_node *hdmi_legacy_phy_dt_binding(struct device *dev) @@ -1811,18 +1817,12 @@ static int hdmi_probe(struct platform_device *pdev) return ret; } - ddc_node = hdmi_legacy_ddc_dt_binding(dev); - if (ddc_node) - goto out_get_ddc_adpt; - - ddc_node = of_parse_phandle(dev->of_node, "ddc", 0); + ddc_node = hdmi_ddc_dt_binding(dev); if (!ddc_node) { DRM_ERROR("Failed to find ddc node in device tree\n"); return -ENODEV; } - of_node_put(dev->of_node); -out_get_ddc_adpt: hdata->ddc_adpt = of_find_i2c_adapter_by_node(ddc_node); if (!hdata->ddc_adpt) { DRM_ERROR("Failed to get ddc i2c adapter by node\n");