Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp365200pxb; Thu, 21 Oct 2021 00:44:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbCuu1CuFvLfumc+UOzVjYMC5v03yLvcgxpziSvi9MMlq+QZLD1N48QLrD3EOz3NHNklhs X-Received: by 2002:a17:906:c015:: with SMTP id e21mr5304346ejz.113.1634802256428; Thu, 21 Oct 2021 00:44:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634802256; cv=none; d=google.com; s=arc-20160816; b=iPz1unNOYnGtfAtWSk111PUngQXDO0wwpFL8BMhzNB4ZRAUu7iDQKxx0NMbQbia2Xk IgcYJ72/R9of3XY6OiYnWsJLZuvhUEffKjL+d9qXgDKNu1UQOkEPmOgS+Q0qoFtktt1y W++Byj22ezgfAQcYuE6EHIpzvE3DdRi9F/Szobh1b0qu2WdBz6xrIcCfzOH07qL5WG5f dcn3bcHp8T39Ey2ym/mDl/II69FiE9fyh37aaRizCe3BHJ90uPbcRs7urZIxUUz5zUEQ 86tUnHjbkCclZJXAoIxJJsQG22OCiaaVaekt8Gy+2mhh/pA9LYnhWXG7PeVxVB5wRP+J 4y1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=V2ECKODejaAuLjYVZGAyrUq9Ivh4nxZakGL2AQusnM8=; b=0TqN0+0kAD4/qNhkVX6+9vhYoRPLtxhZPN1y3Zfq8xgNHLcbNWG3XbTkCZXr28WbEb v1niLfDe6IJoOQLhCZ1Wsg0yA5EfjFRschFJwGeoYA/l95TiPqpCQX6nuGe1qK5K/137 u+JHh4iwTB+cpd7jptti4NB5EMee2vbT939GWIy+HzPJCUwo+L1DPehhmvZ2TZG5CJZT YNeaIwdG++MmHQgatAJl2b2C/iQM1SvrSSusGkb8Fd9x/M/X8GCOPAMIs3kWK5oklQfQ 8lHp837EPt+H/V7faoNsjBlP/mbx7JIi7HoffhI9/s2BFkKBp8lrE/H/ZGsRTWfWgw7o zquA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b="f7M/Yoi+"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=iwrVMsUd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si5676793edw.448.2021.10.21.00.43.52; Thu, 21 Oct 2021 00:44:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b="f7M/Yoi+"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=iwrVMsUd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231916AbhJUHn3 (ORCPT + 99 others); Thu, 21 Oct 2021 03:43:29 -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-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 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