From mboxrd@z Thu Jan 1 00:00:00 1970 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 9517FCD343F for ; Thu, 7 May 2026 13:46:30 +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=p2/Y7roARxFkweio2HkVO8IrTHGmO9nhgwGPDGzMLOQ=; b=iCT+JMZCUBXqw0QMtG3Y5akveE XkyeiEK6p9hV7r608GadmsaWOrnchm2AyL7GtocoB3KReb4GSi+Qeo1iEJBJoIxeJOIdhDNEqDBJG tbsTLtvGYz+eY/k5NuXxj9hhtaOZ4/37jQV0PVvf3YUfK2CkLrlSHE/8GWvR50mVOuDoLfAqUdRRo 1Are7Oc6fFDBNEJ2CZENNDoVtDCZdk2hVt0RpdEQduTVwaJVXQuJpdxunlaTXYTRVxPtYXttSyQWZ K325CWYzoZ3sp4odeb1nKZscdRje1uRBmPYMfhb8ysnuLEwJ7nDZnnGD7o83f8lP+bViQhxmQuwmA qqM1nUfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wKz3X-00000003x4C-2RCl; Thu, 07 May 2026 13:46:23 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wKz3U-00000003x1d-3MH6 for linux-arm-kernel@bombadil.infradead.org; Thu, 07 May 2026 13:46:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=p2/Y7roARxFkweio2HkVO8IrTHGmO9nhgwGPDGzMLOQ=; b=VX/uhi4tCPKZ2lWg2STj/EN4DO sTWh6DgatCuJtb7o90gCYc1DbF0oNtDw7zYspKCBGa4GGkPLEsdtie7mnViPtjZLWXBHR1M2G3qp4 K3+kGurGRcYv9lpaKcEh8dKyPQvJEP6g1SDtNjXu3qV4+HyS77Wwz/91o8XjvPgMWbHX4V9tJnMc+ UN45Bo7vuKjtf+m/2N5rcEE44uBwela50fjpr4pNMezeTATAyLyWEFBbHKtaG8c2d2qVl3v9WsZ0R oKJkmmqKj98LdfK5yMcGInSLelQMeUtY05C7ASvOBapdloRzPHLdeGURfJ+TJrODsV+8MPb6p6tKE hAHWQ9bw==; Received: from smtpout-02.galae.net ([185.246.84.56]) by desiato.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wKz3R-00000003fT9-23kW for linux-arm-kernel@lists.infradead.org; Thu, 07 May 2026 13:46:19 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 0F6DB1A3556; Thu, 7 May 2026 13:46:10 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id D52C660495; Thu, 7 May 2026 13:46:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id DCC23108194B2; Thu, 7 May 2026 15:46:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1778161568; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=p2/Y7roARxFkweio2HkVO8IrTHGmO9nhgwGPDGzMLOQ=; b=VV1PVAbGYz4ItPC8e3ikDV+Oki8QyLW1OCtbR5rY6++1q7FykAerI5eKiEqplmvreUa7Yb nj4Pc/ph4RN6UYgZo5Bitd5lgurmTjQtyPubUsjXs0oQx04/hgVCecnkWoDkeNR/sskbsR brHBMFyLHA0noq/w1xgQ088wgABDM2J1Bd3RHkJ+Z+h1O/J4E2hrcS1a+l/oz0/iQH6w1R vXmopeQlzrvLqqcW71KVkr1gGkJVzOEoxhifV19h1fk5EHe16O+q5W+Ij1Yu/UUqNB3kAZ SNQw1JLbIMH3zGXAIeCw/QCdRnLycU8fX4jq2MwbUE9YtFzhNT4q7SQzQ1aU7w== From: Luca Ceresoli Date: Thu, 07 May 2026 15:45:24 +0200 Subject: [PATCH v5 06/11] drm/bridge: lontium-lt9611uxc: switch to of_drm_get_bridge_by_endpoint() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260507-drm-bridge-alloc-getput-panel_or_bridge-v5-6-472b913b5cb7@bootlin.com> References: <20260507-drm-bridge-alloc-getput-panel_or_bridge-v5-0-472b913b5cb7@bootlin.com> In-Reply-To: <20260507-drm-bridge-alloc-getput-panel_or_bridge-v5-0-472b913b5cb7@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 , Sumit Semwal , 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260507_144617_898563_87736DE0 X-CRM114-Status: GOOD ( 11.94 ) 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 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