From nobody Tue Feb 10 01:00:04 2026 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 46E0E396B62; Fri, 16 Jan 2026 17:33:32 +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=1768584821; cv=none; b=qci1+xhacnGqajbxD6L2SlO8xTrz4fQHKHKrDhb448lqaWGsxdomEukaDygMcE4oxxgqDTl3hw7T/QNpAUHi/VMIAy1n6+nV/6xyadYX4H6/pSdcQg++YGSuVGi2do26f1pnF6lmcE+en7hgVkcz/3YhBsIrghlWd+BX7gAJkd0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768584821; c=relaxed/simple; bh=da+9ANNyk2TMvXnOxiVzC4dW2zw1HjxV8qtIsktsSF4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=H+9VKGNVvgEqMufnw8cLyfWExJyV1j9U8lZdVAvCPwSOUBmdTmEySp/WLqM9zrglkufwiHC6qlUBB/eCxAUeAinNaAu2KshzCro5bZ/KWaN0e9/db2YZDB9HVS7t8oFLcrn8JdRXO8qgVw6Qr5KmwP4TiWXavybqP73kb47EmMg= 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=m+wPxr6s; 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="m+wPxr6s" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id A6CD8C1F1FE; Fri, 16 Jan 2026 17:33:03 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 7A4EF606F9; Fri, 16 Jan 2026 17:33:30 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B9A1110B681F3; Fri, 16 Jan 2026 18:33:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1768584809; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=CZGuLlcCDhUQzMpgbzcJjOknGYU49cHjJL/LspbQFv4=; b=m+wPxr6s1B1ZEDZXmHaVjHcdy1wES6LaXUzBc+SfMYn67bMCf5i6K5y/+1haIL3StlkdiH /M8WCvnArISU6u276Z4YEY6AbGn6RLuEBgtfP++NelIhyfzJ/bLbtdy9jYz5q23vayV4x7 49k1fa+mXo9dDLWRECGYQPwHzs1zqvXwk03HZqSeUqGnMha9+oFHAp+wzo65PiavsMRnX/ 1ekLX+c8o99JhdohxPopmxmj3Hcks0Z6oF2TS7MPx2q+cnnv7JqUJDkcB+6ELiuJhxTbJp UtI+us2zqB2odkpP4ZciaQzsJfvzumTuRWmpH9lzL8E3gfJvzWh1qGbWQs0Khg== From: Luca Ceresoli Date: Fri, 16 Jan 2026 18:32:41 +0100 Subject: [PATCH 6/6] drm/omap: dss: convert to of_drm_find_and_get_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: <20260116-drm-bridge-alloc-getput-drm_of_find_bridge-4-v1-6-e34b38f50d27@bootlin.com> References: <20260116-drm-bridge-alloc-getput-drm_of_find_bridge-4-v1-0-e34b38f50d27@bootlin.com> In-Reply-To: <20260116-drm-bridge-alloc-getput-drm_of_find_bridge-4-v1-0-e34b38f50d27@bootlin.com> To: Biju Das , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Anitha Chrisanthus , Edmund Dea , Linus Walleij , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Tomi Valkeinen Cc: Hui Pu , Ian Ray , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 of_drm_find_bridge() is deprecated. Move to its replacement of_drm_find_and_get_bridge() which gets a bridge reference, and ensure it is put when done. omapdss_device_init_output() can take one bridge pointer in out->bridge or two pointers in out->bridge and out->next_bridge. Ensure each has a corresponding drm_bridge_get() and add drm_bridge_put() calls in the cleanup code. Also slightly change the initial code assigning out->panel and out->bridge to ensure and clarify that either out->panel or out->bridge is set in the function prologue, not both. If both were set, the 'if (out->panel){...}' code that follows would overwrite out->bridge without having put the reference. Finally, take a reference in case a panel_bridge is added using drm_panel_bridge_add(). This ensures we always need to put a reference, which came either from of_drm_find_and_get_bridge() or by the drm_panel_bridge_add+drm_bridge_get() branch. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/omapdrm/dss/output.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/output.c b/drivers/gpu/drm/omapdrm= /dss/output.c index 7378e855c278..ca891aba3820 100644 --- a/drivers/gpu/drm/omapdrm/dss/output.c +++ b/drivers/gpu/drm/omapdrm/dss/output.c @@ -30,11 +30,13 @@ int omapdss_device_init_output(struct omap_dss_device *= out, return 0; } =20 - out->bridge =3D of_drm_find_bridge(remote_node); out->panel =3D of_drm_find_panel(remote_node); if (IS_ERR(out->panel)) out->panel =3D NULL; =20 + if (!out->panel) + out->bridge =3D of_drm_find_and_get_bridge(remote_node); + of_node_put(remote_node); =20 if (out->panel) { @@ -49,7 +51,7 @@ int omapdss_device_init_output(struct omap_dss_device *ou= t, goto error; } =20 - out->bridge =3D bridge; + out->bridge =3D drm_bridge_get(bridge); } =20 if (local_bridge) { @@ -59,7 +61,7 @@ int omapdss_device_init_output(struct omap_dss_device *ou= t, } =20 out->next_bridge =3D out->bridge; - out->bridge =3D local_bridge; + out->bridge =3D drm_bridge_get(local_bridge); } =20 if (!out->bridge) { @@ -79,6 +81,9 @@ void omapdss_device_cleanup_output(struct omap_dss_device= *out) if (out->bridge && out->panel) drm_panel_bridge_remove(out->next_bridge ? out->next_bridge : out->bridge); + + drm_bridge_put(out->next_bridge); + drm_bridge_put(out->bridge); } =20 void dss_mgr_set_timings(struct omap_dss_device *dssdev, --=20 2.52.0