From patchwork Tue Aug 23 09:13:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milo Kim X-Patchwork-Id: 9295319 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 834C860757 for ; Tue, 23 Aug 2016 09:17:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71C7628BED for ; Tue, 23 Aug 2016 09:17:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6650228BF4; Tue, 23 Aug 2016 09:17:28 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1C42528BED for ; Tue, 23 Aug 2016 09:17:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bc7oV-0004ae-Js; Tue, 23 Aug 2016 09:16:07 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bc7nM-0002OQ-9u for linux-arm-kernel@lists.infradead.org; Tue, 23 Aug 2016 09:14:58 +0000 Received: by mail-pf0-x244.google.com with SMTP id y134so7925766pfg.3 for ; Tue, 23 Aug 2016 02:14:35 -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=x4tvfp2+U2gpX+DOBpwAvYJfD635utYrcq2NToiwxb0=; b=lgUj+SMT60UbGmvhbdatqDEaYiaBycoxebnlhS+wPnvKDHZWvYiShxppb1ZDK84jNt wtiDkg9J/GDVVQjLs/gsZsVofFDfcrzoeHoKjsWGdJYB8tpvPcLBgsz+dN13MpXcpJfr kPHAPbJuQoihvlWNjRtPg+k0zcEyh/WWZsBIAt9F3PQLnj+P+HEo6lhqnPwQxYFqowf6 fuCMoMmvSwylY9BXvKhg43I17unmNmB1/JvnToE6DFS7LHD72wRS3kdQpcR469Fo8zsm ntTcwK8B1X5PTwhniVl7aSCgIblcnH0daa2x1TNhswnrpeMYIoyJNeBWI9YFPdTv+QLy GTkw== 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=x4tvfp2+U2gpX+DOBpwAvYJfD635utYrcq2NToiwxb0=; b=fhe2EYFLLLc4N+5oqVQxXa+OQhcJ2DmGY9h/vYl/ZglV8ScJCPxW0ohiD1xOg7b/nc mVAzMnZ+AmZgV9fvjjmkkCDN5/g3K2iOg2ESW5Hg8DpDa2gODmfZHi0tQTCp/q+7U6cO yd3nKy8C+5Kyp5Tdlh4zZbwvp/5/0BZHkXwOjzU54DeOmda+LGqg03mVlakqgAGP1wj3 qLrROMP+8qg09LgMXI5MaPHQyQclzJV7UGsilja1SPMwKtiSn9omJKrgkpYb6YFjsVvS FWuQjT2NlQuE6jtO+yqL6F+2+znAIT9y28Q2v5T0DoG6Z/z0U8XJAmQJW8vRMEOdjQPl fPqw== X-Gm-Message-State: AEkooutj3fyWf94vu3ZuXnnjOp5rIG9tiSnLwUQ8JErM7w5po22nc2UcgaVIV60CKUgs6w== X-Received: by 10.98.17.83 with SMTP id z80mr51727196pfi.38.1471943675548; Tue, 23 Aug 2016 02:14:35 -0700 (PDT) Received: from localhost.localdomain ([110.70.58.54]) by smtp.gmail.com with ESMTPSA id uz4sm3817375pac.13.2016.08.23.02.14.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Aug 2016 02:14:35 -0700 (PDT) From: Milo Kim To: Inki Dae , Joonyoung Shim , Seung-Woo Kim , Rob Herring Subject: [PATCH 4/4] gpu: drm: exynos_hdmi: Use consolidated function on binding PHY DT property Date: Tue, 23 Aug 2016 18:13:39 +0900 Message-Id: <1471943619-6102-5-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160823_021456_600920_08EDB4DA X-CRM114-Status: GOOD ( 14.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Milo Kim , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Handle legacy and raw 'phy' 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 | 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) {