dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] drm/panel: switch panel registration to devm_drm_panel_add()
@ 2026-04-23 12:59 Myeonghun Pak
  2026-04-23 12:59 ` [PATCH v2 1/3] drm/panel: ilitek-ili9881c: use devm_drm_panel_add() Myeonghun Pak
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Myeonghun Pak @ 2026-04-23 12:59 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Sumit Semwal,
	Casey Connolly, dri-devel, linux-kernel, Myeonghun Pak

This respins the previous attach-failure fixes as a single series.

drm-misc-next now has devm_drm_panel_add() in commit e43a8e3ad8fa
("drm/panel: add devm_drm_panel_add() helper"), so convert the three
affected panel drivers to the managed helper instead of open-coding
drm_panel_remove() in their failure and remove paths.

Changes in v2:
- group the three related panel fixes into one series
- rebase onto drm-misc-next and use devm_drm_panel_add()
- drop manual drm_panel_remove() handling from probe/remove

Myeonghun Pak (3):
  drm/panel: ilitek-ili9881c: use devm_drm_panel_add()
  drm/panel: jdi-fhd-r63452: use devm_drm_panel_add()
  drm/panel: lg-sw43408: use devm_drm_panel_add()

 drivers/gpu/drm/panel/panel-ilitek-ili9881c.c |  7 +++----
 drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c  |  7 +++----
 drivers/gpu/drm/panel/panel-lg-sw43408.c      | 10 +++++-----
 3 files changed, 11 insertions(+), 13 deletions(-)

-- 
2.47.1

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

* [PATCH v2 1/3] drm/panel: ilitek-ili9881c: use devm_drm_panel_add()
  2026-04-23 12:59 [PATCH v2 0/3] drm/panel: switch panel registration to devm_drm_panel_add() Myeonghun Pak
@ 2026-04-23 12:59 ` Myeonghun Pak
  2026-04-23 12:59 ` [PATCH v2 2/3] drm/panel: jdi-fhd-r63452: " Myeonghun Pak
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Myeonghun Pak @ 2026-04-23 12:59 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Sumit Semwal,
	Casey Connolly, dri-devel, linux-kernel, Myeonghun Pak

Replace drm_panel_add()/drm_panel_remove() with devm_drm_panel_add()
now that drm-misc-next provides it. This keeps panel deregistration tied
to the device lifetime and removes the manual cleanup from the remove
callback.

Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
 drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
index 0652cdb57d..bc3cd9a182 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
@@ -2590,7 +2590,9 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
 	if (ret)
 		return ret;
 
-	drm_panel_add(&ctx->panel);
+	ret = devm_drm_panel_add(&dsi->dev, &ctx->panel);
+	if (ret)
+		return dev_err_probe(&dsi->dev, ret, "Failed to add panel\n");
 
 	dsi->mode_flags = ctx->desc->mode_flags;
 	dsi->format = MIPI_DSI_FMT_RGB888;
@@ -2601,10 +2603,7 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
 
 static void ili9881c_dsi_remove(struct mipi_dsi_device *dsi)
 {
-	struct ili9881c *ctx = mipi_dsi_get_drvdata(dsi);
-
 	mipi_dsi_detach(dsi);
-	drm_panel_remove(&ctx->panel);
 }
 
 static const struct ili9881c_desc lhr050h41_desc = {
-- 
2.47.1


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

* [PATCH v2 2/3] drm/panel: jdi-fhd-r63452: use devm_drm_panel_add()
  2026-04-23 12:59 [PATCH v2 0/3] drm/panel: switch panel registration to devm_drm_panel_add() Myeonghun Pak
  2026-04-23 12:59 ` [PATCH v2 1/3] drm/panel: ilitek-ili9881c: use devm_drm_panel_add() Myeonghun Pak
@ 2026-04-23 12:59 ` Myeonghun Pak
  2026-04-23 12:59 ` [PATCH v2 3/3] drm/panel: lg-sw43408: " Myeonghun Pak
  2026-05-07  7:13 ` [PATCH v2 0/3] drm/panel: switch panel registration to devm_drm_panel_add() Neil Armstrong
  3 siblings, 0 replies; 6+ messages in thread
From: Myeonghun Pak @ 2026-04-23 12:59 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Sumit Semwal,
	Casey Connolly, dri-devel, linux-kernel, Myeonghun Pak

Replace drm_panel_add()/drm_panel_remove() with devm_drm_panel_add()
now that drm-misc-next provides it. This keeps panel deregistration tied
to the device lifetime and removes the manual cleanup from the remove
callback.

Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
 drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c b/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c
index cbe354b51b..32822c5712 100644
--- a/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c
+++ b/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c
@@ -200,7 +200,9 @@ static int jdi_fhd_r63452_probe(struct mipi_dsi_device *dsi)
 	if (ret)
 		return dev_err_probe(dev, ret, "Failed to get backlight\n");
 
-	drm_panel_add(&ctx->panel);
+	ret = devm_drm_panel_add(dev, &ctx->panel);
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to add panel\n");
 
 	ret = mipi_dsi_attach(dsi);
 	if (ret < 0) {
@@ -213,14 +215,11 @@ static int jdi_fhd_r63452_probe(struct mipi_dsi_device *dsi)
 
 static void jdi_fhd_r63452_remove(struct mipi_dsi_device *dsi)
 {
-	struct jdi_fhd_r63452 *ctx = mipi_dsi_get_drvdata(dsi);
 	int ret;
 
 	ret = mipi_dsi_detach(dsi);
 	if (ret < 0)
 		dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret);
-
-	drm_panel_remove(&ctx->panel);
 }
 
 static const struct of_device_id jdi_fhd_r63452_of_match[] = {
-- 
2.47.1


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

* [PATCH v2 3/3] drm/panel: lg-sw43408: use devm_drm_panel_add()
  2026-04-23 12:59 [PATCH v2 0/3] drm/panel: switch panel registration to devm_drm_panel_add() Myeonghun Pak
  2026-04-23 12:59 ` [PATCH v2 1/3] drm/panel: ilitek-ili9881c: use devm_drm_panel_add() Myeonghun Pak
  2026-04-23 12:59 ` [PATCH v2 2/3] drm/panel: jdi-fhd-r63452: " Myeonghun Pak
@ 2026-04-23 12:59 ` Myeonghun Pak
  2026-05-07  9:03   ` Dmitry Baryshkov
  2026-05-07  7:13 ` [PATCH v2 0/3] drm/panel: switch panel registration to devm_drm_panel_add() Neil Armstrong
  3 siblings, 1 reply; 6+ messages in thread
From: Myeonghun Pak @ 2026-04-23 12:59 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Sumit Semwal,
	Casey Connolly, dri-devel, linux-kernel, Myeonghun Pak

Replace drm_panel_add()/drm_panel_remove() with devm_drm_panel_add()
now that drm-misc-next provides it. This keeps panel deregistration tied
to the device lifetime and removes the manual cleanup from the remove
callback.

Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
 drivers/gpu/drm/panel/panel-lg-sw43408.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-lg-sw43408.c b/drivers/gpu/drm/panel/panel-lg-sw43408.c
index 293826c500..8969f57b89 100644
--- a/drivers/gpu/drm/panel/panel-lg-sw43408.c
+++ b/drivers/gpu/drm/panel/panel-lg-sw43408.c
@@ -254,8 +254,11 @@ static int sw43408_add(struct sw43408_panel *ctx)
 
 	ctx->base.prepare_prev_first = true;
 
-	drm_panel_add(&ctx->base);
-	return ret;
+	ret = devm_drm_panel_add(dev, &ctx->base);
+	if (ret < 0)
+		return dev_err_probe(dev, ret, "Failed to add panel\n");
+
+	return 0;
 }
 
 static int sw43408_probe(struct mipi_dsi_device *dsi)
@@ -299,14 +302,11 @@ static int sw43408_probe(struct mipi_dsi_device *dsi)
 
 static void sw43408_remove(struct mipi_dsi_device *dsi)
 {
-	struct sw43408_panel *ctx = mipi_dsi_get_drvdata(dsi);
 	int ret;
 
 	ret = mipi_dsi_detach(dsi);
 	if (ret < 0)
 		dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret);
-
-	drm_panel_remove(&ctx->base);
 }
 
 static struct mipi_dsi_driver sw43408_driver = {
-- 
2.47.1


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

* Re: [PATCH v2 0/3] drm/panel: switch panel registration to devm_drm_panel_add()
  2026-04-23 12:59 [PATCH v2 0/3] drm/panel: switch panel registration to devm_drm_panel_add() Myeonghun Pak
                   ` (2 preceding siblings ...)
  2026-04-23 12:59 ` [PATCH v2 3/3] drm/panel: lg-sw43408: " Myeonghun Pak
@ 2026-05-07  7:13 ` Neil Armstrong
  3 siblings, 0 replies; 6+ messages in thread
From: Neil Armstrong @ 2026-05-07  7:13 UTC (permalink / raw)
  To: Myeonghun Pak
  Cc: Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Sumit Semwal,
	Casey Connolly, dri-devel, linux-kernel

On 4/23/26 14:59, Myeonghun Pak wrote:
> This respins the previous attach-failure fixes as a single series.
> 
> drm-misc-next now has devm_drm_panel_add() in commit e43a8e3ad8fa
> ("drm/panel: add devm_drm_panel_add() helper"), so convert the three
> affected panel drivers to the managed helper instead of open-coding
> drm_panel_remove() in their failure and remove paths.
> 
> Changes in v2:
> - group the three related panel fixes into one series
> - rebase onto drm-misc-next and use devm_drm_panel_add()
> - drop manual drm_panel_remove() handling from probe/remove
> 
> Myeonghun Pak (3):
>    drm/panel: ilitek-ili9881c: use devm_drm_panel_add()
>    drm/panel: jdi-fhd-r63452: use devm_drm_panel_add()
>    drm/panel: lg-sw43408: use devm_drm_panel_add()
> 
>   drivers/gpu/drm/panel/panel-ilitek-ili9881c.c |  7 +++----
>   drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c  |  7 +++----
>   drivers/gpu/drm/panel/panel-lg-sw43408.c      | 10 +++++-----
>   3 files changed, 11 insertions(+), 13 deletions(-)
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

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

* Re: [PATCH v2 3/3] drm/panel: lg-sw43408: use devm_drm_panel_add()
  2026-04-23 12:59 ` [PATCH v2 3/3] drm/panel: lg-sw43408: " Myeonghun Pak
@ 2026-05-07  9:03   ` Dmitry Baryshkov
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Baryshkov @ 2026-05-07  9:03 UTC (permalink / raw)
  To: Myeonghun Pak
  Cc: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Sumit Semwal,
	Casey Connolly, dri-devel, linux-kernel

On Thu, Apr 23, 2026 at 09:59:22PM +0900, Myeonghun Pak wrote:
> Replace drm_panel_add()/drm_panel_remove() with devm_drm_panel_add()
> now that drm-misc-next provides it. This keeps panel deregistration tied
> to the device lifetime and removes the manual cleanup from the remove
> callback.
> 
> Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
> ---
>  drivers/gpu/drm/panel/panel-lg-sw43408.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-lg-sw43408.c b/drivers/gpu/drm/panel/panel-lg-sw43408.c
> index 293826c500..8969f57b89 100644
> --- a/drivers/gpu/drm/panel/panel-lg-sw43408.c
> +++ b/drivers/gpu/drm/panel/panel-lg-sw43408.c
> @@ -254,8 +254,11 @@ static int sw43408_add(struct sw43408_panel *ctx)
>  
>  	ctx->base.prepare_prev_first = true;
>  
> -	drm_panel_add(&ctx->base);
> -	return ret;
> +	ret = devm_drm_panel_add(dev, &ctx->base);
> +	if (ret < 0)
> +		return dev_err_probe(dev, ret, "Failed to add panel\n");
> +
> +	return 0;
>  }
>  
>  static int sw43408_probe(struct mipi_dsi_device *dsi)
> @@ -299,14 +302,11 @@ static int sw43408_probe(struct mipi_dsi_device *dsi)
>  
>  static void sw43408_remove(struct mipi_dsi_device *dsi)
>  {
> -	struct sw43408_panel *ctx = mipi_dsi_get_drvdata(dsi);
>  	int ret;
>  
>  	ret = mipi_dsi_detach(dsi);

This begs to use devm_mipi_dsi_attach() in the probe function. The whole
remove callback can be removed then.

>  	if (ret < 0)
>  		dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret);
> -
> -	drm_panel_remove(&ctx->base);
>  }
>  
>  static struct mipi_dsi_driver sw43408_driver = {
> -- 
> 2.47.1
> 

-- 
With best wishes
Dmitry

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

end of thread, other threads:[~2026-05-07  9:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-23 12:59 [PATCH v2 0/3] drm/panel: switch panel registration to devm_drm_panel_add() Myeonghun Pak
2026-04-23 12:59 ` [PATCH v2 1/3] drm/panel: ilitek-ili9881c: use devm_drm_panel_add() Myeonghun Pak
2026-04-23 12:59 ` [PATCH v2 2/3] drm/panel: jdi-fhd-r63452: " Myeonghun Pak
2026-04-23 12:59 ` [PATCH v2 3/3] drm/panel: lg-sw43408: " Myeonghun Pak
2026-05-07  9:03   ` Dmitry Baryshkov
2026-05-07  7:13 ` [PATCH v2 0/3] drm/panel: switch panel registration to devm_drm_panel_add() Neil Armstrong

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