From nobody Tue Dec 2 02:19:38 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 18A17351FA3; Wed, 19 Nov 2025 13:06:11 +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=1763557573; cv=none; b=DxeNLMt0IJxb/i5AT6x1XGNvoLzKF+sLHUuLV3CkxgERt2UKbydFQawdJ0ykkCMVu3SiuKsoQM9Iy+iolqbzmVS/aXo+OfCw125F2+LvHxYX1vCrvAckPJ2dxEI16dCkOs62Z6GIvM9UHjVdZANxFpuqFTqsbvdYm+aIvQGOTfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557573; c=relaxed/simple; bh=9rg6weeQBuAhSLZyzhNnGsuorBwvEJfq9RfRFnr8Sy4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=o6rX3i/yKDAdznW+wZ0e8EcRwR9T7w4ysMLmHFKdmtRJHLtADd87QN6wjNNEXXPl7aAF1KQS3vuBwuMHzVaOmH/Zy7TVZ9tAfPKk1ZMA8a/cWtCDRzbnwVQUhIQX7iaKSrN/5eucSW7VVCjZ7g8k5TRkl9XUaib2g5he8lYOW1w= 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=AkgPy5yh; 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="AkgPy5yh" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 9A987C11188; Wed, 19 Nov 2025 13:05:47 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id D02F060720; Wed, 19 Nov 2025 13:06:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 04E9E10371A50; Wed, 19 Nov 2025 14:05:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557567; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=oEF9xZ8+PeSfk7CL/9gwgHJWA1O+EMNXV1ratkXqO+s=; b=AkgPy5yhw0AuO19ZuOS3zmP0YzmfT3oYUSz6fPbTCQlP/kCukV7pfya+N58TpLjpOaa7WJ pC7T9UmhklSb7a/TBMlCTyGZl4vFGO2vT2P1bRUzoGwjYZtxmrNlbadTbnJOsTKhhG/ZNa faraoY/nRl5NlCWf4FFDQQd6PGzi5Ki8cal5DGlQBnyund+cY9BnNMpjLfp/tkqRrb6Tix eQ2mc9WLqDI16oYvUnAXTW2XfUsGWAkjJnKybZ20HDhylZHW/UTeY0jYaDhHmZcOZed3zl Hrn4jgImlX+GGuBiu8RLtSQTFQtojubp9S0VUcaO4LeETgTfxvYSap4RRF4lVg== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:32 +0100 Subject: [PATCH 01/26] drm/bridge: add drm_of_find_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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-1-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 of_drm_find_bridge() does not increment the refcount for the returned bridge, but that is required now. However converting it and all its users is not realistically doable at once given the large amount of (direct and indirect) callers and the complexity of some. Also, "of_drm_find_bridge is oddly named according to our convention and it would make more sense to be called drm_of_find_bridge()" (quoted from Link: below). Solve both issues by creating a new drm_of_find_bridge() that is identical to of_drm_find_bridge() except it takes a reference. Then of_drm_find_bridge() will be deprecated to be eventually removed. Suggested-by: Maxime Ripard Link: https://lore.kernel.org/dri-devel/20250319-stylish-lime-mongoose-0a18= ad@houat/ Signed-off-by: Luca Ceresoli --- Note: a simple implementation would just be { return drm_bridge_get(of_drm_find_bridge(np)); } but it would release the mutex before getting the reference, so it is not safe. Make things simple by duplicating the code. A later patch will make instead the (to be deprecated) of_drm_find_bridge() become a wrapper of the new drm_of_find_bridge() --- drivers/gpu/drm/drm_bridge.c | 29 +++++++++++++++++++++++++++++ include/drm/drm_bridge.h | 5 +++++ 2 files changed, 34 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 8f355df883d8..d98a7b4a83c0 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -1417,6 +1417,35 @@ void drm_bridge_hpd_notify(struct drm_bridge *bridge, EXPORT_SYMBOL_GPL(drm_bridge_hpd_notify); =20 #ifdef CONFIG_OF +/** + * drm_of_find_bridge - find the bridge corresponding to the device node in + * the global bridge list + * @np: device node + * + * The refcount of the returned bridge is incremented. Use drm_bridge_put() + * when done with it. + * + * RETURNS: + * drm_bridge control struct on success, NULL on failure + */ +struct drm_bridge *drm_of_find_bridge(struct device_node *np) +{ + struct drm_bridge *bridge; + + mutex_lock(&bridge_lock); + + list_for_each_entry(bridge, &bridge_list, list) { + if (bridge->of_node =3D=3D np) { + mutex_unlock(&bridge_lock); + return drm_bridge_get(bridge); + } + } + + mutex_unlock(&bridge_lock); + return NULL; +} +EXPORT_SYMBOL(drm_of_find_bridge); + /** * of_drm_find_bridge - find the bridge corresponding to the device node in * the global bridge list diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 0ff7ab4aa868..e74e91004c48 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -1313,8 +1313,13 @@ int drm_bridge_attach(struct drm_encoder *encoder, s= truct drm_bridge *bridge, enum drm_bridge_attach_flags flags); =20 #ifdef CONFIG_OF +struct drm_bridge *drm_of_find_bridge(struct device_node *np); struct drm_bridge *of_drm_find_bridge(struct device_node *np); #else +static inline struct drm_bridge *drm_of_find_bridge(struct device_node *np) +{ + return NULL; +} static inline struct drm_bridge *of_drm_find_bridge(struct device_node *np) { return NULL; --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 AD7D035771B; Wed, 19 Nov 2025 13:06:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557582; cv=none; b=itdMSKEfCsd6g+uWPTmzmf3Ex1xU24QhdDGzl4VwWnhNbTF3emniK381clMB+SESvksEYdIyv8X2zrKgEcdZHq6MenM8SkDcD4CcMy9099XmYBYaARwnDkFvcAXch+iZ6WAx/OcX6FuBUXNQsO6QDjOrdMkve8FHXW6ZTcoI96o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557582; c=relaxed/simple; bh=XS60QQAn35MGcoJ66s1TT11J/m5NoBX1WGVDZ696d/A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mNJlHAQzwLFiX4K5byNnILrInjymSdAqFcL1Lax2qmedgT+c6XcHxIh0BxfctUhPtO08aEsRfAPz2hp5FGJyMYuOUidFrBBWT9tXqpREbuJKBdFHrmL2x+8TUjsg4V6hqkNvAU5tn6F0cbnOjWPCAyy8+JACOI6hlEV3Yl/EMxE= 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=0Hd83lZn; arc=none smtp.client-ip=185.246.84.56 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="0Hd83lZn" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 3669B1A1BE0; Wed, 19 Nov 2025 13:06:18 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 07FAC60720; Wed, 19 Nov 2025 13:06:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 4F0AD10371A51; Wed, 19 Nov 2025 14:06:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557576; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=7gXiH7KcRJHe1y+SYEzwMmqFZuuFI7TA/lpp17IXqG8=; b=0Hd83lZn7CdaVUWqOlfWjJu1jw/lw2DIktzY9jb0BeiS7Y4iIApnXv4P92JPO2ooDgbfDq v7u5idqxDSoseWG//QVTOcBPGjFmXiNTrbASRGB/nRtdeMAunctuzwm98BbFQvhOeDQVGD l4Ts7WrSeasXZM1QJ/fw0WHIIWWBlxsenw+f7vMNUQgE1Xh9xO+mTq7UmiZdq45tyFU9S2 XKbKIfz2IRdhFZVRRVV6pHl5yrHQhhAgLGzw7PjQcfuiDRV5MT2wNKndy0RkwsclB3fgNt b0VhYtHooEpKf/t2W6nWBWBfYm4XKqM9y3ZAG0Q2F+12er81mhAqq2pfA/oBIQ== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:33 +0100 Subject: [PATCH 02/26] drm/bridge: deprecate of_drm_find_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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-2-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 of_drm_find_bridge() does not increment the returned bridge refcount. drm_of_find_bridge() is to be used as a replacement. Suggested-by: Maxime Ripard Link: https://lore.kernel.org/dri-devel/20250319-stylish-lime-mongoose-0a18= ad@houat/ Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index d98a7b4a83c0..6debbf20aaa8 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -299,7 +299,7 @@ EXPORT_SYMBOL(__devm_drm_bridge_alloc); * @bridge: bridge control structure * * Add the given bridge to the global list of bridges, where they can be - * found by users via of_drm_find_bridge(). + * found by users via drm_of_find_bridge(). * * The bridge to be added must have been allocated by * devm_drm_bridge_alloc(). @@ -360,7 +360,7 @@ EXPORT_SYMBOL(devm_drm_bridge_add); * @bridge: bridge control structure * * Remove the given bridge from the global list of registered bridges, so - * it won't be found by users via of_drm_find_bridge(), and add it to the + * it won't be found by users via drm_of_find_bridge(), and add it to the * lingering bridge list, to keep track of it until its allocated memory is * eventually freed. */ @@ -1452,6 +1452,9 @@ EXPORT_SYMBOL(drm_of_find_bridge); * * @np: device node * + * This function is deprecated. Use drm_of_find_bridge() instead for proper + * refcounting. + * * RETURNS: * drm_bridge control struct on success, NULL on failure */ --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 CB17F358D15; Wed, 19 Nov 2025 13:06:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557590; cv=none; b=hnVdyjXqmS3O2ZKW3IxnMV1UzyxLuDPBBdu1sDiHMwCHeflK6f+Xx0AESfibj1HpXTz3Tc5cXQHaI+da/3Nmy3eypBe+fZIUAYwqtXR2Nv6X93ni2Ii3yrf0jvZ2to9JIZNl25rKMtG5MAIOKh5Xc0Z4EQqs0pFuwiGd3ITuj6I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557590; c=relaxed/simple; bh=qBFnRHiu6GoS0sjFL5oa3JrBTXUUbf89surMgDpq2DA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ky8pghdX1RCcZTf6bBiHltIk5/EphnDuMS66FrC5cH2HYHDK/YaP2HDPay5BPxzyu5ui/+WgY0JxMJJ+Yr/jBQfFCagKJNz4/2MTmm+wroHeg7Z8Rq6TnnzRpKL1TkiLxn+PzxLE10zZvyA7QVmezxgB/0UHrAWtaSz3upm4k6w= 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=bFcA+TR6; arc=none smtp.client-ip=185.246.85.4 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="bFcA+TR6" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 7914D4E4179C; Wed, 19 Nov 2025 13:06:27 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 4885260720; Wed, 19 Nov 2025 13:06:27 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 9625410371A4D; Wed, 19 Nov 2025 14:06:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557584; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=U5pSp1vPWfg6VVqrqrSp3mxOttgley4fq02+zPb9SPE=; b=bFcA+TR6jEG5qm9LQ9GiqfHt1lqV/lld+li8AOuv98I2mxB/Moe4o/Qc1HDGOBV4ufX4MZ NKb5vGxeI5/5fCmp4TSXS9/h2xnyzlwlxO3mm3Qr4/0DC3Ysk3r/siQxkCIL7CVzCgDsg8 6y5bRL++49tf86mgGirblyly0TJLFRC5f/Ht8qoDIEXFqvSX/+fOwFJ7nvTebCXdOq2skV ovYfRDxHpTkSa5h4hLUBzKohE7UgHX/0TnirrywxaN3V+A8R8c/s34HbyZ8PovJIfzWZZa ahSxa4pU6pIwQG7dSheA4Bc+vyy6Z4uGaSY5dk2xEI2DA3F8pxsGqulwwk86Ug== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:34 +0100 Subject: [PATCH 03/26] drm/todo: add entry about converting to drm_of_find_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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-3-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 of_drm_find_bridge() is deprecated, but converting some users is very complex and should be reasonably doable only after the DRM panel bridge lifetime rework. Add a TODO to track this. Suggested-by: Maxime Ripard Link: https://lore.kernel.org/dri-devel/20250319-stylish-lime-mongoose-0a18= ad@houat/ Signed-off-by: Luca Ceresoli --- Documentation/gpu/todo.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 9013ced318cb..1a4a11dee036 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -506,6 +506,22 @@ Contact: Maxime Ripard , =20 Level: Intermediate =20 +Convert users of of_drm_find_bridge() to drm_of_find_bridge() +------------------------------------------------------------- + +Taking a struct drm_bridge pointer requires getting a reference and putting +it after disposing of the pointer. Most functions returning a struct +drm_bridge pointer already call drm_bridge_get() to increment the refcount +and their users have been updated to call drm_bridge_put() when +appropriate. of_drm_find_bridge() does not get a reference and it has been +deprecated in favor of drm_of_find_bridge() which does, but some users +still need to be converted. + +Contact: Maxime Ripard , + Luca Ceresoli + +Level: Intermediate + Core refactorings =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 8034A354AFC; Wed, 19 Nov 2025 13:06:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557600; cv=none; b=XzAB6/uw4gWyS/hn5ZtDwgrPAXV+oTO48DJ9SUaqckTpN9tNNhEHA1GEh+VBMTtKZOr3ll1MIUuN3N1kciKM27JEPoiUmw/RShtgZDgqzKGAao3sClev5W/de2cXnZ9TCcugzoSZ76A8Dii+JvzG8P4tw+mxue9EVm1BxnKHNBg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557600; c=relaxed/simple; bh=w2yRFEeMyefKnZcTdP1T0gPYWSyAOV+iYUzUidpss64=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=avF+HLRmAQU+PdozouxuSq9gZbeJbvrnYaS/A9AJX/sXkgaRRFNwQ21JZI9Gn7UO/SklWpVjgnUzggvBCyXbJn5fAyf9B+gy1IORgLcYnP/FwNFjUbMVJE5Z1o5ZTJQPDTfG6ax9rpdI5LU2c6T4AMYp82isO23LHBJHE6J8QNg= 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=jJfzAo68; arc=none smtp.client-ip=185.246.84.56 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="jJfzAo68" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 08A451A1BDD; Wed, 19 Nov 2025 13:06:37 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id C877D60720; Wed, 19 Nov 2025 13:06:36 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B6FEF10371A55; Wed, 19 Nov 2025 14:06:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557594; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=1QF0ORUlNq/608kBgd0cHzHJhM8wJBt4bewg9ebnYQs=; b=jJfzAo686i6lqNqOaIfflAf6UcpbmCBg60iDGDaWxHCJrVaXyM12L9KHDw91jgtLj8m+oB M+G7AbJQ2s6KguUF7Dv685Uhcwjub/sEFbYt0hRktdLuiO1hD820RHZ9IvEKInk85T8ElU B/X0jex9mM7MdPDUJuON2gh1pR71OuXXcNeHTRIvHGYbe+C3IWTVXQynwH6PXaRkdbLps0 rsC4ekVLRee64N1KxSc6WtYOUAnhyivka2O4ZnfIWHfRylrIq1swpS0B4rp54dNyMOlaSI JXkz6CTCMYj/Ti0hqh6rQmNzU56cipDWx/QZiK1qAnichf8F58wlBkYWvTgosQ== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:35 +0100 Subject: [PATCH 04/26] drm/bridge: make of_drm_find_bridge() a wrapper of drm_of_find_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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-4-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 of_drm_find_bridge() is identical to drm_of_find_bridge() except it does not increment the refcount. Rewrite it as a wrapper and put the bridge being returned so the behaviour is still the same. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 6debbf20aaa8..09ad825f9cb8 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -1460,19 +1460,11 @@ EXPORT_SYMBOL(drm_of_find_bridge); */ struct drm_bridge *of_drm_find_bridge(struct device_node *np) { - struct drm_bridge *bridge; - - mutex_lock(&bridge_lock); + struct drm_bridge *bridge =3D drm_of_find_bridge(np); =20 - list_for_each_entry(bridge, &bridge_list, list) { - if (bridge->of_node =3D=3D np) { - mutex_unlock(&bridge_lock); - return bridge; - } - } + drm_bridge_put(bridge); =20 - mutex_unlock(&bridge_lock); - return NULL; + return bridge; } EXPORT_SYMBOL(of_drm_find_bridge); #endif --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 AA0FF3538B6; Wed, 19 Nov 2025 13:06:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557609; cv=none; b=uKiLWyMMqvf0v7MLGjHlHzX/9/hKUBa0EEvMp/8LiaRZfgn8nduBfKXd/0QDrEDlciHLqKmTD9QnBygaAJDZQXv+7G7iCddNS3A0wa/t3O75S3OYzoZFYozRGdzKW+CAE4H0bGuFkACDMeFBptceg/AhUMOQfdgV3h/+axVRj+A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557609; c=relaxed/simple; bh=GaDoTOS/Iaf0l98TC3eNGUmXFPgs1J9sMRmJOR9vHug=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eeyNiwDUZZUvnrBbZ2nHn+yYEK7XwoVDd+KEXJjXyaVQPWOv/EdgPOCk5sZuZviS8KuYSrWe7kd/Jnjk2E+ZhzopcfB2EhTsgLLm7WsQR5eAq0wRi2Z0EeOfkYd5xYWlnPncUchB33MZ6MmKJtmIXiLnFGXXzsuAqLALtIyhmRw= 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=K80VFDo5; arc=none smtp.client-ip=185.246.85.4 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="K80VFDo5" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id E6D574E4179D; Wed, 19 Nov 2025 13:06:45 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id B2F7560720; Wed, 19 Nov 2025 13:06:45 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C8C4310371A51; Wed, 19 Nov 2025 14:06:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557603; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=IhbSXlnucQNPA+odUyHLi4LAOLTZyhzQbAzf1P8iOJ4=; b=K80VFDo5maDRMh78coeI/+7PlWLAWZNI+GEy+tzqOAKC9h8ocxKkzL6gBWuG4Y/RCh44c3 FjRUTDtMdIpUMF/B1VeCx+4E5qxd1Br3VB2u3sv4QyTtTzme+iZCHWjM8KXKABItuJHqF7 OA5vVpoXEBrhPYkA8Mbi0uM1g6uWZd34eSfhaBXuB8aF7zSNNqrjQ8AVYYf/pmKKh79GLD fpOB0osnHeQ7hlKsJgLDySbatSHdrFlFcQC5Po/iZrPyDnTu1t7EIlpfdF6SEcuhFUtRLh vj33+mNegcsdr3p4Xw5ziyjLFUe4VFHUHJ6TyzuziUFCcidZqsQb/+WAqJ+Bgw== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:36 +0100 Subject: [PATCH 05/26] drm/arcpgu: convert to drm_of_find_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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-5-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@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 drm_of_find_bridge() which gets a bridge reference, and put it when done. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/tiny/arcpgu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c index 7cf0f0ea1bfe..bd9794897197 100644 --- a/drivers/gpu/drm/tiny/arcpgu.c +++ b/drivers/gpu/drm/tiny/arcpgu.c @@ -308,10 +308,8 @@ static int arcpgu_load(struct arcpgu_drm_private *arcp= gu) return ret; =20 if (encoder_node) { - struct drm_bridge *bridge; - /* Locate drm bridge from the hdmi encoder DT node */ - bridge =3D of_drm_find_bridge(encoder_node); + struct drm_bridge *bridge __free(drm_bridge_put) =3D drm_of_find_bridge(= encoder_node); if (!bridge) return -EPROBE_DEFER; =20 --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 A1775189906; Wed, 19 Nov 2025 13:06:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557617; cv=none; b=SZ6a5FBARiwL7s8ByAALd1OwZzl+SOoSSSYJU+w80gooQ3S0CJ6FMiGYFoLGdmVZhN1nA+f2g48cnmNdL4xNrHWKsV3GbjnghHOo4uVw47Nmk2SJk8HqJubtkiie0+RoI58EyMvIY1FI4KkFs96SATqgYedDk69pVNu5RjrQkVs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557617; c=relaxed/simple; bh=WXwByyf8l8pwrIsUAoYT1/6g0UQBe65bfyQ07PZGFLI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rY0oSI6WqYHIAOQY+vsVSSSBVHJhmeXJTK8LuNRdd1nXPLUL+JXbtpSSYQH8e5S3tgi3tmqLHPTz+/eCMRBFhOgYegCRFEOW1Z03Oh7ysIjZarVSmz3fboxDRwp628ZDI0TEoTmu2QXHunH+YFWOLC/lMGvQm0AO6Cl3gQ58rr4= 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=Wbwzn0uV; arc=none smtp.client-ip=185.246.84.56 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="Wbwzn0uV" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 61F1B1A1BE0; Wed, 19 Nov 2025 13:06:54 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2D36F60720; Wed, 19 Nov 2025 13:06:54 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B60E410371A4D; Wed, 19 Nov 2025 14:06:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557612; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=a6WNrs9Y6V3IsNLzdFtu7YCg0CGh4zNPN+hLyMO6Fv8=; b=Wbwzn0uVxzL0e/KdCS6XpEu2u22Bhj89nT+j8V+lPOjs5nB08HSlWeIApMk5lqJTqTx0O8 9a5kGAyCI0h3tBIL8GeAcGlzc0wiypsysOh5/bTgohaGSpK/RcIzB2QSLjN3z7w7CSPZM1 cM4BGVsG3eh7Tde1ClKXPAce/5EIU5PYIfS7SFSnZMXIk6yiqFYu9m27WJGMB+JzN8Zh2P quo7b5H7V2VwfrAeEsKpGgEDayBJtAZF4iG5+3Q8xtiLzu1eFF4eWL6V54/8JN+uRhynPR JnW87vN4WO5iAWPI0jGeBK1k5B58PyuUE/mB32X4RBtSbbm9g6gPzztHbAeBPQ== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:37 +0100 Subject: [PATCH 06/26] drm/bridge: add devm_drm_of_find_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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-6-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Several drivers (about 20) follow the same pattern: 1. get a pointer to a bridge (typically the next bridge in the chain) by calling of_drm_find_bridge() 2. store the returned pointer in the private driver data, keep it until driver .remove 3. dereference the pointer at attach time and possibly at other times of_drm_find_bridge() is now deprecated because it does not increment the refcount and should be replaced with drm_of_find_bridge() + drm_bridge_put(). However some of those drivers have a complex code flow and adding a drm_bridge_put() call in all the appropriate locations is error-prone, leads to ugly and more complex code, and can lead to errors over time with code flow changes. To handle all those drivers in a straightforward way, add a devm variant of drm_of_find_bridge() that adds a devm action to invoke drm_bridge_put() when the said driver is removed. This allows all those drivers to put the reference automatically and safely with a one line change: - priv->next_bridge =3D of_drm_find_bridge(remote_np); + priv->next_bridge =3D devm_drm_of_find_bridge(dev, remote_np); Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 30 ++++++++++++++++++++++++++++++ include/drm/drm_bridge.h | 5 +++++ 2 files changed, 35 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 09ad825f9cb8..c7baafbe5695 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -1446,6 +1446,36 @@ struct drm_bridge *drm_of_find_bridge(struct device_= node *np) } EXPORT_SYMBOL(drm_of_find_bridge); =20 +/** + * devm_drm_of_find_bridge - find the bridge corresponding to the device + * node in the global bridge list and add a devm + * action to put it + * + * @dev: device requesting the bridge + * @np: device node + * + * On success the returned bridge refcount is incremented, and a devm + * action is added to call drm_bridge_put() when @dev is removed. So the + * caller does not have to put the returned bridge explicitly. + * + * RETURNS: + * drm_bridge control struct on success, NULL on failure + */ +struct drm_bridge *devm_drm_of_find_bridge(struct device *dev, struct devi= ce_node *np) +{ + struct drm_bridge *bridge =3D drm_of_find_bridge(np); + + if (bridge) { + int err =3D devm_add_action_or_reset(dev, drm_bridge_put_void, bridge); + + if (err) + return ERR_PTR(err); + } + + return bridge; +} +EXPORT_SYMBOL(devm_drm_of_find_bridge); + /** * of_drm_find_bridge - find the bridge corresponding to the device node in * the global bridge list diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index e74e91004c48..98d5433f7d35 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -1314,12 +1314,17 @@ int drm_bridge_attach(struct drm_encoder *encoder, = struct drm_bridge *bridge, =20 #ifdef CONFIG_OF struct drm_bridge *drm_of_find_bridge(struct device_node *np); +struct drm_bridge *devm_drm_of_find_bridge(struct device *dev, struct devi= ce_node *np); struct drm_bridge *of_drm_find_bridge(struct device_node *np); #else static inline struct drm_bridge *drm_of_find_bridge(struct device_node *np) { return NULL; } +static inline struct drm_bridge *devm_drm_of_find_bridge(struct device *de= v, struct device_node *np) +{ + return NULL; +} static inline struct drm_bridge *of_drm_find_bridge(struct device_node *np) { return NULL; --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 2E3C633C19E; Wed, 19 Nov 2025 13:07:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557627; cv=none; b=RA3LXGyM4G1jb+JnJVPTNpCRj+pALRNMoEEj6dZxroV4Pn83/cyeq0JnElITkPIiON3h8xAC3aA5M7iGvHMrjNBQqVK1XRTA727UCEILi2zn9kSXGSshitMby5z6ir9uxIMx6M3wtZWeSxUBcWicE720mY7Rzgqf1i5xgylqSjg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557627; c=relaxed/simple; bh=ZaFMPR95GygBIjZUmjyJIV5vHH5hv36SMX8/swqOATU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fUWN1ZJHGlZgt++W0WlrFU7Tz2CWVuI4ILFN7LnNAUzKpXkSohiFyOdMYgw+NOLicJVCTKuIHOq6akLao0ND/+0KU6zj8z65Q11MLvvboY39S4nf26tyeOrjBy7qOgYo23wvye+k1SstpygZJpORlwNbnY6ScWGUoFhmGH+TkQY= 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=SINksK3O; arc=none smtp.client-ip=185.246.84.56 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="SINksK3O" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id E649A1A1BDD; Wed, 19 Nov 2025 13:07:04 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id B600660720; Wed, 19 Nov 2025 13:07:04 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 95D7A10371A50; Wed, 19 Nov 2025 14:06:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557621; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=qsazag2An/fgMKK08J9HfhnhU42+l2KXmaAJPH5Vluw=; b=SINksK3OTvoGnmlWlEC2/vSxrmPi+Mro0sJJXQaFJuKGFTUA252iHhYx9EgmLc5PrbVKZM RUr4gvoz9t6J9epsIL181FJgX+PDDF8pNu6M9USf2VcP7kWsaMShijyzm3GOItW+ABL7e0 +HSv/zNLf7bSGeSvlqjM8dkVZWu5RtJHnKc5V05UvOaa2waluCoxBZx3x+2P3f2Otb0Gtx vVSWGhk0rCFESdXYMGery+tKQSB7m5QqpY7TahdE8Dpl2x8rYCC2poMCPoPxeuujw7DJeq 7YupO9sXu+i9jcaWlNcyrgtk4Q5dmaMC8Wf9vqrZRKLaAu1dnSW0FhhY1c6RfA== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:38 +0100 Subject: [PATCH 07/26] drm/bridge: ite-it66121: use devm_drm_of_find_bridge() to 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-7-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/ite-it66121.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/= ite-it66121.c index aa7b1dcc5d70..5bc4e5afb823 100644 --- a/drivers/gpu/drm/bridge/ite-it66121.c +++ b/drivers/gpu/drm/bridge/ite-it66121.c @@ -1542,7 +1542,7 @@ static int it66121_probe(struct i2c_client *client) return -EINVAL; } =20 - ctx->next_bridge =3D of_drm_find_bridge(ep); + ctx->next_bridge =3D devm_drm_of_find_bridge(dev, ep); of_node_put(ep); if (!ctx->next_bridge) { dev_dbg(ctx->dev, "Next bridge not found, deferring probe\n"); --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 679493590DB; Wed, 19 Nov 2025 13:07:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557638; cv=none; b=KmJdxZP+RxhFWj2Mr8LGZNPWQeeokAapjEFAbiIxkrFSCm5Vpr/7yNzIfwXfuESBIQiissuAU5NNfXLYTbjcCntapKyjU38dDnzAv8ATovo8k5CkZCwjFF86FLw+etcoYYlVkCTj8OLgeRlRGtjEDc0r7M2EDfbVlNzuarG/bKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557638; c=relaxed/simple; bh=YrqO/WR7WCe/EAIGKizYaKxtn+ajH0IgBH7K7DdSimg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=e4bFjkljmw/Z4Q8hQGTj38VSgkIIWycrIsM6hE052uJC8Sqf/XkUB7Cb9xAOS1zozt4cGcOCsnkhTWcXjCKYTC87z8Yf1QSZQ+i5QezAt7rFtOV9YqxW05TOTPNqfSJj2PCbiy0FdQ2bZO4Gid/walrxSGDWIO4n5ExND7FoziQ= 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=NEyAu5Xk; arc=none smtp.client-ip=185.246.85.4 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="NEyAu5Xk" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id C2CF64E4179D; Wed, 19 Nov 2025 13:07:14 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 92AC060720; Wed, 19 Nov 2025 13:07:14 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1444110371A54; Wed, 19 Nov 2025 14:07:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557632; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=S3/RyqtG2O2X95jZe77v2eECppzA5uptVgV9rNXhIWk=; b=NEyAu5XkT2W+7Bzh5MQvyIdqpPPlktCWksQ5UCtOpM8Okntp1aUYiBlrNA059OFdHkdTZf q/sjuH5lTJmh2usXh/vG13ctJbJgYMT/Ibv5Rcl9qMF/tYlrrAGSJpQOYNCp8ETb8U+KpW t/1C7/D3fmH4JQEf5H0bmjK2Ocq3ReX/1hosaSfpS+7d8Szzvjp1MRkJSfY67CphcqT+UY ZU0w6xYCHWkEpmbF0sdQ6BP+SFRmbJ2+GP00cRfSUK2tVugUu13S6h+gQ1lUM2KVQs+GaP 2X3qGKrbXt3jh762jJFCTCexpS4u0Hkrj0z4bEYzXa3uYfMAimCXLADx/692uw== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:39 +0100 Subject: [PATCH 08/26] drm/bridge: imx8qxp-pixel-combiner: use devm_drm_of_find_bridge() to 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-8-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c b/drivers/= gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c index 8517b1c953d4..8ec8f1fba62a 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c @@ -326,7 +326,7 @@ static int imx8qxp_pc_bridge_probe(struct platform_devi= ce *pdev) goto free_child; } =20 - ch->next_bridge =3D of_drm_find_bridge(remote); + ch->next_bridge =3D devm_drm_of_find_bridge(dev, remote); if (!ch->next_bridge) { of_node_put(remote); ret =3D -EPROBE_DEFER; --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 579283587AC; Wed, 19 Nov 2025 13:07:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557647; cv=none; b=gttI4W8kkvRKwgR7VhKkHVIlO4wZiA5Phe116VzGh1EiNlDUpmeQiAa6+gTFOmF/Fea7OJS7KJKvslNY4G9mnNiwf1q+AnFQ1Um04Ixma4slvYUMcA/Cvu0fTo9lxMgHbaEnCexb1Vr+D8o+Kj1MXpnJ+G8X/rsvXSW0xNYBmyE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557647; c=relaxed/simple; bh=9EWQorqd0b99XtGhsz2xrASf5AMnFK9kZ+gjORwsrnw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O1AwZ+BBaVs7Qg9ldpcal4ITrjYSuZNo7OEsyEBVuqzcT3+Jv77dA6RVAbDiq+u13k43PZfTdm5rvFliZkjAMY4AZ4i1FBo3fdqF+5ZkK1PxqSGakerd61vaCvaKzijQqgpmlmCZi3zsSIWHKNSCD6FL5wkDqtoVpSjoAwIF3mY= 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=l+0OYA58; arc=none smtp.client-ip=185.246.84.56 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="l+0OYA58" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id DE3491A1BDD; Wed, 19 Nov 2025 13:07:23 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id AE0F660720; Wed, 19 Nov 2025 13:07:23 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E362910371A56; Wed, 19 Nov 2025 14:07:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557641; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=7hY9DFSVUt8stZoOBMtLkJiT453oPgUoQz6S+q61Vao=; b=l+0OYA5810JbZzH9x4xTRdK5G+QjVIdPTE9T3ZP+XMU6tdl9kh1/CjgIPGrNthEXBVGnu4 DfMhD3za7iWMeKWue5X/iLYcrMBiTD5wUDWrLv3taoDJnvXYmUfZ2CTLPO+jxevJffoTMe uY20lo4bUtLYqygBc6uIgMzVk4/+SRAJ8JIzF6BcenWKLMNfkbz2Qau5M46uzeSFzIoEXy K1SMXFz3hdTF3jZSO7P6xPvPdPR0xcBuhjHK8gNDXH0dTR2l3QSztkjuqsFdjd2sJDIP9j BRku7MhZfQCSq4W82ZzF2o8KLsWSeOQyRrAe99f0iMQyhGDv5p5jPavjumZtyA== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:40 +0100 Subject: [PATCH 09/26] drm/bridge: simple-bridge: use devm_drm_of_find_bridge() to 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-9-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/simple-bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/simple-bridge.c b/drivers/gpu/drm/bridg= e/simple-bridge.c index 90abda199cea..a4f74c940dd1 100644 --- a/drivers/gpu/drm/bridge/simple-bridge.c +++ b/drivers/gpu/drm/bridge/simple-bridge.c @@ -180,7 +180,7 @@ static int simple_bridge_probe(struct platform_device *= pdev) if (!remote) return -EINVAL; =20 - sbridge->next_bridge =3D of_drm_find_bridge(remote); + sbridge->next_bridge =3D devm_drm_of_find_bridge(&pdev->dev, remote); of_node_put(remote); =20 if (!sbridge->next_bridge) { --=20 2.51.1 From nobody Tue Dec 2 02:19:38 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 B5CDE3587AC; Wed, 19 Nov 2025 13:07:33 +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=1763557655; cv=none; b=rnnPBCP4CWaWHKLNors/PFQN0baKOz1ibPWflrkqqCRgR9WrAR66Hol4B4hKL+p1bBbQUW/YhIKYOLUhGVPmFv2gyR0l6pFOQBaOm+djyg4tBEa8tkz6T2JdB9eGOnBD9VraB7L3si8VTlO2IvCFff6ufR0/LhoP0hd0STgM7VM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557655; c=relaxed/simple; bh=u+9zOhURuFuL69vb5/1iGlOzuKFqrEvVh3j+ezK1/vw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RsbrbPrNiywBZAigIwGNsI24maNMWAJi7U/b8/tgAnPFvVmH2CVkweRNqUhfDqS6Z8lcUO5hfxhUBfEcfed3mC7LJlGgYKcCd71uTJkbYIDOfC5LfdnLO9MyoIl9kI4NcOPyQ/DScHMZCEOY0OOme0Od/Nwlzs15MdLydoG1VFk= 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=D7DBAvwb; 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="D7DBAvwb" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 4F7F3C11188; Wed, 19 Nov 2025 13:07:10 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8418E60720; Wed, 19 Nov 2025 13:07:32 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 3AAD010371A4D; Wed, 19 Nov 2025 14:07:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557650; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=Ic9ph8Z1Op+ytw7mO9G+BaMZIC2zCJODcJzk4yl4TnA=; b=D7DBAvwbZZjrlq8Ev1VpLDlL34tBKuPw/seXgJf+ILNy9gVNWZJ0CqqBCwICCvH4/YakiQ RoezdaLkZkEwwoeoxUv/tclieBny0oVLZXVOp9rReGTdfThXukdXepfPgAU61m0H6xUhAc uh1W+D4gOhnT5F7YsPL2bvl3G67BcDZyMWSVlzW+l8NALHrkElTq9Q/1hq/E/eqgcF8wxm q4LwhHTGqYGjnMxyKaDmmqjOdlu80GKThQ/XkawPXCHj80EMdrWS0iY/IgdXPCkeUQMcDJ t1IuY87oY/acM/7tOs5YrzrZQMltSj5zzVqjvBfpDFVyZNH4RPA9Q+XGi2T9ng== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:41 +0100 Subject: [PATCH 10/26] drm/bridge: tpd12s015: use devm_drm_of_find_bridge() to 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-10-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/ti-tpd12s015.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ti-tpd12s015.c b/drivers/gpu/drm/bridge= /ti-tpd12s015.c index dcf686c4e73d..cef01106db31 100644 --- a/drivers/gpu/drm/bridge/ti-tpd12s015.c +++ b/drivers/gpu/drm/bridge/ti-tpd12s015.c @@ -138,7 +138,7 @@ static int tpd12s015_probe(struct platform_device *pdev) if (!node) return -ENODEV; =20 - tpd->next_bridge =3D of_drm_find_bridge(node); + tpd->next_bridge =3D devm_drm_of_find_bridge(&pdev->dev, node); of_node_put(node); =20 if (!tpd->next_bridge) --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 8CF3235A931; Wed, 19 Nov 2025 13:07:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557664; cv=none; b=WJq5FOxoIr3kJ9N3YZN9jEUE5dlsy01o+KykM0B/+a5UgrF876tX04zb6CStgDiogBcEv+kx+ImjefbyQbIx6F68sR+ep0QbDijXcm55a8/gKUec+NTggk/GIVk3pw3njQRuFBZQexF6woHJI379kCKVr/lpnYH0+Dn+YWseZzM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557664; c=relaxed/simple; bh=i7ZJP6oiuJliR68hKuB2oCRB15WedcKBJ47VOi4l0j0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=g2GXPupq3Mos1a9yZcVXrA5Uxe8ByJMwP7eJV2Iq2ZIAgw6N/5Mvwh4+qhbJ/f502HBKQUs+NEfB8wbGHJOGkBuG+Qm5QCmAmReHoXYy+bsLXwY7dHOzjsMG2W74ivrFZ15Q8y6jmGVyk+qJViqFJ90ToMQ5fxNtSGlPGm81X6c= 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=MfrTHzew; arc=none smtp.client-ip=185.246.84.56 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="MfrTHzew" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 134841A1BE1; Wed, 19 Nov 2025 13:07:41 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id D45B660699; Wed, 19 Nov 2025 13:07:40 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0283810371A50; Wed, 19 Nov 2025 14:07:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557658; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=TiBLlmwYhB63nFLorXIwQ6qQtOlHHavm3I18CstCbZg=; b=MfrTHzewk3JFkQFD8AyqTB32RaHtpIW9HGz9cfBsuTCF0CBnujN6n5pfwQ2MfVjVxLlbtF fQxV35iN83osuwmb9XyjBN91m1Mfz2dJHoSNWB1UQTnQ1L3YKMU5a0VbTvSYYkqelSm7y2 hEtjSXdkifhua+TKmFxatqevAcjvvwHJs6eki6u3scNSGWjFEGiKKs4+Dy1vCG1L6D5i7V 6kkX4iPBlhX27nu/rB9/L7LHWBOHqgYMq4msDLFTdqV/sdmIpkV5qkVWDnPfXE0zR54Ddr ji7EuIi0QoXvvUAoaZ2xBM1azFoE3R0rBHFQu05kMMC2DQPB76tju8pyDzVWHw== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:42 +0100 Subject: [PATCH 11/26] drm/bridge: thc63lvd1024: use devm_drm_of_find_bridge() to 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-11-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/thc63lvd1024.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge= /thc63lvd1024.c index 2cb7cd0c0608..bc658883c813 100644 --- a/drivers/gpu/drm/bridge/thc63lvd1024.c +++ b/drivers/gpu/drm/bridge/thc63lvd1024.c @@ -132,7 +132,7 @@ static int thc63_parse_dt(struct thc63_dev *thc63) return -ENODEV; } =20 - thc63->next =3D of_drm_find_bridge(remote); + thc63->next =3D devm_drm_of_find_bridge(thc63->dev, remote); of_node_put(remote); if (!thc63->next) return -EPROBE_DEFER; --=20 2.51.1 From nobody Tue Dec 2 02:19:38 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 395AF35B149; Wed, 19 Nov 2025 13:07:52 +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=1763557673; cv=none; b=rStjmb0qLtrg7PRF+l7596NwCn4Ig845UFosRWJrUyL8B/keKKhTHgC3dM7Rz+vPwkoNqDzgHBGZ6+JJjB5LROWjPabjm42nyremZLH+8xHysGhcSrpPzmAcsxQhmffJEWQuS2db6rfjeg3HU4THSsBWrFdGeZj4Ap28VgEAGpo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557673; c=relaxed/simple; bh=Ee1ANQ8piG2Xy1kvkmKEVNulcZW14BhOEuIymfYVqdI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rMwZ/8fS7fme+4e1Iiv3shJ5+gqvX8Is+WDF2Yb7KHpaAFOOAaK03TnkJ+Y32zvSk53R3OYfSixexNNLFeXO3WZxkeQesvUPGhQw7tuSwRm1BOCIhW+kteEIMXVGVcQajw31g+9aa9A1BUZbLeBapsSHfk1ExFxNtX7zi6W0Z0E= 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=cJJeech+; 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="cJJeech+" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 4BE0BC1118A; Wed, 19 Nov 2025 13:07:27 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8223660699; Wed, 19 Nov 2025 13:07:49 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6880010371A51; Wed, 19 Nov 2025 14:07:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557667; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=L/DuXoetl753XeoH5JBP+Wrs0bAqi1NwkMF5ggTwKPI=; b=cJJeech+j8YzxD1bMIO6H2SeggKIcT8NrESK47EY4eYT0VexKcOBmJLBu4WtHcx/wQ2NHJ b/w49MB76ictNWa/evG+tVJvZj4gMXn/v0LDHtcQOn1hjOzpoguGOK6bXsQo1PE2zGhvvV LOZy+PhrHWZsESe9TnbqBHqFhS6RAutEfjCbnft0/7qilzMaF6ZLhdkPKjKduQWXABowzi qqTtQAmY9j6DYQ7Tc4sU0D050lBFGkRnHT9hfGRGks1IRpNhOFSBOU3f1RDzlsjSW4GwXD xPKxq/rnnMx1d63ckr4JuoQiQUNB1RtFgpZyCJ75dent2JfupK8/sDB4rBdK6Q== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:43 +0100 Subject: [PATCH 12/26] drm/bridge: imx8qxp-pxl2dpi: use devm_drm_of_find_bridge() to put the next and companion bridges 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-12-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c b/drivers/gpu/drm= /bridge/imx/imx8qxp-pxl2dpi.c index 111310acab2c..82c407525c01 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c @@ -279,7 +279,7 @@ imx8qxp_pxl2dpi_find_next_bridge(struct imx8qxp_pxl2dpi= *p2d) goto out; } =20 - next_bridge =3D of_drm_find_bridge(remote); + next_bridge =3D devm_drm_of_find_bridge(p2d->dev, remote); if (!next_bridge) { next_bridge =3D ERR_PTR(-EPROBE_DEFER); goto out; @@ -347,7 +347,7 @@ static int imx8qxp_pxl2dpi_parse_dt_companion(struct im= x8qxp_pxl2dpi *p2d) goto out; } =20 - p2d->companion =3D of_drm_find_bridge(companion); + p2d->companion =3D devm_drm_of_find_bridge(dev, companion); if (!p2d->companion) { ret =3D -EPROBE_DEFER; DRM_DEV_DEBUG_DRIVER(p2d->dev, --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 898DA35BDCD; Wed, 19 Nov 2025 13:07:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557681; cv=none; b=uArzJluS26f/l7Td6UbgUWSiM3+PKS7VkRK2fInOnMfyo0iNJ8OU6DFg3Uua4RewoXTfNdZRRrEyA7Y91tzkTKNPcelU8+Pbf4sGz1hnb9d+IpM+FSvifIS4ttyzZKd9j2JDgWG/itzPK3jiNZcIlzI9/v8lB/WG1+nEZDowwbE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557681; c=relaxed/simple; bh=ik4fAk83EoAUjeT8BJBWroOtJcHG2mk9wyTkwYR1gUw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ly9F09NP/3EiSVpkYMyKvwEYnIvxRD7NCpYFZuEZbL26D+Bss4jGM2JroBrRAv3EexJChYoWAI8z/z5IuDV46jJ3qJSUMIQ3w7O4duKbfVA0daUCpPLFOGJVZLb906UdUorIU7q/8aI50Q3tmW/v66LGM3JnrjhZYJD/ta7Lqd4= 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=uxnBVIjB; arc=none smtp.client-ip=185.246.84.56 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="uxnBVIjB" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 2B72F1A1BDD; Wed, 19 Nov 2025 13:07:58 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id EA9F660699; Wed, 19 Nov 2025 13:07:57 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 05BB710371A4D; Wed, 19 Nov 2025 14:07:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557676; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=MmpUcHVH4AV/UOJX3A0mnvWDkPDADuc2PuGmVA8vqXc=; b=uxnBVIjB1u0Ryuyc/Y3TLB0AABl4E/d5EvaNX1Hzww2fiZj7I6R7MKAoQWss0ZsAme6oja 0+zU9y8nnTPbbOF9PBUCcGP1ym2Di51Lm403M3KikDnuKuGa5sDoX36PVxhACPpXQOfy32 CCS0r4NinwdNrP12XfUkAPDUUW+RS6AO2b3636QrCqgP9/ieItSOvVqx51dYkNQ8E32xsR iO+tHilJdxfNqGm2uHv5esAb12kXHDxcpXtRVGwZAF8uMt5eSfw2tUTJTsKygOsVbS/lSR Fbrhd1iJXmmNVktCWSxTdIk9MMEjfqSzjnUwvItMb7uHTtg1En6E6wzip3fACg== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:44 +0100 Subject: [PATCH 13/26] drm/bridge: lt8912b: use devm_drm_of_find_bridge() to put the hdmi 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-13-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/lontium-lt8912b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bri= dge/lontium-lt8912b.c index 342374cb8fc6..eb2b607948a7 100644 --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c @@ -723,7 +723,7 @@ static int lt8912_parse_dt(struct lt8912 *lt) goto err_free_host_node; } =20 - lt->hdmi_port =3D of_drm_find_bridge(port_node); + lt->hdmi_port =3D devm_drm_of_find_bridge(lt->dev, port_node); if (!lt->hdmi_port) { ret =3D -EPROBE_DEFER; dev_err_probe(lt->dev, ret, "%s: Failed to get hdmi port\n", __func__); --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 961303590D4 for ; Wed, 19 Nov 2025 13:08:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557690; cv=none; b=LWChLl6KGFQc6ChjvS5jpnAnCvVubvx5Lys+hd5fAaFA2X9htTkIcBj1kckw/Hx0cJ0PqHQPGHsfgd/PETcf/KJaqDDS2cBQTUHux01T1KG4rXfpKsIIZ/zwPj34s4elgKFKCW+0SdbNANXVvrYW5TxQFErS5pnuIKH6l5VkXpM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557690; c=relaxed/simple; bh=0730MWl77SjS+4ULGZoj00bHJqnfrPI8RzsegoBhS3A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Z79FjqoMTDwj33/JbeR09OfExBhnnjUCVq801vYYS6kI7GUQJvWGknRaK6nko/Wk7jIKG3FUCZwO00pJA+g7nwR7luwfHDSQ4+3JDKxOslgxAYf3g5/rEVG2iXphKnJwZk7bewrfeQejBPHGwF9Jn4w6M1fIGErW1RiPLxiu8QM= 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=tGpJpcoT; arc=none smtp.client-ip=185.246.85.4 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="tGpJpcoT" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 1AD304E4179D; Wed, 19 Nov 2025 13:08:07 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id DFE0660699; Wed, 19 Nov 2025 13:08:06 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 8C1FF10371A50; Wed, 19 Nov 2025 14:07:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557684; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=hr5lfswJPfTid92tMzgAglYJE6XMLDQMI+0uIgfw4lc=; b=tGpJpcoTUvqr9D4fsPjYumEWmiGn8BvrW3vO5koUuEHVzn702FHNMUW+91SkHER9ysNHNv HoYtvlfRDH4dY7Hcob43N1o5PJwrnCMzqK9zOKQFgRO6vjk6ruVmT/HLN2kKchk87pZIuX eSaHiwLs0L5fli02HZiWphPIGM4wbJYcqjPCk+lcB5LRQyaRs7ifhGPqsWAS+SNozGLwo3 RKbgkFK7HrUY31Q4E1RLY99udlJihNY6b5zww3HCIkDFcNmUbnYMR11gLrA/45gSNI1xoq tS6AmGApkDgX15e54FfKINq5ZzMuVjLuYNy5NytHPaN4+MvAVRDofiH/k5GTtw== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:45 +0100 Subject: [PATCH 14/26] drm/bridge: tfp410: use devm_drm_of_find_bridge() to 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-14-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/ti-tfp410.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti= -tfp410.c index b80ee089f880..f6074e78a772 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -362,7 +362,7 @@ static int tfp410_init(struct device *dev, bool i2c) if (!node) return -ENODEV; =20 - dvi->next_bridge =3D of_drm_find_bridge(node); + dvi->next_bridge =3D devm_drm_of_find_bridge(dev, node); of_node_put(node); =20 if (!dvi->next_bridge) --=20 2.51.1 From nobody Tue Dec 2 02:19:38 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 A6AAB3164A0; Wed, 19 Nov 2025 13:08:16 +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=1763557698; cv=none; b=qiAFIAhTDbVghZMl+3/DFkXsVcvHDUf9IKQtV1HrHz7/1Uoq8s5W3ZvtzanNr/9US6YeaBXPs8UhjEZyWTYfP2vB2mwanJjU7tR93qMPZBAxpuu6z2BoCMEe1/o86A+JhNs0L7Qm5oDtQZqs7gOyKKj6AQonqHRVuTs8iuOjI5k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557698; c=relaxed/simple; bh=mVVdR8tRaZpTfmox83P3o/0cq8iLiVX0OOL0cbBUU1I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Bu8K9RA92qeMFJBOq90QMWzkYOXqdq/4dxKrk7HPeRmXFBA+RV0bUzCF8L0Chno1xRiRc0ooKY94r59h9PBHc1QIphcJQV6mKEjuxK+5P4s1VxioXvvipiBmJVmJZGCWLxSMiEIuzar4Ms0nr8KrweK8s2ROHkaQjstf6oCb5TE= 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=vK5hzMDL; 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="vK5hzMDL" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 44B6EC1118A; Wed, 19 Nov 2025 13:07:53 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 7B4F260699; Wed, 19 Nov 2025 13:08:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 46EAE10371A4D; Wed, 19 Nov 2025 14:08:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557693; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=UMItbV1BqSBtiyoTv8FuwBwyend0qlHR9kODuTk7EBs=; b=vK5hzMDLgDAe4/q6DnEnn5bfdWZLtGGnBjzWeyv25mRKYdk8F9/vdd1y3/c0LEAXFOda8W 7KjQq5EnhRQWpXG2A/+3op7Jin/h+zb0WySpIcsNv2IfGuen/0Rbtxw56fOU8ymy3HdgMy yR3rxi2xksUUtEZU3mUUyMGsBSwFiwYF0osffDI/h20AiJZFpLqRIZ4VLDN4lx6xP51UDE Rw3vzHHphsnHKyL4EjruQ+gun05NIDYtEETL6bJQg78eKuNejwynI6ELl0apl34BoKxGk4 m6w/np10gGRk1Mex+aghV3+5pG5ba9uB014ZFleymMw0U3XJO3p3sFoLbIK/pQ== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:46 +0100 Subject: [PATCH 15/26] drm/bridge: imx8qxp-ldb: use devm_drm_of_find_bridge() to put the companion 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-15-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c b/drivers/gpu/drm/bri= dge/imx/imx8qxp-ldb.c index 122502968927..e0bd227fd47a 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c @@ -552,7 +552,7 @@ static int imx8qxp_ldb_parse_dt_companion(struct imx8qx= p_ldb *imx8qxp_ldb) goto out; } =20 - imx8qxp_ldb->companion =3D of_drm_find_bridge(companion_port); + imx8qxp_ldb->companion =3D devm_drm_of_find_bridge(dev, companion_port); if (!imx8qxp_ldb->companion) { ret =3D -EPROBE_DEFER; DRM_DEV_DEBUG_DRIVER(dev, --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 3D1FD3596F3 for ; Wed, 19 Nov 2025 13:08:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557707; cv=none; b=M4/QJkZuVKHkPHgN+fCKVRP0WFNYJe2QREqdGp86qKxn5MrQm37nATlGdIpmf3jvneSJI3cOuLoYNXx9XUKEP/hYEjSvUw1aooN+6lvZ2Kk8wm+aTdh5sbGqJHDHAHFqJvMMKyGDjQhkfhvKHbNgtC7ae6xy1ttevTQ/1/JtmY4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557707; c=relaxed/simple; bh=ifiT1sQsiZG1JRD29TUMntFMGuBnSlrx956kvXQchqw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cT9TsQVPqXMIZzkm7FKL1WJCgewLvEkSxVL71tFXodX9nh3waFRjdFH0KL+FQ4uUpY+EKuN77rsMckYjSCBiODdpeCfpwpeWt/yPIJheHEhir9WwevHhR7abDKOUs7DTPaY/lXtzj8GQxubyO6AGeitTjhRioQcxjcuzHp7xyUE= 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=XslKHHOY; arc=none smtp.client-ip=185.246.85.4 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="XslKHHOY" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id BCA024E41795; Wed, 19 Nov 2025 13:08:24 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8ECF460699; Wed, 19 Nov 2025 13:08:24 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1C55B10371A51; Wed, 19 Nov 2025 14:08:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557702; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=mViNdbRzGaaVnwve0SCNnc2a5Fs3PLzmuOdUXgD58UY=; b=XslKHHOYor7dNfpOR5k8O6dwCdDWNf7EDetAevL57Z9FclN7i6NDjPuILa6tOj1vQg7CnP sBABuLNrXbyrz+Mk8fK08qxFss/z9ibIZ4PchkWQOZncn0x+ga0V6dG1iOWGC4Mj/Wz5Tb QJdpfHZB/R5bsVvcl2THwLCdcPS/Ii3GdPmT6/aQocphyYVYOebGQymq/aKBw/xiKCd6b1 EAWkFcgeEXGiDhKxMr3ePOXpQ1ob99p6qLxOPBNe0aOP6emzt+K0ZG73HxH+rTVKBXDHtS QzM3tn4A3Y3u1J6rwIYlfo9bBAhAaC5tkW3E+1L4RZzH2kdpNVhuBV2jTnAujw== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:47 +0100 Subject: [PATCH 16/26] drm/rcar-du: lvds: use devm_drm_of_find_bridge() to 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-16-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/renesas/rcar-du/rcar_lvds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_lvds.c b/drivers/gpu/drm/= renesas/rcar-du/rcar_lvds.c index 001b3543924a..8eb73ca25eaa 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_lvds.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_lvds.c @@ -740,7 +740,7 @@ static int rcar_lvds_parse_dt_companion(struct rcar_lvd= s *lvds) goto done; } =20 - lvds->companion =3D of_drm_find_bridge(companion); + lvds->companion =3D devm_drm_of_find_bridge(dev, companion); if (!lvds->companion) { ret =3D -EPROBE_DEFER; goto done; --=20 2.51.1 From nobody Tue Dec 2 02:19:38 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 327CC3590DB; Wed, 19 Nov 2025 13:08:35 +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=1763557716; cv=none; b=U5ZqtinNAmb0+6cxvElx/URpk7xotq8Le0JdqbUBvT0ktwnrm/RDHdjjUWfa8TeXJsOIOVXLVvmY7BLyt5MOSlQgm3DfzV+f/LhTPcTPF6A66d0U6KAhJ4mJsc6d1549pNjAKDf4W5muVPhVQIBmRIz3orMxpKmZi1Fz0J/rsCM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557716; c=relaxed/simple; bh=pueYd5XhK2WG9zkrRfsetUySzUQobM/AevfoXGJEs6Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=memB+Z2TLfEASZTjCSz5V7AlyFq32MqeXYpXa6uhmJAMRgyDuvc8s4+URKLxYDqFjigvhv/J6wHAxQWUAcarWRQmV58uDKd/M6sw49A5SvIRxAkvxE64kV53/dFFEm3khyqYWUd3Qk9bVjrwZsKR1kV7hB23DQ33lykAI9YtBEk= 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=P5dsdtyG; 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="P5dsdtyG" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id B4AD2C11189; Wed, 19 Nov 2025 13:08:11 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id E9A0B60699; Wed, 19 Nov 2025 13:08:33 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 4B19E10371A53; Wed, 19 Nov 2025 14:08:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557711; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=adrn4RHgNjcc9+GLotdfjAlx7xMGzATdhXAL6bsPOLI=; b=P5dsdtyG75A6W8URuwcCH5mPIAbQK40c/KfangQEpNMF96AppZNaIhDTTiO6FJa2okI5Yc m5vUhMcDdQ3QhzsaNv74odqc7MujC+dWT2cIaAE91jmaPE7svMI/vMNxXmUfm99YW3p7y/ Uk98GEjHg3TX22Mo2CBdzp9yFqJd/wd3Lc24dxeGQWaYhZXnQFdOT151DpCBX7qwwby9jC 6ZS7asRzI+9z6jFnvDA6UpUe89kKWud6iIO7dWfeabJVFcquiBY89tV50T842g7WCpiAD7 X5kZNOhRlu6Ey/EUzCNAz9pTyujTX35+MAHzbgltj/sLbGEN8Ev+npS9hsT0HQ== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:48 +0100 Subject: [PATCH 17/26] drm/meson: encoder_*: use devm_drm_of_find_bridge() to 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-17-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/meson/meson_encoder_cvbs.c | 2 +- drivers/gpu/drm/meson/meson_encoder_dsi.c | 2 +- drivers/gpu/drm/meson/meson_encoder_hdmi.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_encoder_cvbs.c b/drivers/gpu/drm/m= eson/meson_encoder_cvbs.c index dc374bfc5951..577f6b1e162f 100644 --- a/drivers/gpu/drm/meson/meson_encoder_cvbs.c +++ b/drivers/gpu/drm/meson/meson_encoder_cvbs.c @@ -241,7 +241,7 @@ int meson_encoder_cvbs_probe(struct meson_drm *priv) return 0; } =20 - meson_encoder_cvbs->next_bridge =3D of_drm_find_bridge(remote); + meson_encoder_cvbs->next_bridge =3D devm_drm_of_find_bridge(priv->dev, re= mote); of_node_put(remote); if (!meson_encoder_cvbs->next_bridge) return dev_err_probe(priv->dev, -EPROBE_DEFER, diff --git a/drivers/gpu/drm/meson/meson_encoder_dsi.c b/drivers/gpu/drm/me= son/meson_encoder_dsi.c index 6c6624f9ba24..dd5d6e6a7cb0 100644 --- a/drivers/gpu/drm/meson/meson_encoder_dsi.c +++ b/drivers/gpu/drm/meson/meson_encoder_dsi.c @@ -120,7 +120,7 @@ int meson_encoder_dsi_probe(struct meson_drm *priv) return 0; } =20 - meson_encoder_dsi->next_bridge =3D of_drm_find_bridge(remote); + meson_encoder_dsi->next_bridge =3D devm_drm_of_find_bridge(priv->dev, rem= ote); if (!meson_encoder_dsi->next_bridge) return dev_err_probe(priv->dev, -EPROBE_DEFER, "Failed to find DSI transceiver bridge\n"); diff --git a/drivers/gpu/drm/meson/meson_encoder_hdmi.c b/drivers/gpu/drm/m= eson/meson_encoder_hdmi.c index 8205ee56a691..e2d861239eda 100644 --- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c +++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c @@ -390,7 +390,7 @@ int meson_encoder_hdmi_probe(struct meson_drm *priv) return 0; } =20 - meson_encoder_hdmi->next_bridge =3D of_drm_find_bridge(remote); + meson_encoder_hdmi->next_bridge =3D devm_drm_of_find_bridge(priv->dev, re= mote); if (!meson_encoder_hdmi->next_bridge) { ret =3D dev_err_probe(priv->dev, -EPROBE_DEFER, "Failed to find HDMI transceiver bridge\n"); --=20 2.51.1 From nobody Tue Dec 2 02:19:38 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 673E83590DB for ; Wed, 19 Nov 2025 13:08:43 +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=1763557725; cv=none; b=kpNbZCu4ZorqeDYUoUJcm/HZVxjEXjuSq/dW4bEJqvDqqe8DodENWEfjDw24gJ09OlO3qHa7yPm+faw+K0uZvGG8voA7zwSmh3Tj92+jKLwd28nlY+6zM371+95zLRyTZ0EEDtvm/Dqi21SpRH/Oh0H2l/kdqoA0zePX+93FXcU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557725; c=relaxed/simple; bh=jRs3PyqGHq4G0P7dY2K5+dc284Izsx95DF4IBpYxTAM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HzwuivAy5Cilc4EzIlIM/oWxICOFgr2bHH6oTcdVZldP6DkwHz4p/m+0nY/gkHXslG73wtU+7s9KYn8Y2L9vJZgDpB/9GbbgAfrVzP9BsnAqk4detkhqJR3YV+ztzjOzdlX+UjuIurZs0TSTTAnNYHP57pv5dbS0HyGWxFCH8jA= 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=JCYmeXmP; 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="JCYmeXmP" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id C4038C1118A; Wed, 19 Nov 2025 13:08:19 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 051B160699; Wed, 19 Nov 2025 13:08:42 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 4191110371A50; Wed, 19 Nov 2025 14:08:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557720; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=igNERjzw42v425WqlzXvdTEyLpvMyT8MhX7BK4cDcdk=; b=JCYmeXmP/seI6JRcUYUke20noK7upDq8K5d4C1WYodBXggU8chHWTsFhA/DCJSOK8W8p3w 7mKCWFCpSBu+XKWkGgbuyvXbQaOrpkGA8RlYjt+7YO2u7tT54BfQF+OjpVUg7JpVkahT7x gPRNbEEgJuIICj/Rh8Mlm3KAnGC6yxZF0LSmWyfbToHu4h2tL65ARh+xyvohUM7Dl7gqOV ExpNJbaUX7ssSBXMvWo5kgqDTs89FOY2DHdLxZwzIVAw7mJHRSu1f+LtDo1wpz9klOrvLJ xa4IlhFU80gqMUfrf/ZA6yHvNOfNwkJjb01HqNaO6A5/18aSMESPHEqoKB5qdg== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:49 +0100 Subject: [PATCH 18/26] drm/bridge: sii902x: use devm_drm_of_find_bridge() to 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-18-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/sii902x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii9= 02x.c index d537b1d036fb..ca3ef23683a3 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -1208,7 +1208,7 @@ static int sii902x_probe(struct i2c_client *client) return -ENODEV; } =20 - sii902x->next_bridge =3D of_drm_find_bridge(remote); + sii902x->next_bridge =3D devm_drm_of_find_bridge(dev, remote); of_node_put(remote); if (!sii902x->next_bridge) return dev_err_probe(dev, -EPROBE_DEFER, --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 2C04F358D26; Wed, 19 Nov 2025 13:08:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557734; cv=none; b=NC1vOocq7eP3bXI2Sh/xvgyx+zkDf9970uvap0MTWwVGjiunie+Acbf+Mqd8Sjg93E3NfBhKE839O2O8QX9oY4/zOYyal8qjGr3X5841euYdm+/KXkbgByli5Qx2tuWTAlUR/MBhdTTkYlLd6TictZKsCOyUz4T9qsFwAsNlyAc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557734; c=relaxed/simple; bh=SAp1hbmAYiyBZe/8noL8hvAY8yzxwcTdFljgL87JAck=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jVKXT8a2VJARgxhGggQXCSgEXpxD0fGAqoqYKskqscmvp5Dk2Ot1I2HHxmy/Nf4it5OB65CH9WyDviSUpS5+aP8idkdNiisbt50GPQRosJMnw2ZlSen5WJtF035yVI8ld0WwAchKsKS8VE916uOTnt7evxMeo/iEhIjY1n3qzC8= 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=Mr/S+z4r; arc=none smtp.client-ip=185.246.84.56 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="Mr/S+z4r" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id B7DAB1A1BE2; Wed, 19 Nov 2025 13:08:50 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8A03C60699; Wed, 19 Nov 2025 13:08:50 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 8AF7E10371A51; Wed, 19 Nov 2025 14:08:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557728; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ug+PhDpwof8UC1as0UO8CJI8RrRNzwgCCqAFDo7o0RQ=; b=Mr/S+z4rb6W/sVm8IPs7WuYmJSreXiSjDzMbksS0wSpWfu7AHKR5qbat7HA5+dytFRMgpG SW6oZB5ucrzHcjiwTVDq9AqizEVGFHUwRFG1mPcltSaPb5Nuu/ZgGOStmmZ1hUSS+Xx4AX QO/2AAwYsHeBDp/sRP+pnY3XINDKFM68uLt3YIIJC9Q0ZZDhnEKMGARWAZT52+AFIdZq89 PqkN6f+2D9GAh0JvsHNXtNl8Jb5RjP122UVzzI+HEd3rYaCZyiwkq2/GuCtcZlqCqDB636 gbI5wwYwE3PvH0+BHrtyhB2AkWfgf5z5Vf0BKNbpccKs+P3F4Q+8DEfCcDLd8w== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:50 +0100 Subject: [PATCH 19/26] drm/mediatek: use devm_drm_of_find_bridge() to 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-19-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek= /mtk_hdmi.c index b766dd5e6c8d..57a926bdf8b4 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -1405,7 +1405,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *h= dmi, return -EINVAL; =20 if (!of_device_is_compatible(remote, "hdmi-connector")) { - hdmi->next_bridge =3D of_drm_find_bridge(remote); + hdmi->next_bridge =3D devm_drm_of_find_bridge(dev, remote); if (!hdmi->next_bridge) { dev_err(dev, "Waiting for external bridge\n"); of_node_put(remote); --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 EF8E736403A; Wed, 19 Nov 2025 13:09:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557742; cv=none; b=icbfOSTGdV37TTpSQIAY6+PG/quGcLFovRk6QycilJ+B5Q+Ys7LLbayrDEJ5Uga0gkv1taok++NzdRslTbIpYLuKr2kghSqDGpAv1U5vgld5vuZPCcVCR6d4dRt884Wfi8b59HDIqcFdYhsK0xhGxwznU8U64M7i0zuIESVIGZw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557742; c=relaxed/simple; bh=sVvnC+p+t9Gwx3qBtCS9aSVrco/z/DKrTu9CHqw0rt8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=T+iO2uh2J5M3lTHKaJmSKxkAfr0Z2T/1JWyICaIPIQ0VaFXEDJ+Ak4ECh8iIGVzKbQk28ZlBoD76P3/wlqLNWp/QS9L7c8YFIM9JYnDu8WzW4j13665u0rhFTWlzFghbwxs4nUG/2BlVL9SWHNgm2uaAVpCb8qoF0WsAuqEcfKg= 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=BeFVaMzF; arc=none smtp.client-ip=185.246.84.56 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="BeFVaMzF" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 533481A1BDE; Wed, 19 Nov 2025 13:08:59 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 255EF60699; Wed, 19 Nov 2025 13:08:59 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1C63810371A4D; Wed, 19 Nov 2025 14:08:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557737; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=qwyda0vKD9Tp8nxe63uhqvTZQcM8lKqf106QJfQpcEU=; b=BeFVaMzFK2wStLtQ6jN2PuIbw30QcIRyV07gaLfbC08eRaTBbvzK6qEQ5Xb6ov+h/iWM1T 9cIT07v05S+0hkkUEYssaFADxBW2rAFRMMZ9BQvpQStTzWj0FmRCofNSEEByOriqeLspUk sO4g/tiSp0Ye8zo8TI6KSxm9Hyv1X6+oJB3o3uWuilmWeW+iLUPUCgmAXvbLwHI84EGT0Q vruZSJfloAbVQJW7J1zvOa0F7djleb7CANrh5s4hBncBpAp5hJuFViWHdpXIkcoHfW1/Ts +owSUwBtGd6P6iv7enr9zmS4fdDnCvDsXBuF9yj52/rZrAgdjn47Gat0iBdoLA== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:51 +0100 Subject: [PATCH 20/26] drm/kmb: dsi: use devm_drm_of_find_bridge() to 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-20-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Note: this driver stores the bridge pointer in the adv_bridge global variable, which could hold a value from a previous probe. However the code flow always sets the adv_bridge value in the probe function before it is read, so the change is safe. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/kmb/kmb_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/kmb/kmb_dsi.c b/drivers/gpu/drm/kmb/kmb_dsi.c index faf38ca9e44c..05a6ccc1bd22 100644 --- a/drivers/gpu/drm/kmb/kmb_dsi.c +++ b/drivers/gpu/drm/kmb/kmb_dsi.c @@ -251,7 +251,7 @@ int kmb_dsi_host_bridge_init(struct device *dev) return -EINVAL; } /* Locate drm bridge from the hdmi encoder DT node */ - adv_bridge =3D of_drm_find_bridge(encoder_node); + adv_bridge =3D devm_drm_of_find_bridge(dev, encoder_node); of_node_put(dsi_out); of_node_put(encoder_node); if (!adv_bridge) { --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 5ED0635A15E; Wed, 19 Nov 2025 13:09:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557752; cv=none; b=DxhnYWBqL/8UrVZlCDXe9UOUMub9DAHC9awR63IhdAQAfNY2mPEXghsxAqGjlF9rTIMRZcrxEI9DnVOBRuJolXFQKfzeemAnfE0e5N/e0XGU0wz3Z4+NO7nMYK2UE7twP2UA6ET1Gc2/PP701smavOIlnY5gHwK1pZ/zHxkLf8Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557752; c=relaxed/simple; bh=bszebnadGFzIEwTFIZcX/5IWytT5oh6iavZ//AGMWH8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qtkCPqwAKVIZEfTJytd0D/qnB7fkeHnwnEMNJ18FxMTPFlYLXUDKuBLwb7fNRdpJeNYgXaqDuKLVASLtYooM7szPeCRN8lKEYwxWsCYTWE0gwSTXkJQhz2HZzbcE+zo9w2MXAJV1lkj9Hox2p2bg9zuRLWBpTVyfDOKA15y6oG4= 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=jaLXfTlg; arc=none smtp.client-ip=185.246.84.56 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="jaLXfTlg" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 0AF0C1A1BDA; Wed, 19 Nov 2025 13:09:09 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id CE48160699; Wed, 19 Nov 2025 13:09:08 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C17DC10371A50; Wed, 19 Nov 2025 14:08:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557746; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=3R9jccAwgQfoRpcq0lXtghHeDDBdPUn13/IbmzrW/D4=; b=jaLXfTlgfGJD1q4ycUmrcHO2vva+cVfi9yOr1R17eKYTKZugDmnQwimfnLmkK5B7MW1IR2 pWtow/fuKK/UsBCMQuW+QEcnd7b/qiZ0l91BMWVXucVPrLHevhYo577jnatl9XyyEkqOPJ 0MIUPKAMLKM57gtwl30bSRAW/YGJDgJQzs739b8cHP1uvfmic/uBlPO7mqEwxYVV3YFhn1 0bl+kJs//1IeryI8MRllnVxIt19k54Lq9Qj+hamfLB86gXMkJNEbKwftXlssXG36uUxTp8 gPEgMAMNaD/dr39Jvza7BijfAYSTMuRjdQU0495vGo7L6tfonnVkiBXufzWGDA== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:52 +0100 Subject: [PATCH 21/26] drm/imx/ipuv3: use devm_drm_of_find_bridge() to 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-21-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c b/drivers/gpu/drm/imx/= ipuv3/dw_hdmi-imx.c index 07e5f96202d4..1e6be89c3815 100644 --- a/drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c +++ b/drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c @@ -241,7 +241,7 @@ static int dw_hdmi_imx_probe(struct platform_device *pd= ev) if (IS_ERR(hdmi->hdmi)) return PTR_ERR(hdmi->hdmi); =20 - hdmi->bridge =3D of_drm_find_bridge(np); + hdmi->bridge =3D devm_drm_of_find_bridge(&pdev->dev, np); if (!hdmi->bridge) { dev_err(hdmi->dev, "Unable to find bridge\n"); dw_hdmi_remove(hdmi->hdmi); --=20 2.51.1 From nobody Tue Dec 2 02:19:38 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 6E515368280; Wed, 19 Nov 2025 13:09:18 +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=1763557760; cv=none; b=oawnkWqzgOHvbfd2ndRmQXMqqO0G969TNtoh2BTtQqVn31WW7T/0IKMMxZbPTJqtKLXcHlIPxuQpGuwNZmcdp5qZZVX/3n648XnPGaWwqF67yP10K4jYtSU4ndFuS1cEBKBDr4UHiQwlpPvs+TxlgoquixuPvTp44YXS+vC6YRs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557760; c=relaxed/simple; bh=g4W3nGWz7kDNWWR5wDnnR9ZFaBT4TYm6dVG0lI1Asu0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lVVGTEyVHcCWkHv4cdOjFRKj39W+B/ojDPt+R7Jr9gEJsdroSA7bmc+3nKKyE1TD/zzNX8e85JqJGJ0TccdQn2Zb6cCboD+Df4im8rtz9qNP3pjgRfXz/jIHWMzCr7Jmo0FOA+Esgy5yo74AG6lejUZ6dsNfJhzajlxkkkwe8tk= 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=zzOqOk2A; 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="zzOqOk2A" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id E12FEC11188; Wed, 19 Nov 2025 13:08:54 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2077E60699; Wed, 19 Nov 2025 13:09:17 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 433FD10371A4D; Wed, 19 Nov 2025 14:09:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557755; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=+WocwBswe0ZjU0ZUZ8gWtVZB5uIKU+1WladPosC/xAE=; b=zzOqOk2AjfuhXit0a3804YcCEpHftU4Ltmd1Ng6vhXMtUEghjGbtQvRdhJ4/3p8XeGvbls 8s06zozH+7VB1iQNDCuTYRjZ/gxkbGfjG6GilcUCrKyNHyGIo1KEueHrenQVgmlZJCI6XZ nGiNRj57cTRxBxrEepIZWM5NOp8PXAkk/J/J+s6NwhC68cMVUYWyJoAmJV7rXUL7lRYnoH gkOj7pbj8jRy6Zl/D4ERmEYkAwpcKR0diRj7pXzvlmfUDbKNZOoJ4VlGp7/LwKbX038jPQ ZPJRp5gD2UDBo9m49vcwG5Xg8Tej5KxKNbSysmtjjV0tNTFZU931xjPg1QdK/g== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:53 +0100 Subject: [PATCH 22/26] drm/exynos: hdmi: use devm_drm_of_find_bridge() to 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-22-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/= exynos_hdmi.c index 01813e11e6c6..3fe32093f0c7 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -1779,7 +1779,7 @@ static int hdmi_bridge_init(struct hdmi_context *hdat= a) return -EINVAL; } =20 - hdata->bridge =3D of_drm_find_bridge(np); + hdata->bridge =3D devm_drm_of_find_bridge(dev, np); of_node_put(np); =20 if (!hdata->bridge) --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 BAD3D36999D for ; Wed, 19 Nov 2025 13:09:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557769; cv=none; b=VvTTycqrJJ/C02t/LWohhi8i7CGvaDhxzaI5C8ZX+twYechATkEjCY7PVKYyCa/y8Ijmb0ZrJiqSe0cuYUP+W5tnrLCplsNVWPUc+hCUSKHHoztsKjc2F4yqtIJ24OJiOkHva0KjS4voCtqd6yPX7sqLyPtXpRNE5mDC62IfKX4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557769; c=relaxed/simple; bh=/70tjT9dzfw8yOaO5/ZxaOL3UlDHY2rodU0mXAjX9tU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PXwA+nLC/+sfXBz+tvdfk7boNcTq0lDWwGcQDIcVn56FS71qGl4/TxuYODdpf363/sTvUjkCxCB29ASz95n/QsBM1Qoz6ExozM13+2l/bA5UosACa6QODk8HKiLO83dTLxNe15FVRJWjvwYdajvWSkK/z+DZCx9TwL/Qv9CTspg= 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=ekQEcTh9; arc=none smtp.client-ip=185.246.84.56 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="ekQEcTh9" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 465F51A1BDE; Wed, 19 Nov 2025 13:09:26 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 17B2960699; Wed, 19 Nov 2025 13:09:26 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A43A610371A50; Wed, 19 Nov 2025 14:09:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557763; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=GH4ehmt4plFzQH5Osf+5oKS1J3TjlEEUuJu9h8Bc8BU=; b=ekQEcTh94TDXpePG1ClazDNbBRyUhyFkHA/z5izueWaicKDyV8dxg5o3/ADXmRn7dmBEob +t5xwHnrKbQRSS0hTl9Uxbq+MXykRX1FIXHTNfDNGjAvzGoq0g2wSQCLkU2jW8aa5r7kFG gU9P7PEmLemfEQAsW+29qt6Z/UpOyYy3jNRcDXe1yVucZzb5xIVjg4/YYgXHTDi8fGfsNP TYnXixbicq9dAar9oa1sr7jcstVqeqpC/eg+rZ+zSiSKDferqTLcUcRGiMsjmatg3gxtE5 VE2Umxa0ZR2AkklMb5Kt8IQquN1ImUhtEXPfA/QoPkhOLHWO5oXGSniJjNJzsA== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:54 +0100 Subject: [PATCH 23/26] drm/bridge: dw-hdmi: use devm_drm_of_find_bridge() to 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-23-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.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 devm_drm_of_find_bridge() which puts the bridge reference on remove or on probe failure. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/br= idge/synopsys/dw-hdmi.c index 3b77e73ac0ea..8cf72305dcdc 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -3318,7 +3318,7 @@ static int dw_hdmi_parse_dt(struct dw_hdmi *hdmi) if (!remote) return -ENODEV; =20 - hdmi->next_bridge =3D of_drm_find_bridge(remote); + hdmi->next_bridge =3D devm_drm_of_find_bridge(hdmi->dev, remote); of_node_put(remote); if (!hdmi->next_bridge) return -EPROBE_DEFER; --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 4077435E52D; Wed, 19 Nov 2025 13:09:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557778; cv=none; b=aTcxtxnkhwijP/7MTQVzcYZcL1GCuUIgaDxiL0SS0+FyZkP71G6AEylJpmCqCiv2WzIn8REiZdCjK1AR1LqlgoNCdhsocsHj8ZIhjbFGs982/CfFNjCcGj9s0dQtbULFMWPGw1XB2VZT6q1luEl9NbTB2DmmT3eC2/r59H4w48E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557778; c=relaxed/simple; bh=fQu/W+0tolr6+U6fRt83IgC2NQt38kvoADgiW4WR5Hc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ifxRSWjyh1rbQKsJZrsPnQWE3rN7A6P4qc98DVqWObbYUHr8QNJayQi+36wvMaZGdXI1wBP7C64R/afaf6gWsXRpldm9c6PRfdf6lroy00RT+3IZBTmnQgXDXAYTPzQeIo+Krw2hkpa6e9kloROWw2nxe19xrPJgA/n6LWhJSN4= 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=eFO/4Rlu; arc=none smtp.client-ip=185.246.85.4 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="eFO/4Rlu" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id CFDBB4E4179E; Wed, 19 Nov 2025 13:09:35 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 9A93860699; Wed, 19 Nov 2025 13:09:35 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6C22710371A51; Wed, 19 Nov 2025 14:09:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557773; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=4KsAxr99sySjsHY4TzPD3tHVsqK24nvaf2pqUbhtfhE=; b=eFO/4Rlu3Uf78uzhv0JnR9qUBkqFoe2WKu1Co1Zu2JA1WIDasTZJBx0sK1DxfzXlABNasG lb2jGVecmiky5rYpazHGScJ/BcAJ+e3nM+IrKfhG+z5BM5szUFS+l1xFAoQFKN4TNOQOVv vMTI3SNx/cFdaIT1Z2dbGRkb3Zbb000yEiForx2ryqeIbKDGL+29/XmBsxrXpO+GVPrJ63 1H4rhHXTRroALZGquT9aB6ANlKDmYEcNXjSbskd09sExCd16ftKtkvWnm0rUFwU7H6H/eH nYdjSyck4h6Ng9NSBA9KBeI/qQB+Qu0y0yEisFRcfBqgnC0D0QHvj1KjddK/wg== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:55 +0100 Subject: [PATCH 24/26] drm/bridge: imx8qxp-pixel-link: simplify logic to find 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-24-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 imx8qxp_pixel_link_find_next_bridge() uses a sophisticated logic to find the preferred next bridge, using an array with two supporting index variables. This is more sophisticated than required because we only ever need a pointer to the "current" bridge and to the "best so far" bridge. Additionally this logic is going to make the addition of proper refcounting quite complex. Rewrite the logic using two drm_bridge pointers, which is by itself slightly simpler and is a preparation step for introducing bridge refcounting in a later commit. Also reword a comment to make it clearer. Signed-off-by: Luca Ceresoli --- Cc: Liu Ying --- drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c | 23 +++++++++++----------= -- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c b/drivers/gpu/= drm/bridge/imx/imx8qxp-pixel-link.c index e5943506981d..53016f0d53a0 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c @@ -261,12 +261,10 @@ imx8qxp_pixel_link_find_next_bridge(struct imx8qxp_pi= xel_link *pl) { struct device_node *np =3D pl->dev->of_node; struct device_node *port, *remote; - struct drm_bridge *next_bridge[PL_MAX_NEXT_BRIDGES]; + struct drm_bridge *selected_bridge =3D NULL; u32 port_id; bool found_port =3D false; - int reg, ep_cnt =3D 0; - /* select the first next bridge by default */ - int bridge_sel =3D 0; + int reg; =20 for (port_id =3D 1; port_id <=3D PL_MAX_MST_ADDR + 1; port_id++) { port =3D of_graph_get_port_by_id(np, port_id); @@ -300,24 +298,25 @@ imx8qxp_pixel_link_find_next_bridge(struct imx8qxp_pi= xel_link *pl) continue; } =20 - next_bridge[ep_cnt] =3D of_drm_find_bridge(remote); - if (!next_bridge[ep_cnt]) { + struct drm_bridge *next_bridge =3D of_drm_find_bridge(remote); + if (!next_bridge) { of_node_put(remote); return ERR_PTR(-EPROBE_DEFER); } =20 - /* specially select the next bridge with companion PXL2DPI */ - if (of_property_present(remote, "fsl,companion-pxl2dpi")) - bridge_sel =3D ep_cnt; - - ep_cnt++; + /* + * Select the next bridge with companion PXL2DPI if + * present, otherwise default to the first bridge + */ + if (!selected_bridge || of_property_present(remote, "fsl,companion-pxl2d= pi")) + selected_bridge =3D next_bridge; =20 of_node_put(remote); } =20 pl->mst_addr =3D port_id - 1; =20 - return next_bridge[bridge_sel]; + return selected_bridge; } =20 static int imx8qxp_pixel_link_bridge_probe(struct platform_device *pdev) --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 EAEC735BDC9; Wed, 19 Nov 2025 13:09:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557787; cv=none; b=UBLYtUoryC70BjaW7DsSwN9zjo4y8aV7rJo7G9ZbkYaZTc8Lz+ZyYZRAeHQrf7iq0aWDQA7K6B+kBbdvbDdRffXYGs+y7onp5fVPcldl87jOyRZIER/t0q70ij5CoMmZ1X4aDl7LEUUiQtRMsgvA+Z/htFm4w77nrIAR5jjs9Dk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557787; c=relaxed/simple; bh=acl0bk3hOTBZPt5mvPuPSXJnLBTHafncgkjfVfpOeRQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RjsRF15NPic5A7lw66yjtb7Vovu00IRfQKQ9SbobMPtH33FD3hnj1FtFNg1sY+4DQ1Skin08NIjnVtD1YvHWTQ+hqI5PwHWv6h2qCYFAyVht+kykbHsfAPOlPJ+2WgD/28T1klQSn/4fFcxNdpjy6Zp68wQsERAb8lrn3dn93yw= 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=kU1XUdf8; arc=none smtp.client-ip=185.246.84.56 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="kU1XUdf8" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 8B63B1A1BE7; Wed, 19 Nov 2025 13:09:44 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 5EF5C60699; Wed, 19 Nov 2025 13:09:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0056410371A4D; Wed, 19 Nov 2025 14:09:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557781; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=6ByjE2fDXvVGt+lqsSwFhGv2RTSfBXtxTluzyqLNTpc=; b=kU1XUdf8s2RAsVwDA2ek/rPXMMhQONyRg2a1IvO4LGjlvPdwi13Mv7MIRc+3a1UDym0x7q 5T/7OJCko+FA3Peet81z49JLbAAjnJSLki4fI1abemgPR1fdD9Cbmnvctzj2D7dw1sLVxR OBf4shc2KNmMVe3szWeZ9GSS/rMEvqaggAlMD/NtvK/qElnzbxMi2K8zt6HXzsYJq5yLFK +oJ1e+O1SCggskLwhwZ6199ig4iTiDBFn23TrLsa/KYeufoAUSCYRm0aNfdv0HezUP9+5j 0bTIgxDzLor4AaAYgJpyV0e4fkWnc9x0kFf0tFt/GWqsrCNwIliDqcGWN5nh1A== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:56 +0100 Subject: [PATCH 25/26] drm/bridge: imx8qxp-pixel-link: simplify freeing of the remote device_node 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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-25-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The main loop in imx8qxp_pixel_link_find_next_bridge() requires calling of_node_put() in multiple places, complicating code flow. Simplify it by using a cleanup action and making the 'remote' variable scope local to the loop. Signed-off-by: Luca Ceresoli --- Cc: Liu Ying --- drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c b/drivers/gpu/= drm/bridge/imx/imx8qxp-pixel-link.c index 53016f0d53a0..2ecc3c1051e5 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c @@ -260,7 +260,7 @@ static struct drm_bridge * imx8qxp_pixel_link_find_next_bridge(struct imx8qxp_pixel_link *pl) { struct device_node *np =3D pl->dev->of_node; - struct device_node *port, *remote; + struct device_node *port; struct drm_bridge *selected_bridge =3D NULL; u32 port_id; bool found_port =3D false; @@ -286,7 +286,8 @@ imx8qxp_pixel_link_find_next_bridge(struct imx8qxp_pixe= l_link *pl) } =20 for (reg =3D 0; reg < PL_MAX_NEXT_BRIDGES; reg++) { - remote =3D of_graph_get_remote_node(np, port_id, reg); + struct device_node *remote __free(device_node) =3D + of_graph_get_remote_node(np, port_id, reg); if (!remote) continue; =20 @@ -294,15 +295,12 @@ imx8qxp_pixel_link_find_next_bridge(struct imx8qxp_pi= xel_link *pl) DRM_DEV_DEBUG(pl->dev, "port%u endpoint%u remote parent is not available\n", port_id, reg); - of_node_put(remote); continue; } =20 struct drm_bridge *next_bridge =3D of_drm_find_bridge(remote); - if (!next_bridge) { - of_node_put(remote); + if (!next_bridge) return ERR_PTR(-EPROBE_DEFER); - } =20 /* * Select the next bridge with companion PXL2DPI if @@ -310,8 +308,6 @@ imx8qxp_pixel_link_find_next_bridge(struct imx8qxp_pixe= l_link *pl) */ if (!selected_bridge || of_property_present(remote, "fsl,companion-pxl2d= pi")) selected_bridge =3D next_bridge; - - of_node_put(remote); } =20 pl->mst_addr =3D port_id - 1; --=20 2.51.1 From nobody Tue Dec 2 02:19:38 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 CB23835E52A; Wed, 19 Nov 2025 13:09:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557795; cv=none; b=R2hc4iyiy9Xw1VqYceM3jvfJiUTf/lo7tMBlt6i+LdBLNAXNFyRLp307WOH32s4Kq2eZTmU5gEUmci6wVmjI6azqHY/czkm3imezYx3RB/XTge66MpzfZrQ1qNhk3K97mMn7z7+U2GYeZ5BJRzTMOlVLCdpbsvdPNMtwmue9UHU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763557795; c=relaxed/simple; bh=5cuWxFruSbmINQkfu8xBEDBSefUx4G9GS7gD5IXtbMQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GNfY0b2QyILeavvfmzGFm2T0Mod+X3QUuzvwyZxyOeAPYR0Ap44dj/aYrYDwYhqkSRam1GfibKfHWK4C7c0Sx8W495V3q45YKp6/dXRJvBPfFaqHbDAVNmSF7OVM5BG9T0+5f2kOr6RBgeOv6Xs20OIHkGJE0d8/P/GiIlXziwc= 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=OlX/PF+d; arc=none smtp.client-ip=185.246.85.4 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="OlX/PF+d" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 5E7214E4179C; Wed, 19 Nov 2025 13:09:52 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2F04860699; Wed, 19 Nov 2025 13:09:52 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D2F8810371A53; Wed, 19 Nov 2025 14:09:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763557790; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=axXT5p39UcLgfeXlnv3r+PQb3eCsVz2C9lrKQC2f4Uk=; b=OlX/PF+dhNGJG27mrsK1i4MNguYEVaaiKq83NP0yOr041d9TgIxWfbA2GyldpQEAfPLd3J wNbvXQz9oBqELh/fqHBdK3mPbEJ3JKZLLabdZdqhqGE7GiQMZKWviSVNIdzuN1DuSJ9D6O ji63oyId+HMuMeLvrrbb9/FhGf8/Vn2JH5T3bED5Ab473KCMMc1GmDK6PMlKKy03bJn35W CR9esGIgCRwjBUdDQ8G/Q3ByDThJhNj95m+NHds8C3IrJVQlptjCCcIy0X+k2qNcCYxnYs 7W0XT05zHAApmNT3EVv8sRDwLVGvyuBhAK9DAMINTmHuHkuNsVeo/QElxQso7A== From: Luca Ceresoli Date: Wed, 19 Nov 2025 14:05:57 +0100 Subject: [PATCH 26/26] drm/bridge: imx8qxp-pixel-link: convert to drm_of_find_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: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-26-0db98a7fe474@bootlin.com> References: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@bootlin.com> In-Reply-To: <20251119-drm-bridge-alloc-getput-drm_of_find_bridge-v1-0-0db98a7fe474@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 , Adrien Grassein , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Anitha Chrisanthus , Edmund Dea , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar 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-renesas-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@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 drm_of_find_bridge() which gets a bridge reference, and put it when done. This needs to be handled in various steps: * the bridge returned drm_of_find_bridge() is stored in next_bridge whose scope is the for loop, so a cleanup action is enough * the value of next_bridge is copied into selected_bridge, potentially more than once, so a cleanup action at function scope is useful here too * however on successful return selected_bridge must be returned and ultimately stored, so it should not be put in that case: use return_ptr() to defuse the cleanup action on successful return * finally, put the bridge reference on device remove Signed-off-by: Luca Ceresoli --- Cc: Liu Ying --- drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c b/drivers/gpu/= drm/bridge/imx/imx8qxp-pixel-link.c index 2ecc3c1051e5..9818239cf6e7 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c @@ -256,12 +256,13 @@ static int imx8qxp_pixel_link_disable_all_controls(st= ruct imx8qxp_pixel_link *pl return imx8qxp_pixel_link_disable_sync(pl); } =20 +/* The returned bridge has its refcount incremented */ static struct drm_bridge * imx8qxp_pixel_link_find_next_bridge(struct imx8qxp_pixel_link *pl) { struct device_node *np =3D pl->dev->of_node; struct device_node *port; - struct drm_bridge *selected_bridge =3D NULL; + struct drm_bridge *selected_bridge __free(drm_bridge_put) =3D NULL; u32 port_id; bool found_port =3D false; int reg; @@ -298,7 +299,7 @@ imx8qxp_pixel_link_find_next_bridge(struct imx8qxp_pixe= l_link *pl) continue; } =20 - struct drm_bridge *next_bridge =3D of_drm_find_bridge(remote); + struct drm_bridge *next_bridge __free(drm_bridge_put) =3D drm_of_find_br= idge(remote); if (!next_bridge) return ERR_PTR(-EPROBE_DEFER); =20 @@ -306,13 +307,15 @@ imx8qxp_pixel_link_find_next_bridge(struct imx8qxp_pi= xel_link *pl) * Select the next bridge with companion PXL2DPI if * present, otherwise default to the first bridge */ - if (!selected_bridge || of_property_present(remote, "fsl,companion-pxl2d= pi")) - selected_bridge =3D next_bridge; + if (!selected_bridge || of_property_present(remote, "fsl,companion-pxl2d= pi")) { + drm_bridge_put(selected_bridge); + selected_bridge =3D drm_bridge_get(next_bridge); + } } =20 pl->mst_addr =3D port_id - 1; =20 - return selected_bridge; + return_ptr(selected_bridge); } =20 static int imx8qxp_pixel_link_bridge_probe(struct platform_device *pdev) @@ -392,6 +395,7 @@ static void imx8qxp_pixel_link_bridge_remove(struct pla= tform_device *pdev) struct imx8qxp_pixel_link *pl =3D platform_get_drvdata(pdev); =20 drm_bridge_remove(&pl->bridge); + drm_bridge_put(pl->next_bridge); } =20 static const struct of_device_id imx8qxp_pixel_link_dt_ids[] =3D { --=20 2.51.1