From patchwork Wed Aug 24 02:25:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milo Kim X-Patchwork-Id: 9296757 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 84411607D0 for ; Wed, 24 Aug 2016 02:28:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77FA828DDF for ; Wed, 24 Aug 2016 02:28:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C9CB28DEA; Wed, 24 Aug 2016 02:28:30 +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=ham 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 C293828DDF for ; Wed, 24 Aug 2016 02:28:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753888AbcHXC2U (ORCPT ); Tue, 23 Aug 2016 22:28:20 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:34938 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753199AbcHXC1i (ORCPT ); Tue, 23 Aug 2016 22:27:38 -0400 Received: by mail-pa0-f68.google.com with SMTP id cf3so228584pad.2; Tue, 23 Aug 2016 19:27:26 -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=v7b5QQ78iU+XYG7EkuX+qJWDgxC/53Tz12LO/Jb3hWE=; b=OLS6JkvHAGp9PJbr3LXfMz0/vmJGUlhCBcqpn/eyponsLPAZRfkgWbyl3lb3iawEic ecucJbuYAyUQ6ioipHVeKE2OD1DZiT12N6eiPIFej2kQj1bKkvQlqf/sD2iv6mSBpHWa zFQn/ML1nvfV+UNjxTtFAqeMYR7dA0sM6H+UXlnm4WnRwY4S3cs6k1VA+spifjzOjbHA 3OQX+kVYE3v54CE8E/+n/fQylOz6UlW8NtQIfHB10rF/xFwTAFVU83YbzCDNOdOG/NWK rg6QBxfHtmWNpnR06cIMVguRaSyMjWep0vP0wKqT2F4Ui/NT3/f5UufqhdAzo+oknv0g fYpA== 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=v7b5QQ78iU+XYG7EkuX+qJWDgxC/53Tz12LO/Jb3hWE=; b=ar6s5SNHlp85XVkJ4/Fj7vOXVPLka6AteqLv3Zz8kijZXMe+fJu+aEYYJ+8DKzR7Td +AML66WesF3yxy07Kw1VsX8f4+htR41WjCvHRSR6rigz1w0vEIyfUYBu54PC5UcLFQ6p 3TG/8/AnGjVcM2F4EMAYCiOhmfbDRI99c+1f9NN1idBWNS5W53AhvYIoGqBrc4JzT/5d ekrNyY6UZ8+Y/zx3VTCX7B8s7vVExtrqZwcHiwkUjPaEsmkabe99smOrk7FJF6dn2Wu5 VW6ctj9GYmDziCPFO+HyCOWg2AMt4jwPuMNydFMgS40vRemRYSHw1dUwKSTBtLU0O330 JPug== X-Gm-Message-State: AE9vXwPURdbtifGwGoBVkuOoNFbHmirpWZ5+mg4tCabCOies+efvzhZ5wUTYpqSxuK4THw== X-Received: by 10.66.100.162 with SMTP id ez2mr1080775pab.123.1472005645544; Tue, 23 Aug 2016 19:27:25 -0700 (PDT) Received: from localhost.localdomain ([39.7.47.2]) by smtp.gmail.com with ESMTPSA id d185sm8701667pfd.80.2016.08.23.19.27.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Aug 2016 19:27:25 -0700 (PDT) From: Milo Kim To: Kukjin Kim , Krzysztof Kozlowski , David Airlie Cc: Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Rob Herring , 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 v2 4/4] gpu: drm: exynos_hdmi: Use consolidated function on binding PHY DT property Date: Wed, 24 Aug 2016 11:25:24 +0900 Message-Id: <1472005524-3489-5-git-send-email-woogyom.kim@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472005524-3489-1-git-send-email-woogyom.kim@gmail.com> References: <1472005524-3489-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 'phy' parsing in single function. And it also removes goto condition. Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: David Airlie Cc: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Cc: Kyungmin Park 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 | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 6a636f2..bb2d6d4 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -1778,11 +1778,22 @@ static struct device_node *hdmi_ddc_dt_binding(struct device *dev) return np; } -static struct device_node *hdmi_legacy_phy_dt_binding(struct device *dev) +static struct device_node *hdmi_phy_dt_binding(struct device *dev) { const char *compatible_str = "samsung,exynos4212-hdmiphy"; + struct device_node *np; + + np = of_find_compatible_node(NULL, NULL, compatible_str); + if (np) + return np; + + np = of_parse_phandle(dev->of_node, "phy", 0); + if (!np) + return NULL; + + of_node_put(dev->of_node); - return of_find_compatible_node(NULL, NULL, compatible_str); + return np; } static int hdmi_probe(struct platform_device *pdev) @@ -1829,19 +1840,13 @@ static int hdmi_probe(struct platform_device *pdev) return -EPROBE_DEFER; } - phy_node = hdmi_legacy_phy_dt_binding(dev); - if (phy_node) - goto out_get_phy_port; - - phy_node = of_parse_phandle(dev->of_node, "phy", 0); + phy_node = hdmi_phy_dt_binding(dev); if (!phy_node) { DRM_ERROR("Failed to find hdmiphy node in device tree\n"); ret = -ENODEV; goto err_ddc; } - of_node_put(dev->of_node); -out_get_phy_port: if (hdata->drv_data->is_apb_phy) { hdata->regs_hdmiphy = of_iomap(phy_node, 0); if (!hdata->regs_hdmiphy) {