From nobody Mon Feb 9 06:19:21 2026 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 4471831B11E for ; Wed, 7 Jan 2026 09:57:08 +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=1767779830; cv=none; b=XcnRHrOAH3gDCsCNZW5AAq4C5spVtOeM7mztZiwA5sYmrNZuB31Bqy62/BK4VpXUXfzfUq8/XM3vT/lPbGywv2Qm0I7aMbwcybscKys8CAI4DbJtCg+zl1OQaMckNkjWobDehD8BbjD0G9xBkJdoaFzJxmWU8Y/2d3d22VXeeXI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767779830; c=relaxed/simple; bh=xdLw1WWjk1NrcPgduBp+7aWmOA1+UK2tB+s31GYFXic=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KZb9jueiiWD/LUFYTvGotsfxfjT5rUfZmQ62LBVFrwADO2alHk8WVNppYFwHvHUFt6erRnCZSoYWLdD5lmV60Gtz3IFqM85r8kg8riaLG0ZujMEA67cvtR3UlsmNRbCip8/z/VSpu2SYPDXEKyIKUrv7Pu6UKspSqCxjbxkSpQ4= 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=DpVvpTUM; 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="DpVvpTUM" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 8888E1A26E0; Wed, 7 Jan 2026 09:57:01 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 5425D6072B; Wed, 7 Jan 2026 09:57:01 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id CA497103C870F; Wed, 7 Jan 2026 10:56:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1767779820; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=meGA74IEurNMdTL93yq5uF40iG29aU1P+OGqYX95yp0=; b=DpVvpTUMGI1H+WF4rLxhW4WmbWWWhZYaH2l8fi50mG7e6701lqvv+3FfoLslJT/KA5SKaE w2bNvavMNp4i/+arZ0LtgZHPZ/K16Zc8JdBc2W4a8IeLUgw+tIlcSzvWOknbfkpbFw2bCB TSCABfIooB/fVmgevekCa6uJWaZZqd/GcXZJx0ujsreDq/hP/8+vo4jiEXMux+B1IHhmqb zP+tB7C8QDvrHOs6qgjJGhd8wPzVMN/iPTpTCVoTisxLRHwdcMeNL5jl8QKlG0tULy4g/f 0Q0SiWFCo5gNKUvWtATnzco92M4W0Xdr9Xh3kEeq98sWAq2VuCV59k0c55aJpg== From: Luca Ceresoli Date: Wed, 07 Jan 2026 10:56:27 +0100 Subject: [PATCH v4 2/4] 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: <20260107-drm-bridge-alloc-getput-drm_of_find_bridge-v4-2-a62b4399a6bf@bootlin.com> References: <20260107-drm-bridge-alloc-getput-drm_of_find_bridge-v4-0-a62b4399a6bf@bootlin.com> In-Reply-To: <20260107-drm-bridge-alloc-getput-drm_of_find_bridge-v4-0-a62b4399a6bf@bootlin.com> To: Liu Ying , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: Hui Pu , Thomas Petazzoni , dri-devel@lists.freedesktop.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@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. Reviewed-by: Maxime Ripard Signed-off-by: Luca Ceresoli Reviewed-by: 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 4f84825fddca..0c5ed06eee1b 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.52.0