From patchwork Mon Jul 3 07:27:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 9822061 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 98DAF60237 for ; Mon, 3 Jul 2017 07:28:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86E9D26E51 for ; Mon, 3 Jul 2017 07:28:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A0D12852D; Mon, 3 Jul 2017 07:28:06 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 D9CF026E51 for ; Mon, 3 Jul 2017 07:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752342AbdGCH2F (ORCPT ); Mon, 3 Jul 2017 03:28:05 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:58102 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752291AbdGCH2E (ORCPT ); Mon, 3 Jul 2017 03:28:04 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20170703072802epoutp03ab664eb1763103b1b92cc23a5d60873a~NwWMR836K1754717547epoutp032; Mon, 3 Jul 2017 07:28:02 +0000 (GMT) Received: from epsmges1p3.samsung.com (unknown [182.195.40.66]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20170703072801epcas1p374562935c480544adaef23297389db4b~NwWL8fXLr2919729197epcas1p3H; Mon, 3 Jul 2017 07:28:01 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id 41.CB.06724.102F9595; Mon, 3 Jul 2017 16:28:01 +0900 (KST) Received: from epsmgms2p1.samsung.com (unknown [182.195.42.79]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20170703072801epcas1p3cbabe54a8457771f906378b1036294b6~NwWLtX8qi0089500895epcas1p35; Mon, 3 Jul 2017 07:28:01 +0000 (GMT) X-AuditID: b6c32a37-f79c96d000001a44-1d-5959f201e51e Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 60.88.05076.102F9595; Mon, 3 Jul 2017 16:28:01 +0900 (KST) Received: from localhost.localdomain ([10.113.62.206]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OSI00CK67EOIBA0@mmp1.samsung.com>; Mon, 03 Jul 2017 16:28:01 +0900 (KST) From: Inki Dae To: dri-devel@lists.freedesktop.org Cc: linux-samsung-soc@vger.kernel.org, Inki Dae , Shuah Khan Subject: [PATCH 1/2] drm/exynos: dsi: move of_drm_find_bridge call into probe Date: Mon, 03 Jul 2017 16:27:58 +0900 Message-id: <1499066879-13241-2-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1499066879-13241-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrJKsWRmVeSWpSXmKPExsWy7bCmvi7jp8hIgyl7jC2ufH3PZjHp/gQW ixnn9zFZTP3ygcWBxeN+93Emjy39d9k9+rasYvT4vEkugCUq1SYjNTEltUghNS85PyUzL91W yTs43jne1MzAUNfQ0sJcSSEvMTfVVsnFJ0DXLTMHaKWSQlliTilQKCCx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bGCUaf81ngnB+MEps3L+JEaSKTUBVYuKK +2AdIgLKEn8nrgKLMwvkScw6OZkVxBYW8JXYtvIUO4jNAlT/+sxxsDivgIvE05u9jBDb5CRO HoOo5xRwlXix+DMLiC0EVPP++SfWCYy8CxgZVjFypRYU56bnFhsVGG5iBAbktsNa/jsYf5yN PsQowMGoxMP7ojgyUog1say4MvcQowQHs5II74wXQCHelMTKqtSi/Pii0pzU4kOMpkCnTGSW Ek3OB0ZLXkm8oYmlkYmBmZmhkYGxmZI474TALxFCAumJJanZqakFqUUwfUwcnFINjAtnCASx W//fvMft8iT3mYxPVvys0019/qp5c/n1oi17jUSjqi2Dt28t9l/d99IwsnxZbehy+5u8U9jm 2jDq/0hifPGsh7vJUCh+mf1NxbNcB6Wkp9+Y7SZmtObY/hk/V8ZU3DOWZdry5O7q/atC/q4Q zVmq2fGB1fRi7Otlnwp2yvZdr1MW9VNiKc5INNRiLipOBACpdKW8XgIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170703072801epcas1p3cbabe54a8457771f906378b1036294b6 X-Msg-Generator: CA X-Sender-IP: 182.195.42.79 X-Local-Sender: =?UTF-8?B?64yA7J246riwG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbU2VuaW9yIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?SW5raSBEYWUbVGl6ZW4gUGxhdGZvcm0gTGFiLhtTYW1zdW5n?= =?UTF-8?B?IEVsZWN0cm9uaWNzG1NlbmlvciBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG1RFTEUbQzEwVjgxMTE=?= CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20170703072801epcas1p3cbabe54a8457771f906378b1036294b6 X-RootMTR: 20170703072801epcas1p3cbabe54a8457771f906378b1036294b6 References: <1499066879-13241-1-git-send-email-inki.dae@samsung.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 This patch moves of_drm_find_bridge call into probe. It doesn't need to call of_drm_find_bridge function every time bind callback is called. It's enough to call this funcation at probe one time. Suggested-by: Inki Dae Signed-off-by: Shuah Khan Signed-off-by: Inki Dae --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index b6a46d9..2412b23 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1661,7 +1661,6 @@ static int exynos_dsi_bind(struct device *dev, struct device *master, struct drm_encoder *encoder = dev_get_drvdata(dev); struct exynos_dsi *dsi = encoder_to_dsi(encoder); struct drm_device *drm_dev = data; - struct drm_bridge *bridge; int ret; ret = exynos_drm_crtc_get_pipe_from_type(drm_dev, @@ -1685,12 +1684,6 @@ static int exynos_dsi_bind(struct device *dev, struct device *master, return ret; } - if (dsi->bridge_node) { - bridge = of_drm_find_bridge(dsi->bridge_node); - if (bridge) - drm_bridge_attach(encoder, bridge, NULL); - } - return mipi_dsi_host_register(&dsi->dsi_host); } @@ -1798,6 +1791,18 @@ static int exynos_dsi_probe(struct platform_device *pdev) platform_set_drvdata(pdev, &dsi->encoder); + if (dsi->bridge_node) { + struct drm_bridge *bridge; + + bridge = of_drm_find_bridge(dsi->bridge_node); + if (!bridge) + return -EPROBE_DEFER; + + of_node_put(dsi->bridge_node); + drm_bridge_attach(&dsi->encoder, bridge, NULL); + } + + pm_runtime_enable(dev); return component_add(dev, &exynos_dsi_component_ops); @@ -1805,10 +1810,6 @@ static int exynos_dsi_probe(struct platform_device *pdev) static int exynos_dsi_remove(struct platform_device *pdev) { - struct exynos_dsi *dsi = platform_get_drvdata(pdev); - - of_node_put(dsi->bridge_node); - pm_runtime_disable(&pdev->dev); component_del(&pdev->dev, &exynos_dsi_component_ops);