From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 72B9734D382; Tue, 28 Apr 2026 15:31:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777390310; cv=none; b=fMlTzaiF2p1nuzhnq21vIVt+pp4EBNFvK1BCZQwFh/ZyEue66igjkH0DfjUcUFNrHYcm66C2JpyBrdrKupAwMNeKD5cph5XAJMGTv/15yZGh5uDVrMgPpwPWe6lAgsSe7L3Es0AX8PCIDaFuTLrkufNZw7VDGIMYQOXahBYh1W8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777390310; c=relaxed/simple; bh=P+ybbR2JCX5P3ToxNXc4BQOIlQX42qMh7LwK2rkO8kU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KKuISZucQ8H+CQXSuqPGPG4+IUtRJPZ1PB0/R3ssXLWAz5g/vDnpBZvmJD+DuyYTGUs1mSuTCxd/IwpVOHYobJGmwam7R3AuvU0viFm6Ij6Yx3GUpgq4KlWOA4yQVCy7WM40b9ldFP8Df9rJwOFq971Q21Sf33S6/fQ2cXvT7sU= 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=AVztzYi8; arc=none smtp.client-ip=185.246.85.4 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="AVztzYi8" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 2A4FB4E42B54; Tue, 28 Apr 2026 15:31:48 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id F272F601D0; Tue, 28 Apr 2026 15:31:47 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 9E00210728E29; Tue, 28 Apr 2026 17:31:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1777390306; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=p2/Y7roARxFkweio2HkVO8IrTHGmO9nhgwGPDGzMLOQ=; b=AVztzYi8ovBH4Uwj4cMbsl1ePLmEHC5F5cXWkqQ9YWK2FwysTik9Bujy/DxlSJH7HvzKPT 1CHUVSlge3Z9/wI0OJpzXUcj5ZJVbCQWaYQaIbohBDcaciaYgt9tH/aGWUj9v8BI3bE5uz k/69Drt5aZjcvVgp+3vjHFun69Q7u4IiE4aFH+Zr4n2ErukDAyQfbPGoKWg4i9mQfcdPCz iYE5UZTQ3H3xIRw3LWy3HkWvx9WXRrt1jwtG54S7d21+XLB8rFyHugOOpGa1G4FDuto19J 7OqR7+6MYavTpV+rC58NF2lodsES4F4QFwg1ODuUh9duEkzkeBHRqqrt1A3ngA== From: Luca Ceresoli Date: Tue, 28 Apr 2026 17:30:55 +0200 Subject: [PATCH v3 06/11] drm/bridge: lontium-lt9611uxc: switch to of_drm_get_bridge_by_endpoint() 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: 7bit Message-Id: <20260428-drm-bridge-alloc-getput-panel_or_bridge-v3-6-a537b5567add@bootlin.com> References: <20260428-drm-bridge-alloc-getput-panel_or_bridge-v3-0-a537b5567add@bootlin.com> In-Reply-To: <20260428-drm-bridge-alloc-getput-panel_or_bridge-v3-0-a537b5567add@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 , Rob Clark , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Sean Paul , Marijn Suijten , Xinliang Liu , Sumit Semwal , Yongqin Liu , John Stultz , Tomi Valkeinen , Michal Simek Cc: Hui Pu , Ian Ray , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, Luca Ceresoli , Dmitry Baryshkov X-Mailer: b4 0.15.2 X-Last-TLS-Session-Version: TLSv1.3 This driver calls drm_of_find_panel_or_bridge() with a NULL pointer in the @panel parameter, thus using a reduced feature set of that function. Replace this call with the simpler of_drm_get_bridge_by_endpoint(). Since of_drm_get_bridge_by_endpoint() increases the refcount of the returned bridge, ensure it is put on removal. To achieve this, instead of adding an explicit drm_bridge_put(), migrate to the bridge::next_bridge pointer which is automatically put when the bridge is eventually freed. Reviewed-by: Dmitry Baryshkov Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c index 11aab07d88df..9427cc2358ae 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c @@ -35,7 +35,6 @@ struct lt9611uxc { struct device *dev; struct drm_bridge bridge; - struct drm_bridge *next_bridge; struct regmap *regmap; /* Protects all accesses to registers by stopping the on-chip MCU */ @@ -284,7 +283,7 @@ static int lt9611uxc_bridge_attach(struct drm_bridge *bridge, { struct lt9611uxc *lt9611uxc = bridge_to_lt9611uxc(bridge); - return drm_bridge_attach(encoder, lt9611uxc->next_bridge, + return drm_bridge_attach(encoder, lt9611uxc->bridge.next_bridge, bridge, flags); } @@ -487,7 +486,11 @@ static int lt9611uxc_parse_dt(struct device *dev, lt9611uxc->dsi1_node = of_graph_get_remote_node(dev->of_node, 1, -1); - return drm_of_find_panel_or_bridge(dev->of_node, 2, -1, NULL, <9611uxc->next_bridge); + lt9611uxc->bridge.next_bridge = of_drm_get_bridge_by_endpoint(dev->of_node, 2, -1); + if (IS_ERR(lt9611uxc->bridge.next_bridge)) + return PTR_ERR(lt9611uxc->bridge.next_bridge); + + return 0; } static int lt9611uxc_gpio_init(struct lt9611uxc *lt9611uxc) -- 2.53.0