From patchwork Wed Mar 26 17:47:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 14030431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4B1E2C3600E for ; Wed, 26 Mar 2025 17:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=INhI5GY5KpAC1e+W0x4kcSuViX4iAnBipLvZsEs2/Fk=; b=MO2jP+S3TKl0jBgTuZdieKY1Dp 4F9IljXY9zxljMqT9T29HprW2kAyz8NVHDekrEAQeyGLCMaRPLO5sjPqa/cKZLyMx45txCnIYBoer urmBBoSbaCJMX66z1fqTlgFyLo1XxmdPkug9jNu1qqwLpqptYeCJdsT0O+rq0DvS2ANdyzhcf7QAz 74d8kR0o1rkK8pLD679hma7CaeUPOybNNKdzI46PPjREI9A7g0K4XE8jMP15PJHX561vlXfUQ8/HV k5ZgrwwPDt3Ma0Bv5Jczl62cXWhHbiA4w80rDbqHkspx2pvbJqJP3a5R7sA4XGjaZ1SE+/Vh09rd5 4co3bKqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1txUy5-00000009HLT-1qfQ; Wed, 26 Mar 2025 17:55:09 +0000 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1txUrE-00000009Fxw-2s34 for linux-arm-kernel@lists.infradead.org; Wed, 26 Mar 2025 17:48:05 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id DF8AE44440; Wed, 26 Mar 2025 17:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1743011283; 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=INhI5GY5KpAC1e+W0x4kcSuViX4iAnBipLvZsEs2/Fk=; b=IJjbYn/+SO/mrbDC/CF08v7B3Sw2MF+noNcWTp3Wj70f/uveC5LNeuQSjierBp62340XSm utadCLhc7w7zpJ1rWiD/Ixsls4qERj/rGGRi5r8wXHq00oIK8cBrwBaWFKEOSLaYkFf/zN CW4nHDDytGgu9Y41d2xVlCEbyOUCXFeyV8nw4ma9At4uWOLad3vyWZ3OaigutUzCNaOc+E O/04uIif1V3r0dyRr93/sWb/Kd6Ddh3pJ9CjyMtnDJlOMPyAqpQXGXPnkZVWuxaVi9BLnm OXmazCgphXS2c+GnIcCm9RMqt9ZmrgkBgccfcVRNh4bkTjax3QLWI6ytn3uT+Q== From: Luca Ceresoli Date: Wed, 26 Mar 2025 18:47:37 +0100 Subject: [PATCH v9 3/5] drm/bridge: make devm_drm_bridge_alloc() mandatory for bridge allocation MIME-Version: 1.0 Message-Id: <20250326-drm-bridge-refcount-v9-3-5e0661fe1f84@bootlin.com> References: <20250326-drm-bridge-refcount-v9-0-5e0661fe1f84@bootlin.com> In-Reply-To: <20250326-drm-bridge-refcount-v9-0-5e0661fe1f84@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 , Marek Vasut , Stefan Agner , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Inki Dae , Jagan Teki , Marek Szyprowski Cc: Thomas Petazzoni , Anusha Srivatsa , Paul Kocialkowski , Dmitry Baryshkov , =?utf-8?q?Herv=C3=A9_Codina?= , Hui Pu , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Luca Ceresoli X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieeiudejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomhepnfhutggrucevvghrvghsohhlihcuoehluhgtrgdrtggvrhgvshholhhisegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeeiieeuvdfftefgueduleehueetgffgjeeitedtteetkeeuueeuueekveevvdeuveenucfkphepvdgrtddvmeeijedtmedvtddvtdemvggrtddumegsvgegudemleehvgejmeefgeefmeeludefvgenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepihhnvghtpedvrgdtvdemieejtdemvddtvddtmegvrgdtudemsggvgedumeelhegvjeemfeegfeemledufegvpdhhvghloheplgduledvrdduieekrddujeekrdejhegnpdhmrghilhhfrhhomheplhhutggrrdgtvghrvghsohhlihessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepfedupdhrtghpthhtohepmhgrrghrthgvnhdrlhgrnhhkhhhorhhstheslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopehmrghrvgigseguvghngidruggvpdhrtghpthhtohepihhmgieslhhishhtshdrlhhinhhugidruggvvhdprhgtphhtt hhopefjuhhirdfruhesghgvhhgvrghlthhhtggrrhgvrdgtohhmpdhrtghpthhtohepshhimhhonhgrsehffhiflhhlrdgthhdprhgtphhtthhopehnvghilhdrrghrmhhsthhrohhngheslhhinhgrrhhordhorhhgpdhrtghpthhtoheprghirhhlihgvugesghhmrghilhdrtghomhdprhgtphhtthhopehhvghrvhgvrdgtohguihhnrgessghoohhtlhhinhdrtghomh X-GND-Sasl: luca.ceresoli@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250326_104804_878843_18EECC5B X-CRM114-Status: GOOD ( 10.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org All DRM bridges are now supposed to be allocated using devm_drm_bridge_alloc(), which is cleaner and necessary to support refcounting. In the absence of a drm_bridge_init() or such initialization function, document the new mandatory alloc function on the first DRM bridge core function that is called after allocation, i.e. drm_bridge_add(). Suggested-by: Maxime Ripard Signed-off-by: Luca Ceresoli Reviewed-by: Maxime Ripard --- Changes in v9: - remove sentence about old-style allocation This patch was added in v8. --- drivers/gpu/drm/drm_bridge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 22b459af112fd3cd2db00aa16668d270e028b307..b4c89ec01998b849018ce031c7cd84614e65e710 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -286,6 +286,9 @@ EXPORT_SYMBOL(__devm_drm_bridge_alloc); * drm_bridge_add - add the given bridge to the global bridge list * * @bridge: bridge control structure + * + * The bridge to be added must have been allocated by + * devm_drm_bridge_alloc(). */ void drm_bridge_add(struct drm_bridge *bridge) {