public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/panel: tdo-tl070wsh30: Use devm_drm_panel_add()
@ 2026-04-28 13:18 박명훈
  2026-04-29 19:17 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: 박명훈 @ 2026-04-28 13:18 UTC (permalink / raw)
  To: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: Myeonghun Pak, dri-devel, linux-kernel, Ijae Kim

From: Myeonghun Pak <mhun512@gmail.com>

tdo_tl070wsh30_panel_probe() registers the panel before attaching the DSI
device. If mipi_dsi_attach() fails, the driver's remove callback is not
called and the panel remains registered in the global DRM panel registry.

Use devm_drm_panel_add() so panel registration is automatically unwound on
probe failure and device removal, and drop the explicit drm_panel_remove()
from the remove callback.

Fixes: cf40c6600592 ("drm: panel: add TDO tl070wsh30 panel driver")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
 drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
index 227f97f9b..1cf3ca1c0 100644
--- a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
+++ b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
@@ -169,9 +169,7 @@ static int tdo_tl070wsh30_panel_add(struct tdo_tl070wsh30_panel *tdo_tl070wsh30)
 	if (err)
 		return err;
 
-	drm_panel_add(&tdo_tl070wsh30->base);
-
-	return 0;
+	return devm_drm_panel_add(dev, &tdo_tl070wsh30->base);
 }
 
 static int tdo_tl070wsh30_panel_probe(struct mipi_dsi_device *dsi)
@@ -207,7 +205,6 @@ static void tdo_tl070wsh30_panel_remove(struct mipi_dsi_device *dsi)
 	if (err < 0)
 		dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
 
-	drm_panel_remove(&tdo_tl070wsh30->base);
 }
 
 static struct mipi_dsi_driver tdo_tl070wsh30_panel_driver = {
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-29 19:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28 13:18 [PATCH] drm/panel: tdo-tl070wsh30: Use devm_drm_panel_add() 박명훈
2026-04-29 19:17 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox