On Mon Sep 21, 2026 at 3:17 PM CEST, Osama Abdelkader wrote:
> Use the managed MIPI DSI attach and panel add helpers in Novatek and
> Raydium panel drivers and drop the corresponding manual detach and panel
> remove calls from remove paths.
>
> Suggested-by: Luca Ceresoli <[email protected]>
> Signed-off-by: Osama Abdelkader <[email protected]>
...
> diff --git a/drivers/gpu/drm/panel/panel-raydium-rm68200.c
> b/drivers/gpu/drm/panel/panel-raydium-rm68200.c
> index c535dc931903..f235cb4ae071 100644
> --- a/drivers/gpu/drm/panel/panel-raydium-rm68200.c
> +++ b/drivers/gpu/drm/panel/panel-raydium-rm68200.c
> @@ -360,26 +360,19 @@ static int rm68200_probe(struct mipi_dsi_device *dsi)
> if (ret)
> return ret;
>
> - drm_panel_add(&ctx->panel);
> + ret = devm_drm_panel_add(dev, &ctx->panel);
> + if (ret)
> + return ret;
>
> - ret = mipi_dsi_attach(dsi);
> + ret = devm_mipi_dsi_attach(dev, dsi);
> if (ret < 0) {
> dev_err(dev, "mipi_dsi_attach() failed: %d\n", ret);
> - drm_panel_remove(&ctx->panel);
> return ret;
> }
You could even do better:
if (ret < 0)
return dev_err_probe(dev, ret, "mipi_dsi_attach() failed:
%d\n", ret);
Same for other drivers in this patch.
If you want you can send that as a separate series.
> diff --git a/drivers/gpu/drm/panel/panel-raydium-rm692e5.c
> b/drivers/gpu/drm/panel/panel-raydium-rm692e5.c
> index 8e9484768657..4065cdf690f9 100644
> --- a/drivers/gpu/drm/panel/panel-raydium-rm692e5.c
> +++ b/drivers/gpu/drm/panel/panel-raydium-rm692e5.c
> @@ -315,7 +315,9 @@ static int rm692e5_probe(struct mipi_dsi_device *dsi)
> return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
> "Failed to create backlight\n");
>
> - drm_panel_add(&ctx->panel);
> + ret = devm_drm_panel_add(dev, &ctx->panel);
> + if (ret)
> + return ret;
>
Not related to this patch, but I wonder whether this [devm_]drm_panel_add()
should be moved down...
> /* This panel only supports DSC; unconditionally enable it */
> dsi->dsc = &ctx->dsc;
> @@ -331,28 +333,15 @@ static int rm692e5_probe(struct mipi_dsi_device *dsi)
> ctx->dsc.bits_per_pixel = 8 << 4; /* 4 fractional bits */
> ctx->dsc.block_pred_enable = true;
>
...here, just before DSI attach. I don't see a good reason for setting
ctx->dsc fields _after_ adding the panel.
> - ret = mipi_dsi_attach(dsi);
> + ret = devm_mipi_dsi_attach(dev, dsi);
> if (ret < 0) {
> dev_err(dev, "Failed to attach to DSI host: %d\n", ret);
> - drm_panel_remove(&ctx->panel);
> return ret;
> }
>
> return 0;
> }
Reviewed-by: Luca Ceresoli <[email protected]>
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com