* [RFC] Clean up check for already prepared panel
@ 2023-10-23 14:51 Yuran Pereira
2023-10-23 14:57 ` neil.armstrong
0 siblings, 1 reply; 2+ messages in thread
From: Yuran Pereira @ 2023-10-23 14:51 UTC (permalink / raw)
To: neil.armstrong; +Cc: sam, linux-kernel, dri-devel, dianders, Yuran Pereira
Since the core function drm_panel_prepare already checks if the
panel is prepared, we can remove this duplicate check from tm5p5_nt35596_prepare
which acts as a no-op. As suggested in the GPU TODO [1]
[1] https://docs.kernel.org/gpu/todo.html#clean-up-checks-for-already-prepared-enabled-in-panels
Suggested-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Yuran Pereira <yuran.pereira@hotmail.com>
---
drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c b/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c
index 075a7af81eff..af83451b3374 100644
--- a/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c
+++ b/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c
@@ -112,9 +112,6 @@ static int tm5p5_nt35596_prepare(struct drm_panel *panel)
struct device *dev = &ctx->dsi->dev;
int ret;
- if (ctx->prepared)
- return 0;
-
ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
if (ret < 0) {
dev_err(dev, "Failed to enable regulators: %d\n", ret);
@@ -132,7 +129,6 @@ static int tm5p5_nt35596_prepare(struct drm_panel *panel)
return ret;
}
- ctx->prepared = true;
return 0;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RFC] Clean up check for already prepared panel
2023-10-23 14:51 [RFC] Clean up check for already prepared panel Yuran Pereira
@ 2023-10-23 14:57 ` neil.armstrong
0 siblings, 0 replies; 2+ messages in thread
From: neil.armstrong @ 2023-10-23 14:57 UTC (permalink / raw)
To: Yuran Pereira; +Cc: sam, dianders, dri-devel, linux-kernel
Hi,
On 23/10/2023 16:51, Yuran Pereira wrote:
> Since the core function drm_panel_prepare already checks if the
> panel is prepared, we can remove this duplicate check from tm5p5_nt35596_prepare
> which acts as a no-op. As suggested in the GPU TODO [1]
>
> [1] https://docs.kernel.org/gpu/todo.html#clean-up-checks-for-already-prepared-enabled-in-panels
>
> Suggested-by: Douglas Anderson <dianders@chromium.org>
> Signed-off-by: Yuran Pereira <yuran.pereira@hotmail.com>
> ---
> drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c b/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c
> index 075a7af81eff..af83451b3374 100644
> --- a/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c
> +++ b/drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c
> @@ -112,9 +112,6 @@ static int tm5p5_nt35596_prepare(struct drm_panel *panel)
> struct device *dev = &ctx->dsi->dev;
> int ret;
>
> - if (ctx->prepared)
> - return 0;
> -
> ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
> if (ret < 0) {
> dev_err(dev, "Failed to enable regulators: %d\n", ret);
> @@ -132,7 +129,6 @@ static int tm5p5_nt35596_prepare(struct drm_panel *panel)
> return ret;
> }
>
> - ctx->prepared = true;
> return 0;
> }
>
This has already been done and merged in:
https://patchwork.freedesktop.org/patch/msgid/20230804140605.RFC.1.Ia54954fd2f7645c1b86597494902973f57feeb71@changeid
Thanks,
Neil
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-23 15:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-23 14:51 [RFC] Clean up check for already prepared panel Yuran Pereira
2023-10-23 14:57 ` neil.armstrong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).