From mboxrd@z Thu Jan 1 00:00:00 1970 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 E69F13C3C13 for ; Fri, 27 Mar 2026 07:57:55 +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=1774598282; cv=none; b=CEp+awy61l2iWKnxG3oYTl8E31QlWEWSGq2EhFZypn2M6OkAgjqUYMWgKvF1kXGQcz/uM4lTK1sUKP5MK0LGVO/qaw2XHRZDfyMIpW4lUGFP+LxoXDtwYkbdnDLWPCUF0cXKCLVwJ1xijrp60NyeAIs68rhBxHNq1D02/QDQZyM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774598282; c=relaxed/simple; bh=BvIvOiULdSDzr1AdSUV8P2PsoZVED4hMWpwkQzx9zas=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=iRDnpKxD1mo+4NUYGEBaSh4E86MgI73qeRWgfRmnl8CB0CO49Ky2hFdP0QP6f+0sM4epX11IVTObs1DouYSH4Ef5dj4h8oijs3V3uA1iXRdVbW6Y36Ysaw38bRJuXc+YVdOelO3oayALy6ikO5T7Ryh3h18n5alkfeiLwaFOkvQ= 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=nC677v1O; 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="nC677v1O" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 75A34C406B4; Fri, 27 Mar 2026 07:58:21 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id C102260230; Fri, 27 Mar 2026 07:57:52 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E20E810450F0A; Fri, 27 Mar 2026 08:57:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1774598272; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=FFBfGsTXnTK41d/BbkcMjWKr681rJqWXfmtbDSwR6W8=; b=nC677v1Otou6cBTVPwLOC+9wP0nDsMdCloupXcLWPT6Wo8EyVvSpstWjA5dZ8HxYQRPtcN kjAkSq9Eusjh7k4jh6o3I6X5hEQSWe76lhf0jf9RyxzOYpmyEmmeLFqkiqe5b5vhuXURFE 6QmSjZVLhLTcwuVGUia3lXYE1tfkKVc4xNHYZC0TjYQg+gKLci5HYhSYDnD163+rT/DIw6 YTmGam1BoOtZUWd6vf32MHiGWCEgoUO/7DA76E6nsXBcItwDnNi8zogFw79d1haTTr+834 4eMEG0qCHrJED15sXRxX+ht9rXOcNm79UvIv/4bjTV6QUkQmoEu8R0yEzULEbQ== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 27 Mar 2026 08:57:45 +0100 Message-Id: Subject: Re: [PATCH] drm/rcar-du: Convert to of_drm_find_and_get_bridge() Cc: , , To: "Amin GATTOUT" , "Laurent Pinchart" , "Tomi Valkeinen" , "Kieran Bingham" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" , "Geert Uytterhoeven" , "Magnus Damm" From: "Luca Ceresoli" X-Mailer: aerc 0.20.1 References: <20260326-bridge-v1-1-c0c44b53f7b6@gmail.com> In-Reply-To: <20260326-bridge-v1-1-c0c44b53f7b6@gmail.com> X-Last-TLS-Session-Version: TLSv1.3 Hello Amin, On Thu Mar 26, 2026 at 9:10 PM CET, Amin GATTOUT wrote: > of_drm_find_bridge() is deprecated. > Replace it with of_drm_find_and_get_bridge() which increments > the bridge refcount as required. Thanks for taking care of the conversion to the new API! > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c > @@ -72,7 +72,7 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu, > if (IS_ERR(bridge)) > return PTR_ERR(bridge); > } else { > - bridge =3D of_drm_find_bridge(enc_node); > + bridge =3D of_drm_find_and_get_bridge(enc_node); This change alone is not correct I'm afraid. The difference between of_drm_find_bridge() and of_drm_find_and_get_bridge() is the latter get a reference to the bridge, so you have to put that reference when the bridge pointer is no more accessible. Have a look at previous commits doing the same API replacement, you can find examples similar to this one, where: * the bridge pointer is stored in a local variable (not saved in a struct) * the bridge pointer could be set wither by of_drm_find_bridge() or a function adding a panel bridge Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com