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 53A413AB284 for ; Fri, 14 Aug 2026 14:07:21 +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=1786716449; cv=none; b=Wu4vkbUzYLi7uLfukb9ayJmZlsNNh/NI3CjBIJ2OgNIT1e7FhmjlU5ufD6vRLSS/pRlSOLPHMrJBccOHjeMozQ2dGijYCUUbHL/asSyIpoDf/9ujFnmeXIPU/WC+g6ER6O1La7TAaaFZ+39GLvFmBpQxIilm1Ivb8qZETmAzS0w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786716449; c=relaxed/simple; bh=QUlJ2DjVbensS4bunAagtEbwqE8e8cfHcWU9E/iK/ww=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QpIFJKyE1z1iv5e+d066CKXNiFiZEWDmXz/3WYI6G/uQun169S0yMNMGwlE6z9jkEzZNbSLbSMdYaseqMUTH9fuop1bfuy9V+V7juYa8lDefz1oNNJeY6Yoy150Yeq072INjL1athJEmTjbAoK0On9HQikwGPQkJjqFCwq16GGw= 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=MA44EJQx; 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="MA44EJQx" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id E655F1A163F; Fri, 14 Aug 2026 14:07:17 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id B31CA6046D; Fri, 14 Aug 2026 14:07:17 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 15BA111C4EDA6; Fri, 14 Aug 2026 16:07:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1786716436; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=wBKbzNKqN/AUW/MwcDfWph24Igbq8cdctbKLdKXyxMI=; b=MA44EJQxDJD9YBscVgJPSCgKZ2FjvIFFUD99HvnMfux9U1pk8YdDXdVceO/7xENKxrCpan IOcjjqf61V8zrYcGBDFfv9eY+Iy68TLeixTdTHYONql2iFIR0ztFReB3PZH4e83lsSdEWX WbLQ3BkdAqcE3duj8pO7FPl3FoDsNHbAGHvAqMajZvg4e3CYl0n2opgaVBJp73ApcQg6qA hRWiBTJtwYHzh0aCaDlLW1Phqpp+I+2zrg43wIyOfKaYL7+h1xkh3heQ5mvCOovQSHN70H UJIaE6ZFfbxC4rviQ7SDwlJSN6UrbW6CNEXVWlQY+nGaP2eIDvAjxiOZga/NWw== From: Luca Ceresoli Date: Fri, 14 Aug 2026 16:05:59 +0200 Subject: [PATCH 11/11] drm/bridge: samsung-dsim: don't create a panel_bridge 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: <20260814-drm-bridge-every-panel-v1-11-19cd5277cc8d@bootlin.com> References: <20260814-drm-bridge-every-panel-v1-0-19cd5277cc8d@bootlin.com> In-Reply-To: <20260814-drm-bridge-every-panel-v1-0-19cd5277cc8d@bootlin.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Jessica Zhang , Linus Walleij , Inki Dae , Jagan Teki , Marek Szyprowski Cc: Dmitry Baryshkov , Hui Pu , Ian Ray , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.16.0 X-Last-TLS-Session-Version: TLSv1.3 Now a panel_bridge is automatically created for every drm_panel, so this code (similar to an open-coded variant of drm_of_find_panel_or_bridge()) would lead to creating a second panel_bridge for the same panel. Fix and simplify the code by just getting a reference to the already-existing bridge. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/samsung-dsim.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 5457a7b02a33..55d4e3aedb3d 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1898,7 +1898,6 @@ static int samsung_dsim_host_attach(struct mipi_dsi_host *host, struct device *dev = dsi->dev; struct device_node *np = dev->of_node; struct device_node *remote; - struct drm_panel *panel; int ret = 0; /* @@ -1931,21 +1930,9 @@ static int samsung_dsim_host_attach(struct mipi_dsi_host *host, if (!remote) return -ENODEV; - panel = of_drm_find_panel(remote); - if (!IS_ERR(panel)) { - next_bridge = devm_drm_panel_bridge_add(dev, panel); - drm_panel_put(panel); - if (IS_ERR(next_bridge)) { - ret = PTR_ERR(next_bridge); - next_bridge = NULL; // Inhibit the cleanup action on an ERR_PTR - } else { - drm_bridge_get(next_bridge); - } - } else { - next_bridge = of_drm_find_and_get_bridge(remote); - if (!next_bridge) - ret = -EINVAL; - } + next_bridge = of_drm_find_and_get_bridge(remote); + if (!next_bridge) + ret = -EINVAL; of_node_put(remote); -- 2.55.0