mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: mohit.dsor@oss.qualcomm.com
To: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org, boss@oss.qualcomm.com,
	qc-display-maintainer@oss.qualcomm.com
Subject: [PATCH 3/5] drm/bridge: lt9611c: fix DT parsing and bridge refcount
Date: Sun, 28 Jun 2026 02:13:55 +0530	[thread overview]
Message-ID: <20260627204357.3336040-4-mohit.dsor@oss.qualcomm.com> (raw)
In-Reply-To: <20260627204357.3336040-1-mohit.dsor@oss.qualcomm.com>

From: Mohit Dsor <mohit.dsor@oss.qualcomm.com>

Ensure DT nodes are properly released on error and acquire a
reference to next_bridge

Signed-off-by: Mohit Dsor <mohit.dsor@oss.qualcomm.com>
---
 drivers/gpu/drm/bridge/lontium-lt9611c.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/lontium-lt9611c.c b/drivers/gpu/drm/bridge/lontium-lt9611c.c
index 30a07e97626a..4c8a3829a4be 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9611c.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9611c.c
@@ -974,6 +974,8 @@ static const struct drm_bridge_funcs lt9611c_bridge_funcs = {
 static int lt9611c_parse_dt(struct device *dev,
 			    struct lt9611c *lt9611c)
 {
+	int ret;
+
 	lt9611c->dsi0_node = of_graph_get_remote_node(dev->of_node, 0, -1);
 	if (!lt9611c->dsi0_node)
 		return dev_err_probe(dev, -ENODEV, "failed to get remote node for primary dsi\n");
@@ -984,7 +986,14 @@ static int lt9611c_parse_dt(struct device *dev,
 				 &lt9611c->selected_port))
 		lt9611c->selected_port = 0;
 
-	return drm_of_find_panel_or_bridge(dev->of_node, 2, -1, NULL, &lt9611c->bridge.next_bridge);
+	ret = drm_of_find_panel_or_bridge(dev->of_node, 2, -1, NULL, &lt9611c->bridge.next_bridge);
+	if (ret) {
+		of_node_put(lt9611c->dsi1_node);
+		of_node_put(lt9611c->dsi0_node);
+		return ret;
+	}
+	drm_bridge_get(lt9611c->bridge.next_bridge);
+	return 0;
 }
 
 static int lt9611c_gpio_init(struct lt9611c *lt9611c)
-- 
2.34.1


  parent reply	other threads:[~2026-06-27 20:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-27 20:43 [PATCH 0/5] drm/bridge: lt9611c: improve HPD handling and driver robustness mohit.dsor
2026-06-27 20:43 ` [PATCH 1/5] drm/bridge: lt9611c: fallback to cached HPD status on read failure mohit.dsor
2026-06-27 20:43 ` [PATCH 2/5] drm/bridge: lt9611c: implement hpd_enable callback mohit.dsor
2026-06-27 20:43 ` mohit.dsor [this message]
2026-06-27 20:43 ` [PATCH 4/5] drm/bridge: lt9611c: fix chip type initialization mohit.dsor
2026-06-27 20:43 ` [PATCH 5/5] drm/bridge: lt9611c: clean up probe error and remove paths mohit.dsor
2026-06-27 21:04 [PATCH 0/5] Subject: [PATCH 0/5] drm/bridge: lt9611c: improve HPD handling and driver robustness Mohit Dsor
2026-06-27 21:04 ` [PATCH 3/5] drm/bridge: lt9611c: fix DT parsing and bridge refcount Mohit Dsor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260627204357.3336040-4-mohit.dsor@oss.qualcomm.com \
    --to=mohit.dsor@oss.qualcomm.com \
    --cc=boss@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qc-display-maintainer@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®