From mboxrd@z Thu Jan 1 00:00:00 1970 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 D29292DEA8F; Tue, 28 Apr 2026 15:31:40 +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=1777390304; cv=none; b=IqCNHRL+4T1h/T9OoGA/3b4xZtpXkGJ6qwKLIvRRZH/s6nM7wKKO6G4FPHsr37HCvsV9BhwCjq0h6qMogkuADJ7iTgLYOhl17CS0xyZbLndKVLmjspIotNkIYXvm3WN/ovU3KrxUTLQfcsvIwPNMtx8iVdFcuKx3incQeNriYZg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777390304; c=relaxed/simple; bh=L0x8y9xGgw0PqpPEHV/w4d+6yN4OzTb63Hn8duLLjMo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nRilhYdN6PkEDdy1zJq38edrERup8XKarlZ0LzlBFtb0Gmq7I6A1EiDQYRW/0kXf0SofGG5EeKxkDE3UnfYCELU7y64IheWX527n+AOFQq3mg9FiDilK/h6S5sBgEzvKJyYMKprF2ovfCFsqLs37xedOPSn6jWpnGzPBhd3c/ow= 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=b8DzLl9g; 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="b8DzLl9g" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 7DEDE1A3472; Tue, 28 Apr 2026 15:31:39 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 52458601D0; Tue, 28 Apr 2026 15:31:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D11D010728E23; Tue, 28 Apr 2026 17:31:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1777390297; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=EjLii+UVAxxUE1lRMJnRgBpuZnA4/R7NKW2C9QtWbBE=; b=b8DzLl9gTG1JT65zLcbVq4R71KdFvjxRWNrzmpI0bttBQqIprm5sh+gU2uu8XtKDRt0Epo fBjPRTsL/mTA1Bk1Rb/OxENx2XLmGVSN9Lj5bofvQh095I6lRyAdbm13Y4QH3gT2RSeJ27 Zdqxl8iSoKNhobWAEtbKrriFhY8+vo+33E8teDVmcL1I5uHRpOsZamLrT//Yq6Xxgn/mwK 1CTcx1/3XlFTR9owSKbcMg42RQ9J4+MtYXkMChUDbn6ygsGPiNvCdsNEQA9vpd73AhUhb0 HyXJ2JWyURD2BQ8t5LzQHbfn30OQ/xWgkX1tsWvHOE7qBDpvRySEa+fSpTuaGQ== From: Luca Ceresoli Date: Tue, 28 Apr 2026 17:30:53 +0200 Subject: [PATCH v3 04/11] drm/hisilicon/kirin: 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-4-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 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. Here the bridge pointer is only stored in a temporary variable, so a cleanup action is enough. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c index e80debdc4176..ab3cd309505a 100644 --- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c +++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c @@ -778,17 +778,16 @@ static int dsi_host_init(struct device *dev, struct dw_dsi *dsi) static int dsi_bridge_init(struct drm_device *dev, struct dw_dsi *dsi) { struct drm_encoder *encoder = &dsi->encoder; - struct drm_bridge *bridge; + struct drm_bridge *bridge __free(drm_bridge_put) = NULL; struct device_node *np = dsi->dev->of_node; - int ret; /* * Get the endpoint node. In our case, dsi has one output port1 * to which the external HDMI bridge is connected. */ - ret = drm_of_find_panel_or_bridge(np, 1, 0, NULL, &bridge); - if (ret) - return ret; + bridge = of_drm_get_bridge_by_endpoint(np, 1, 0); + if (IS_ERR(bridge)) + return PTR_ERR(bridge); /* associate the bridge to dsi encoder */ return drm_bridge_attach(encoder, bridge, NULL, 0); -- 2.53.0