From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 C0F582836B1 for ; Fri, 8 Aug 2025 14:49:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754664587; cv=none; b=sOXwlxlLnOxm05RpmpM7/v/nxJ7KD0c6pmXQotHk9gaq4sVty2tMal3136mpAU1nLyC6nUKDgdA1leaYttqtnLT2elzVn+kqF70Q6esKwxkit6FVhLqLkXqXcZH8tiE4MR4COt5/dtb8z1aKyiWJeserHJOXHw3xKSSl9zsk938= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754664587; c=relaxed/simple; bh=osA/Tpi12kQ5CER3paP/Bp7QeYpQh8yJ9Fzu2SQ6Mqc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=motXf+wB4pKlovQPgH2ERzQF8MEGuFDSfCwnl/BWf5eAEkLOOyqv35b4tbKYVIzfKlczNAphiFjh6EsIwcI7LUloxBZSH6nsVPLTg+eYiVYrYERf5rZ3RQNsQ0yiLTCs/wAkJT0Z8Bpif4PIWBeyQrJlbMHTsm3PPeXAvJbMWqg= 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=SZD+ynxn; arc=none smtp.client-ip=217.70.183.200 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="SZD+ynxn" Received: by mail.gandi.net (Postfix) with ESMTPSA id 15B7A43986; Fri, 8 Aug 2025 14:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1754664584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PGUyvHe9BuPd0T5rhlt1+H6vTEPvRtliykdDnPP91xg=; b=SZD+ynxnh44uTk7maCvSbO/ThN25G58Ul1kZ5W/pgAU9taYbLT48RQ3XUKvTNGObHwSuJm gcDkyvLb9kwxwqonxfRtese5JwCCSmazujcXiJ0xFxpiorkczTF8ea0Cg6mJt53aqKBgAR +/EL3V3ZhOZcWIPNmG6lW+9DttXEJ8wzvhLp+PO3Ls1GfaqtcXT1NYVB9esgu1kTmEfKtI fP/gno4VfJlmEEBB+Hnr2UObFlVsNiRzNVsOqssHcUz+MF6zOLO1bmFNdwVbwekGE7SJOK M3t+sPTSV/fNEkrhrrMzljQz4fjzJTzpK5eAtvyeH0Vxsalesyzm2LvKF8ftRQ== From: Luca Ceresoli Date: Fri, 08 Aug 2025 16:49:13 +0200 Subject: [PATCH v2 6/9] drm/bridge: use drm_for_each_bridge_in_chain_scoped() Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250808-drm-bridge-alloc-getput-for_each_bridge-v2-6-edb6ee81edf1@bootlin.com> References: <20250808-drm-bridge-alloc-getput-for_each_bridge-v2-0-edb6ee81edf1@bootlin.com> In-Reply-To: <20250808-drm-bridge-alloc-getput-for_each_bridge-v2-0-edb6ee81edf1@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 , Miguel Ojeda , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Tomi Valkeinen Cc: Dmitry Baryshkov , Chaoyi Chen , Hui Pu , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Luca Ceresoli X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdduvdegtdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomhepnfhutggrucevvghrvghsohhlihcuoehluhgtrgdrtggvrhgvshholhhisegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeeiieeuvdfftefgueduleehueetgffgjeeitedtteetkeeuueeuueekveevvdeuveenucfkphepjeekrddvuddvrddvjedrudduheenucevlhhushhtvghrufhiiigvpeefnecurfgrrhgrmhepihhnvghtpeejkedrvdduvddrvdejrdduudehpdhhvghloheplgdujedvrdduiedrtddrudgnpdhmrghilhhfrhhomheplhhutggrrdgtvghrvghsohhlihessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdehpdhrtghpthhtohepnhhitghkrdguvghsrghulhhnihgvrhhsodhlkhhmlhesghhmrghilhdrtghomhdprhgtphhtthhopehmohhrsghosehgohhoghhlvgdrtghomhdprhgtphhtthhopehsihhmohhnrgesfhhffihllhdrtghhpdhrtghpthhtohepnfgruhhrvghnthdrphhinhgthhgrrhhtsehiuggvrghsohhnsghorghrugdrtghomhdprhgtphhtthhopehtohhmihdrvhgrlhhkvghin hgvnhesihguvggrshhonhgsohgrrhgurdgtohhmpdhrtghpthhtohepjhhonhgrsheskhifihgsohhordhsvgdprhgtphhtthhopehrfhhoshhssehkvghrnhgvlhdrohhrghdprhgtphhtthhopehojhgvuggrsehkvghrnhgvlhdrohhrgh X-GND-Sasl: luca.ceresoli@bootlin.com Use drm_for_each_bridge_in_chain_scoped() instead of drm_for_each_bridge_in_chain() to ensure the bridge being looped on is refcounted. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index c3bfcd735a3c426a147bf0a7427b3d2cd0df3524..c91a99b7eb1b9b1525e2d95888952f733ca6b9e0 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -1476,10 +1476,9 @@ static int encoder_bridges_show(struct seq_file *m, void *data) { struct drm_encoder *encoder = m->private; struct drm_printer p = drm_seq_file_printer(m); - struct drm_bridge *bridge; unsigned int idx = 0; - drm_for_each_bridge_in_chain(encoder, bridge) + drm_for_each_bridge_in_chain_scoped(encoder, bridge) drm_bridge_debugfs_show_bridge(&p, bridge, idx++); return 0; -- 2.50.1