From nobody Fri Dec 19 07:20:07 2025 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17FF22C21F5 for ; Tue, 16 Dec 2025 18:00:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765908014; cv=none; b=ermWwfJAVQ6XcAW2w3LKHo0Gp8Vgpc3OD20i4pXWkU68ve/jdHcngaAPCbxV3Af0st+RQ5jG3I/xbJhsA5+IFxUdhYxHq1CWbjHZo8n3JWghBqtDorP5P6bMNBSuu5VnwODYFybE7M+1XzEs8VFT2kjXm20hexMhTnbePuXu5SA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765908014; c=relaxed/simple; bh=CCTxYDG5esvfG3QapI/vaN7ekcY7tZf4b6//TqloRh8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D5Aor9yO9PmCqX9e8dZytK+LdEMSWYtALd35rdfbb/SG+cj29mdeQFmlQ+yTQ9fUyhSZNg4cHOuoEOFQG4w5tYpCyab77keeO2s5T5bYeBOlH0KwurznTq2jGdLmAPFTj5hxrzGYyWWsqgoB9xvQNbG2NcU/OPv8snZF0SAL+KE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=YTYB0Yhz; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="YTYB0Yhz" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 5F814C1A583; Tue, 16 Dec 2025 17:59:47 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id CCDBE6071C; Tue, 16 Dec 2025 18:00:11 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 58956119A97D5; Tue, 16 Dec 2025 19:00:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1765908010; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=GTpHCQitfi8TKGp4ltc6l5X/3hGUd4W8RAwhKfH5B+s=; b=YTYB0YhzjjTTgzdv0SfV0tdpbiL0U77KW7nyVZHlfowvzbiCHbjQIO0Rd92LvYfebaoxsX aARGAKYE4LBOiE9c0j0MUm/b+x/I03+9LCYx3eOfneq6yiI8dG0YrZYtU7v1U736PHBkCT Ymxe4fTEiykO2aucimaxodwoP5tBolmgftfM6JpwOUCOaux9GoIEt4fdMa8LZ/OPtvNKa/ lo5xJVqZxsPasCP5cb3+C0EahLqHNLrJsyjeNcGOYDtWpUUVL3Lp2k1KlKFAaFT8q5lA7j i8bXREnTqViEXutDMVNTC56WF0U4b69ALtNnqW5Lw/9Bs6mCDp5M7GA5mmAwzQ== From: Luca Ceresoli Date: Tue, 16 Dec 2025 18:58:44 +0100 Subject: [PATCH v3 11/22] drm/meson: encoder_dsi: get/put the next bridge Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251216-drm-bridge-alloc-getput-drm_of_find_bridge-v3-11-b5165fab8058@bootlin.com> References: <20251216-drm-bridge-alloc-getput-drm_of_find_bridge-v3-0-b5165fab8058@bootlin.com> In-Reply-To: <20251216-drm-bridge-alloc-getput-drm_of_find_bridge-v3-0-b5165fab8058@bootlin.com> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Jonathan Corbet , Alexey Brodkin , Phong LE , Liu Ying , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: Hui Pu , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, Luca Ceresoli X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 This driver obtains a bridge pointer from of_drm_find_bridge() in the probe function and stores it until driver removal. of_drm_find_bridge() is deprecated. Move to of_drm_find_and_get_bridge() for the bridge to be refcounted and use bridge->next_bridge to put the reference on deallocation. Signed-off-by: Luca Ceresoli Reviewed-by: Maxime Ripard --- drivers/gpu/drm/meson/meson_encoder_dsi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_encoder_dsi.c b/drivers/gpu/drm/me= son/meson_encoder_dsi.c index 6c6624f9ba24..eba246791c68 100644 --- a/drivers/gpu/drm/meson/meson_encoder_dsi.c +++ b/drivers/gpu/drm/meson/meson_encoder_dsi.c @@ -25,7 +25,6 @@ struct meson_encoder_dsi { struct drm_encoder encoder; struct drm_bridge bridge; - struct drm_bridge *next_bridge; struct meson_drm *priv; }; =20 @@ -38,7 +37,7 @@ static int meson_encoder_dsi_attach(struct drm_bridge *br= idge, { struct meson_encoder_dsi *encoder_dsi =3D bridge_to_meson_encoder_dsi(bri= dge); =20 - return drm_bridge_attach(encoder, encoder_dsi->next_bridge, + return drm_bridge_attach(encoder, encoder_dsi->bridge.next_bridge, &encoder_dsi->bridge, flags); } =20 @@ -120,8 +119,8 @@ int meson_encoder_dsi_probe(struct meson_drm *priv) return 0; } =20 - meson_encoder_dsi->next_bridge =3D of_drm_find_bridge(remote); - if (!meson_encoder_dsi->next_bridge) + meson_encoder_dsi->bridge.next_bridge =3D of_drm_find_and_get_bridge(remo= te); + if (!meson_encoder_dsi->bridge.next_bridge) return dev_err_probe(priv->dev, -EPROBE_DEFER, "Failed to find DSI transceiver bridge\n"); =20 --=20 2.52.0