From patchwork Wed Jul 5 08:18:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 9826099 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 37E2F602F0 for ; Wed, 5 Jul 2017 08:18:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C9A62621B for ; Wed, 5 Jul 2017 08:18:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 200AF2785D; Wed, 5 Jul 2017 08:18:48 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2C2312621B for ; Wed, 5 Jul 2017 08:18:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E52BE89DFA; Wed, 5 Jul 2017 08:18:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTPS id C75B089DFA for ; Wed, 5 Jul 2017 08:18:44 +0000 (UTC) Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20170705081842epoutp0290d820e2ab9e6b63f7c7d72c5a932fa8~OYVAqpwNM0403504035epoutp025; Wed, 5 Jul 2017 08:18:42 +0000 (GMT) Received: from epsmges1p3.samsung.com (unknown [182.195.40.70]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20170705081842epcas1p19649966a18277804b1303c6137390552~OYVAZBKiJ1893118931epcas1p1k; Wed, 5 Jul 2017 08:18:42 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id 1B.62.06724.2E0AC595; Wed, 5 Jul 2017 17:18:42 +0900 (KST) Received: from epsmgms2p1.samsung.com (unknown [182.195.42.79]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20170705081842epcas1p46d9f6868ad2f25712c8d41ae6ecd0358~OYVAMdjJZ2982529825epcas1p4p; Wed, 5 Jul 2017 08:18:42 +0000 (GMT) X-AuditID: b6c32a37-f79c96d000001a44-a7-595ca0e29538 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1.samsung.com (Symantec Messaging Gateway) with SMTP id A8.64.05076.2E0AC595; Wed, 5 Jul 2017 17:18:42 +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 <0OSL007X7Z35G8C0@mmp1.samsung.com>; Wed, 05 Jul 2017 17:18:42 +0900 (KST) From: Inki Dae To: dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm/exynos: mic: add a bridge at probe Date: Wed, 05 Jul 2017 17:18:23 +0900 Message-id: <1499242703-19153-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprKKsWRmVeSWpSXmKPExsWy7bCmvu6jBTGRBotWKFtc+fqezWLS/Qks FjPO72NyYPa4332cyaNvyypGj8+b5AKYo1JtMlITU1KLFFLzkvNTMvPSbZW8g+Od403NDAx1 DS0tzJUU8hJzU22VXHwCdN0y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ptqA2GwCqhITV9wHqxERUJb4O3EVI4jN LOAmsfj0chYQW1jASuLUnlVgNgtQ/fXXf8FsXgEXibPdlxkhdslJnDw2mXUCI/cCRoZVjFyp BcW56bnFRgWGmxiBgbTtsJb/DsYfZ6MPMQpwMCrx8H64FB0pxJpYVlyZe4hRgoNZSYS3oCcm Uog3JbGyKrUoP76oNCe1+BCjKdDKicxSosn5wCDPK4k3NLE0MjEwMzM0MjA2UxLnnRD4JUJI ID2xJDU7NbUgtQimj4mDU6qBcZ9vn/Hs1YyXX959vCMw6bdoccREF91XV+pu3kgtmWnAO/fL 9pnH/Hb5PzLg3PmibMJbHb4FqbLXw/s8m57vNf2cbVLzYOKTHf+uyz/dw1h2sF9xi/6tCWs2 fS7XaDZ+ytflExljtvfommzRjiVKU/PWMDsuLDnzfhkXx+lfj2d92DRR/HrzT00lluKMREMt 5qLiRACMBZkQOgIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170705081842epcas1p46d9f6868ad2f25712c8d41ae6ecd0358 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: 20170705081842epcas1p46d9f6868ad2f25712c8d41ae6ecd0358 X-RootMTR: 20170705081842epcas1p46d9f6868ad2f25712c8d41ae6ecd0358 References: Cc: linux-samsung-soc@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch moves drm_bridge_add call into probe. It doesn't need to call drm_bridge_add call every time bind callback is called. Changelog v2 - moved drm_bridge_remove call into remove callback. - corrected description. Suggested-by: Andrzej Hajda Reviewed-by: Andrzej Hajda Signed-off-by: Inki Dae Reviewed-by: Hoegeun Kwon --- drivers/gpu/drm/exynos/exynos_drm_mic.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c index e457205..16bbee8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_mic.c +++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c @@ -340,16 +340,10 @@ static int exynos_mic_bind(struct device *dev, struct device *master, void *data) { struct exynos_mic *mic = dev_get_drvdata(dev); - int ret; - mic->bridge.funcs = &mic_bridge_funcs; - mic->bridge.of_node = dev->of_node; mic->bridge.driver_private = mic; - ret = drm_bridge_add(&mic->bridge); - if (ret) - DRM_ERROR("mic: Failed to add MIC to the global bridge list\n"); - return ret; + return 0; } static void exynos_mic_unbind(struct device *dev, struct device *master, @@ -365,8 +359,6 @@ static void exynos_mic_unbind(struct device *dev, struct device *master, already_disabled: mutex_unlock(&mic_mutex); - - drm_bridge_remove(&mic->bridge); } static const struct component_ops exynos_mic_component_ops = { @@ -461,6 +453,15 @@ static int exynos_mic_probe(struct platform_device *pdev) platform_set_drvdata(pdev, mic); + mic->bridge.funcs = &mic_bridge_funcs; + mic->bridge.of_node = dev->of_node; + + ret = drm_bridge_add(&mic->bridge); + if (ret) { + DRM_ERROR("mic: Failed to add MIC to the global bridge list\n"); + return ret; + } + pm_runtime_enable(dev); ret = component_add(dev, &exynos_mic_component_ops); @@ -479,8 +480,13 @@ static int exynos_mic_probe(struct platform_device *pdev) static int exynos_mic_remove(struct platform_device *pdev) { + struct exynos_mic *mic = platform_get_drvdata(pdev); + component_del(&pdev->dev, &exynos_mic_component_ops); pm_runtime_disable(&pdev->dev); + + drm_bridge_remove(&mic->bridge); + return 0; }