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 A4DB93B4E9C for ; Mon, 13 Apr 2026 13:59:03 +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=1776088745; cv=none; b=AT0gedh6CAxrl5ATEw2gAQ9Rkf8C/E63olHNOySHlszfd68zsbrYkZ2vxWP5mT191AoH9WV1vJljsLOjE9p2M5VIQ1Q7F8ujnlF2/CUk2xd9aWoww8Q2xHOxVIIv+N1la9y7fzfdGBGWbFV8p8jb5pwkeEB4/DnJp76BubGsdD0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776088745; c=relaxed/simple; bh=Fs3vjobBJ+CTpAgUlGyTCk3RUeGEl8JwUAjWsCkKr4c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sJ87RYwruPQYfmZiBM633MrprLFzaCG0X2waeW5X7UxMHOKkL53DxOyE78xJuyxMsPEjWnNW59OPoHeI8hrPr/28rFPV2iRwZ9hJFwD4dvgPR6ebPVl8VPIhoKmULj8bfk4ZzJNGUJWtkQHHI0oPmIY3noHUo1THGuxahYs/Zkc= 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=Gv2FSf7y; 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="Gv2FSf7y" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 52F664E42977; Mon, 13 Apr 2026 13:59:02 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 218B65FFB9; Mon, 13 Apr 2026 13:59:02 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 391FE10450269; Mon, 13 Apr 2026 15:58:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1776088740; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=wzauR+KKJUv0OQ342MqFlZzgfROujyztvta1hCF81lc=; b=Gv2FSf7y0qPnQBsW+k2lhk7HtC/MvYjLCCIx2zm5Jf2F0JMHeW/2BwWH88Zf8LINWmCcWm oFf8dQmGDtyKmqKTEWnDDwzYrxa7gfEcWvA+NSRn9cE2mgenHRCetEa+MBmb5WtZaoOVBD HD3KhDp2UVzbGG5+AHSqWsX7JBzKV2A7paVVZgCLVp17rHYunP0lxq5sDWHX0vlrBZbcWx qSMzzvZxypHfy5b0LTJS2HgSc2E2EiQL15g+SsrBPKDSzvC/pHVZHoLhFIgefbrduzZoT7 qZ1YCWnpmdBt9zqBx3S5h+EjO8L30I7YphkKDNM8Nv81EwL0nTI0E4N+bVZzmQ== From: Luca Ceresoli Date: Mon, 13 Apr 2026 15:58:35 +0200 Subject: [PATCH 03/10] 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: <20260413-drm-bridge-alloc-getput-panel_or_bridge-v1-3-acd01cd79a1f@bootlin.com> References: <20260413-drm-bridge-alloc-getput-panel_or_bridge-v1-0-acd01cd79a1f@bootlin.com> In-Reply-To: <20260413-drm-bridge-alloc-getput-panel_or_bridge-v1-0-acd01cd79a1f@bootlin.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Clark , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Sean Paul , Marijn Suijten , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , 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.1 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 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..7b2ef5ed2c40 100644 --- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c +++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c @@ -778,7 +778,7 @@ 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; @@ -786,7 +786,7 @@ static int dsi_bridge_init(struct drm_device *dev, struct dw_dsi *dsi) * 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); + ret = of_drm_get_bridge_by_endpoint(np, 1, 0, &bridge); if (ret) return ret; -- 2.53.0