mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Osama Abdelkader <osama.abdelkader@gmail.com>
To: luca.ceresoli@bootlin.com,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Jessica Zhang <jesszhan0024@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: Osama Abdelkader <osama.abdelkader@gmail.com>
Subject: [PATCH v5 4/4] drm/panel: simple: Use managed helpers in panel-simple
Date: Tue, 15 Sep 2026 16:59:31 +0200	[thread overview]
Message-ID: <20260915145935.60397-5-osama.abdelkader@gmail.com> (raw)
In-Reply-To: <20260915145935.60397-1-osama.abdelkader@gmail.com>

Use the managed panel add helper in panel-simple and drop the manual
panel remove call from the remove path.

Keep the MIPI DSI attach and detach manual, since panel-simple's
remove callback also unprepares/disables the panel and releases the
DDC adapter; deferring the detach to devm would run it after that
cleanup instead of before, changing the teardown order.

Suggested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
 drivers/gpu/drm/panel/panel-simple.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index c95964ba25a9..02d21dde5766 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -737,7 +737,9 @@ static struct panel_simple *panel_simple_probe(struct device *dev)
 		goto disable_pm_runtime;
 	}
 
-	drm_panel_add(&panel->base);
+	err = devm_drm_panel_add(dev, &panel->base);
+	if (err)
+		goto disable_pm_runtime;
 
 	return panel;
 
@@ -785,7 +787,6 @@ static void panel_simple_remove(struct device *dev)
 {
 	struct panel_simple *panel = dev_get_drvdata(dev);
 
-	drm_panel_remove(&panel->base);
 	panel_simple_shutdown(dev);
 
 	pm_runtime_dont_use_autosuspend(dev);
@@ -6540,7 +6541,6 @@ static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
 {
 	const struct panel_desc_dsi *desc;
 	struct panel_simple *panel;
-	int err;
 
 	panel = panel_simple_probe(&dsi->dev);
 	if (IS_ERR(panel))
@@ -6551,14 +6551,7 @@ static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
 	dsi->format = desc->format;
 	dsi->lanes = desc->lanes;
 
-	err = mipi_dsi_attach(dsi);
-	if (err) {
-		struct panel_simple *panel = mipi_dsi_get_drvdata(dsi);
-
-		drm_panel_remove(&panel->base);
-	}
-
-	return err;
+	return mipi_dsi_attach(dsi);
 }
 
 static void panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
-- 
2.43.0


  parent reply	other threads:[~2026-09-15 15:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260915145935.60397-1-osama.abdelkader@gmail.com>
2026-09-15 14:59 ` [PATCH v5 1/4] drm/panel: Use devm_mipi_dsi_attach in BOE panels Osama Abdelkader
2026-09-15 14:59 ` [PATCH v5 2/4] drm/panel: Use managed helpers in Novatek and Raydium panels Osama Abdelkader
2026-09-15 14:59 ` [PATCH v5 3/4] drm/panel: Use managed helpers in assorted panels Osama Abdelkader
2026-09-15 14:59 ` Osama Abdelkader [this message]
2026-09-16  7:50   ` [PATCH v5 4/4] drm/panel: simple: Use managed helpers in panel-simple Luca Ceresoli
2026-09-16 17:25     ` Osama Abdelkader

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=20260915145935.60397-5-osama.abdelkader@gmail.com \
    --to=osama.abdelkader@gmail.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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®