From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0EB5E2877FB; Thu, 10 Jul 2025 07:13:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752131630; cv=none; b=bacArZdS+2uR2ATtdROWTOV+Gc7YD+j0Xbktt+bykTY+hC9oy7XTO8NJvhxm8KpcNKEHIgwn9mMSkbLIPWZUbWam14mWMllTC4Eiz6LSisl8vpPK0WUtvOW0IqFGNca8GYQKHKGLoX92SeAQECwj6h6K0ogLXlp4hNbeUiNy64o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752131630; c=relaxed/simple; bh=1PZ5SYT8dRkcymT3/gj366sIXjNSe/oKNBKj+FH3zao=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sWyi41tkjdPIHHDrOELfvF0rp4Dr8e6wfp4ZdrDdoRhfRAGzlsh4bAgwSoQvo482quCYRppqmZIbyhsamk5oEyRDHzk4JmlBInZ3jQ6Hb5nGzLvTttLUowdhZMe3kcILGeNelDhd/EEMx2lwmvERn3Xm04uGBrKJVK7/Ip3okcY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f7liWRLK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f7liWRLK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D023C4CEE3; Thu, 10 Jul 2025 07:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752131629; bh=1PZ5SYT8dRkcymT3/gj366sIXjNSe/oKNBKj+FH3zao=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f7liWRLKF+YRv9KHpnqXc8KJJfHiKxyOMTbrf4C4eZLOzV18t8Z8ofdOCIkIpSfjd QjwwFAS/CPeAASRC1DoCC2k8C9ZEtSRB60GCwhZk9OQJFhR8W3CglMyxGmmESsoRIL UzSxbYpbOICcCujzD1mfSJKvQ++TcK5Ena+0BrPt/h/6JOuLAhzGIDeL+vjhYOWgXI 2xjCaIuea75KvEb/UOKsQrKc3AA4OlEehzaF5nmVyEB6hX7XZGil98DEUJPffpX4Rb D32VrK3JfP3LBa27Efxq5OpODdxs0hx27s31b6i7QJcLxVSy5yXr2KZHuc/5iZlIZi yJAKt7lEuWJVA== Date: Thu, 10 Jul 2025 09:13:46 +0200 From: Maxime Ripard To: Luca Ceresoli Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Liu Ying , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Tomi Valkeinen , Philipp Zabel , Hui Pu , Thomas Petazzoni , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 4/9] drm/omapdrm: use drm_bridge_chain_get_last_bridge() Message-ID: <20250710-daffy-mini-booby-574fca@houat> References: <20250709-drm-bridge-alloc-getput-drm_bridge_get_next_bridge-v1-0-48920b9cf369@bootlin.com> <20250709-drm-bridge-alloc-getput-drm_bridge_get_next_bridge-v1-4-48920b9cf369@bootlin.com> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha384; protocol="application/pgp-signature"; boundary="ksuiit4bl62avew6" Content-Disposition: inline In-Reply-To: <20250709-drm-bridge-alloc-getput-drm_bridge_get_next_bridge-v1-4-48920b9cf369@bootlin.com> --ksuiit4bl62avew6 Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH 4/9] drm/omapdrm: use drm_bridge_chain_get_last_bridge() MIME-Version: 1.0 On Wed, Jul 09, 2025 at 06:48:03PM +0200, Luca Ceresoli wrote: > Use drm_bridge_chain_get_last_bridge() instead of open coding a loop with > two invocations of drm_bridge_get_next_bridge() per iteration. >=20 > Besides being cleaner and more efficient, this change is necessary in > preparation for drm_bridge_get_next_bridge() to get a reference to the > returned bridge. >=20 > Signed-off-by: Luca Ceresoli > --- > drivers/gpu/drm/omapdrm/omap_drv.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm= /omap_drv.c > index 054b71dba6a75b8c42198c4b102a093f43a675a2..3bbcec01428a6f290afdfa40e= f6f79629539a584 100644 > --- a/drivers/gpu/drm/omapdrm/omap_drv.c > +++ b/drivers/gpu/drm/omapdrm/omap_drv.c > @@ -378,12 +378,12 @@ static int omap_display_id(struct omap_dss_device *= output) > struct device_node *node =3D NULL; > =20 > if (output->bridge) { > - struct drm_bridge *bridge =3D output->bridge; > - > - while (drm_bridge_get_next_bridge(bridge)) > - bridge =3D drm_bridge_get_next_bridge(bridge); > + struct drm_bridge *bridge =3D > + drm_bridge_chain_get_last_bridge(output->bridge->encoder); > =20 > node =3D bridge->of_node; > + > + drm_bridge_put(bridge); Any reason you're not using __free(drm_bridge_put) here? Maxime --ksuiit4bl62avew6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJUEABMJAB0WIQTkHFbLp4ejekA/qfgnX84Zoj2+dgUCaG9oKgAKCRAnX84Zoj2+ dv+SAYD8WXoxdQImd1WsoY8Qa7eR03ok/mPvEvPAbyHoymKSL55M0Dxyg3aTw6DJ SBzQpokBgJjlL8l44Tp0J8chUUsawNg8WYvr0GQO++AMrH0GWH7vZttF78pb1xGe YlVI2cDkew== =+6FN -----END PGP SIGNATURE----- --ksuiit4bl62avew6--