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 484C9C433F5 for ; Mon, 25 Oct 2021 15:16:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 31C3A60FE8 for ; Mon, 25 Oct 2021 15:16:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233953AbhJYPSt (ORCPT ); Mon, 25 Oct 2021 11:18:49 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:60393 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233592AbhJYPS0 (ORCPT ); Mon, 25 Oct 2021 11:18:26 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id D0A2E5806B4; Mon, 25 Oct 2021 11:16:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 25 Oct 2021 11:16:03 -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=pwgSELP5dT/2C DHLV12oEtfj6zG5D1L9hu7xC1kNBUc=; b=OfICKeGVucyhLZnQJEM3jO3t44LDW gERuRj0Fw/KSf4vE7yspJOIAfhUTYoG2Y6fyiJww17m3CuR+U7OlYIlaAr9GI0/v voGZzlOnjbRbnjlDir79gWo5sITtV38waHC96FzxfGZGr+J5STY5IzYMkZ+pFYz3 YZjFfCuIIbVXWIC3L+nqcbOASGoDhHXxwfw+Q1Ft0V2EiFITANUWuNorUWoTh8j0 dgk6sQbAgkhCPfiR+ohI3+AVMX8mtja10yZ976eZRCYWiRNA4UVObPRaGeweqj9l vYBvqCYyn6bXvG/JLp+eL8woC2bO0793KA//05WGPV9+41VSGnEpWAQUw== 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=pwgSELP5dT/2CDHLV12oEtfj6zG5D1L9hu7xC1kNBUc=; b=EZiplbVY GChkavqnfRlD5zLlM0m+r7vh4rScKrcwdTer4U4lLU1owmpl3+csIQrm+Ge+GR9P nLb88vq2zgM8+zjjvsJz+YFNhvl8on596JDZEtdMrXOt+S30Fd1Wyhr3AcTlKHiN iz8LwEVMh6l2Um10skGI16k3LHN99E6W3QX8e771GI5jgzb/0Qq3VWd6T+BM1Ofy WcqhkkCrOUC5i0eY78RKwj3Fw0/GxZHi5ll12/iXtH6+AEiJWH+c0VwhpwkOIvf/ hB//7jNXbZq5h+ZjBPmM+0nQV5M860HKnpAXt2fZQsChULzVOKbLRhIaLNuShWqF GMxOvnOdeQWptw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdefhedgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Oct 2021 11:16:02 -0400 (EDT) From: Maxime Ripard To: Thierry Reding , Laurent Pinchart , Andrzej Hajda , Robert Foss , Jonas Karlman , Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Jernej Skrabec , Sam Ravnborg , Neil Armstrong Cc: Seung-Woo Kim , linux-arm-msm@vger.kernel.org, Joonyoung Shim , Rob Clark , Tian Tao , Chen Feng , Xinwei Kong , Kyungmin Park , linux-samsung-soc@vger.kernel.org, Xinliang Liu , John Stultz , linux-kernel@vger.kernel.org, Inki Dae , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Sean Paul Subject: [PATCH v6 08/21] drm/bridge: lt9611: Register and attach our DSI device at probe Date: Mon, 25 Oct 2021 17:15:23 +0200 Message-Id: <20211025151536.1048186-9-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211025151536.1048186-1-maxime@cerno.tech> References: <20211025151536.1048186-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Tested-by: John Stultz Signed-off-by: Maxime Ripard --- drivers/gpu/drm/bridge/lontium-lt9611.c | 38 ++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611.c b/drivers/gpu/drm/bridge/lontium-lt9611.c index 654131aca5ed..d2f45a0f79c8 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611.c @@ -825,26 +825,7 @@ static int lt9611_bridge_attach(struct drm_bridge *bridge, return ret; } - /* Attach primary DSI */ - lt9611->dsi0 = lt9611_attach_dsi(lt9611, lt9611->dsi0_node); - if (IS_ERR(lt9611->dsi0)) - return PTR_ERR(lt9611->dsi0); - - /* Attach secondary DSI, if specified */ - if (lt9611->dsi1_node) { - lt9611->dsi1 = lt9611_attach_dsi(lt9611, lt9611->dsi1_node); - if (IS_ERR(lt9611->dsi1)) { - ret = PTR_ERR(lt9611->dsi1); - goto err_unregister_dsi0; - } - } - return 0; - -err_unregister_dsi0: - drm_connector_cleanup(<9611->connector); - - return ret; } static enum drm_mode_status lt9611_bridge_mode_valid(struct drm_bridge *bridge, @@ -1165,10 +1146,29 @@ static int lt9611_probe(struct i2c_client *client, drm_bridge_add(<9611->bridge); + /* Attach primary DSI */ + lt9611->dsi0 = lt9611_attach_dsi(lt9611, lt9611->dsi0_node); + if (IS_ERR(lt9611->dsi0)) { + ret = PTR_ERR(lt9611->dsi0); + goto err_remove_bridge; + } + + /* Attach secondary DSI, if specified */ + if (lt9611->dsi1_node) { + lt9611->dsi1 = lt9611_attach_dsi(lt9611, lt9611->dsi1_node); + if (IS_ERR(lt9611->dsi1)) { + ret = PTR_ERR(lt9611->dsi1); + goto err_remove_bridge; + } + } + lt9611_enable_hpd_interrupts(lt9611); return lt9611_audio_init(dev, lt9611); +err_remove_bridge: + drm_bridge_remove(<9611->bridge); + err_disable_regulators: regulator_bulk_disable(ARRAY_SIZE(lt9611->supplies), lt9611->supplies); -- 2.31.1