mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
To: "Osama Abdelkader" <osama.abdelkader@gmail.com>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"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>,
	"Linus Walleij" <linusw@kernel.org>,
	"Cristian Cozzolino" <cristian_ci@protonmail.com>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Robert Chiras" <robert.chiras@nxp.com>
Cc: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	"Jessica Zhang" <jesszhan0024@gmail.com>
Subject: Re: [PATCH v7 2/3] drm/panel: Use managed helpers in Novatek and Raydium panels
Date: Tue, 20 Oct 2026 13:24:21 +0200	[thread overview]
Message-ID: <DM9MLYYD6H7C.ER1KSRN65HR7@bootlin.com> (raw)
In-Reply-To: <66eccc200bb4f5e26a3464a46448b1a4c03b53a6.1789994813.git.osama.abdelkader@gmail.com>

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 <luca.ceresoli@bootlin.com>
> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>

...

> 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 <luca.ceresoli@bootlin.com>

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  parent reply	other threads:[~2026-10-20 11:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 13:17 [PATCH v7 0/3] drm/panel: Use managed helpers in DSI panels Osama Abdelkader
2026-09-21 13:17 ` [PATCH v7 1/3] drm/panel: Use devm_mipi_dsi_attach in BOE panels Osama Abdelkader
2026-10-20 11:24   ` Luca Ceresoli
2026-09-21 13:17 ` [PATCH v7 2/3] drm/panel: Use managed helpers in Novatek and Raydium panels Osama Abdelkader
2026-10-01  6:57   ` Linus Walleij
2026-10-20 11:24   ` Luca Ceresoli [this message]
2026-09-21 13:17 ` [PATCH v7 3/3] drm/panel: Use managed helpers in assorted panels Osama Abdelkader
2026-10-20 11:24   ` Luca Ceresoli
2026-10-15 10:06 ` [PATCH v7 0/3] drm/panel: Use managed helpers in DSI panels Osama Abdelkader
2026-10-15 10:13 ` 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=DM9MLYYD6H7C.ER1KSRN65HR7@bootlin.com \
    --to=luca.ceresoli@bootlin.com \
    --cc=airlied@gmail.com \
    --cc=cristian_ci@protonmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=krzk@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=osama.abdelkader@gmail.com \
    --cc=robert.chiras@nxp.com \
    --cc=simona@ffwll.ch \
    --cc=sumit.semwal@linaro.org \
    --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®