From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20401C433F5 for ; Thu, 21 Oct 2021 07:41:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 029CD60F6E for ; Thu, 21 Oct 2021 07:41:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231522AbhJUHn2 (ORCPT ); Thu, 21 Oct 2021 03:43:28 -0400 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]:59287 "EHLO wnew3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231769AbhJUHm5 (ORCPT ); Thu, 21 Oct 2021 03:42:57 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.west.internal (Postfix) with ESMTP id 61AB42B01344; Thu, 21 Oct 2021 03:40:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 21 Oct 2021 03:40:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=V2ECKODejaAuL jYVZGAyrUq9Ivh4nxZakGL2AQusnM8=; b=f7M/Yoi+B44CPGuKeKO21MHz1NxJC TAuwB27fI6oWQBlyIc+jTL7V4bVxRaw+1jrq8rwJfa9KAmigKSgjjG8Wj7k10cYo Kqnq1SqNJSlIX8i0JFOOdEjq7U9Vfvv8m/iL9EqN+vLpRRNzmnjDG+fMaG4EaGEw Rj8m9FpwFT5VXoR8Mi2MoBrfyqWF0xkWfk4uRXrx9hcZVuKXUch1QUo8gHuGDwNi 2axOZbZwpIlYqi8q+wIHudir/ey6tzERvSMEsv9kxGAHgo8Dl8uMJWxgLY2nN8RU UosbG9KpqKTklPqjbXD7RETxPa3ydGQTPRP7fmW76hNCgctw85y+BwOWA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=V2ECKODejaAuLjYVZGAyrUq9Ivh4nxZakGL2AQusnM8=; b=iwrVMsUd 1xyikiPls12Yxwm5YO5GVEdtYszhnKvWrSge8ZOmio1LMgFP4MlRziksVkH11oeN 8T4k8L2HGZgpA78oBB88+YFB1lPaOu5xHI7AETl+OG6LNQq48mTUfCDRjVo/Hl+T cVN7dFAPcp6V81wARL1vVa40EjY5OOd2tiwD79QxU2yaJHsYpBfFQH9PwcZnnVK8 A+SH3kk9dUa0I5+vkbTs71qTJB31JNcahsPRyDjc5w2GwfYrVfodtVTClzS6r45Y ljtzPssHO7vFWUTLGEsB72LbnDfJP2RT2BUhkgmQe1MO9BE8qCOd7IOPomvzPHkb DNxK1bCEtaohuQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddvhedgudduiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveev heehvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 21 Oct 2021 03:40:39 -0400 (EDT) From: Maxime Ripard To: Laurent Pinchart , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Sam Ravnborg , Daniel Vetter , David Airlie , Thierry Reding , Andrzej Hajda , Robert Foss , Neil Armstrong , Jonas Karlman , Jernej Skrabec Cc: Seung-Woo Kim , Xinliang Liu , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Tian Tao , freedreno@lists.freedesktop.org, Chen Feng , Joonyoung Shim , Kyungmin Park , John Stultz , Rob Clark , linux-arm-msm@vger.kernel.org, Sean Paul , Inki Dae , Xinwei Kong , dri-devel@lists.freedesktop.org Subject: [PATCH v5 10/21] drm/bridge: lt9611uxc: Register and attach our DSI device at probe Date: Thu, 21 Oct 2021 09:39:36 +0200 Message-Id: <20211021073947.499373-11-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211021073947.499373-1-maxime@cerno.tech> References: <20211021073947.499373-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org In order to avoid any probe ordering issue, the best practice is to move the secondary MIPI-DSI device registration and attachment to the MIPI-DSI host at probe time. Let's do this. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard --- drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 31 +++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c index ab1a0c00aad8..33f9716da0ee 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c @@ -367,18 +367,6 @@ static int lt9611uxc_bridge_attach(struct drm_bridge *bridge, return ret; } - /* Attach primary DSI */ - lt9611uxc->dsi0 = lt9611uxc_attach_dsi(lt9611uxc, lt9611uxc->dsi0_node); - if (IS_ERR(lt9611uxc->dsi0)) - return PTR_ERR(lt9611uxc->dsi0); - - /* Attach secondary DSI, if specified */ - if (lt9611uxc->dsi1_node) { - lt9611uxc->dsi1 = lt9611uxc_attach_dsi(lt9611uxc, lt9611uxc->dsi1_node); - if (IS_ERR(lt9611uxc->dsi1)) - return PTR_ERR(lt9611uxc->dsi1); - } - return 0; } @@ -958,8 +946,27 @@ static int lt9611uxc_probe(struct i2c_client *client, drm_bridge_add(<9611uxc->bridge); + /* Attach primary DSI */ + lt9611uxc->dsi0 = lt9611uxc_attach_dsi(lt9611uxc, lt9611uxc->dsi0_node); + if (IS_ERR(lt9611uxc->dsi0)) { + ret = PTR_ERR(lt9611uxc->dsi0); + goto err_remove_bridge; + } + + /* Attach secondary DSI, if specified */ + if (lt9611uxc->dsi1_node) { + lt9611uxc->dsi1 = lt9611uxc_attach_dsi(lt9611uxc, lt9611uxc->dsi1_node); + if (IS_ERR(lt9611uxc->dsi1)) { + ret = PTR_ERR(lt9611uxc->dsi1); + goto err_remove_bridge; + } + } + return lt9611uxc_audio_init(dev, lt9611uxc); +err_remove_bridge: + drm_bridge_remove(<9611uxc->bridge); + err_disable_regulators: regulator_bulk_disable(ARRAY_SIZE(lt9611uxc->supplies), lt9611uxc->supplies); -- 2.31.1