diff mbox series

drm/panel: visionox-rm69299: Remove redundant assignments of panel fields

Message ID 20241202062449.65593-1-wenst@chromium.org (mailing list archive)
State New, archived
Headers show
Series drm/panel: visionox-rm69299: Remove redundant assignments of panel fields | expand

Commit Message

Chen-Yu Tsai Dec. 2, 2024, 6:24 a.m. UTC
drm_panel_init() was made to initialize the fields in |struct drm_panel|.
There is no need to separately initialize them again.

Drop the separate assignments that are redundant.

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
---
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Dmitry Baryshkov Dec. 2, 2024, 12:50 p.m. UTC | #1
On Mon, Dec 02, 2024 at 02:24:48PM +0800, Chen-Yu Tsai wrote:
> drm_panel_init() was made to initialize the fields in |struct drm_panel|.
> There is no need to separately initialize them again.
> 
> Drop the separate assignments that are redundant.
> 
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> ---
>  drivers/gpu/drm/panel/panel-visionox-rm69299.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> index 272490b9565b..1df5303eb57c 100644
> --- a/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> +++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> @@ -193,7 +193,6 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
>  
>  	mipi_dsi_set_drvdata(dsi, ctx);
>  
> -	ctx->panel.dev = dev;

No, this will break one of the following function calls. Please refactor
them too.

>  	ctx->dsi = dsi;
>  
>  	ctx->supplies[0].supply = "vdda";
> @@ -215,8 +214,6 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
>  
>  	drm_panel_init(&ctx->panel, dev, &visionox_rm69299_drm_funcs,
>  		       DRM_MODE_CONNECTOR_DSI);
> -	ctx->panel.dev = dev;
> -	ctx->panel.funcs = &visionox_rm69299_drm_funcs;
>  	drm_panel_add(&ctx->panel);
>  
>  	dsi->lanes = 4;
> -- 
> 2.47.0.338.g60cca15819-goog
>
Chen-Yu Tsai Dec. 3, 2024, 5:16 a.m. UTC | #2
On Mon, Dec 2, 2024 at 8:50 PM Dmitry Baryshkov
<dmitry.baryshkov@linaro.org> wrote:
>
> On Mon, Dec 02, 2024 at 02:24:48PM +0800, Chen-Yu Tsai wrote:
> > drm_panel_init() was made to initialize the fields in |struct drm_panel|.
> > There is no need to separately initialize them again.
> >
> > Drop the separate assignments that are redundant.
> >
> > Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> > ---
> >  drivers/gpu/drm/panel/panel-visionox-rm69299.c | 3 ---
> >  1 file changed, 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> > index 272490b9565b..1df5303eb57c 100644
> > --- a/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> > +++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> > @@ -193,7 +193,6 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
> >
> >       mipi_dsi_set_drvdata(dsi, ctx);
> >
> > -     ctx->panel.dev = dev;
>
> No, this will break one of the following function calls. Please refactor
> them too.

You're right. And it mixes usage of `ctx->panel.dev` and `dev`.
I'll send v2 getting rid of `ctx->panel.dev`.

ChenYu

> >       ctx->dsi = dsi;
> >
> >       ctx->supplies[0].supply = "vdda";
> > @@ -215,8 +214,6 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
> >
> >       drm_panel_init(&ctx->panel, dev, &visionox_rm69299_drm_funcs,
> >                      DRM_MODE_CONNECTOR_DSI);
> > -     ctx->panel.dev = dev;
> > -     ctx->panel.funcs = &visionox_rm69299_drm_funcs;
> >       drm_panel_add(&ctx->panel);
> >
> >       dsi->lanes = 4;
> > --
> > 2.47.0.338.g60cca15819-goog
> >
>
> --
> With best wishes
> Dmitry
diff mbox series

Patch

diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
index 272490b9565b..1df5303eb57c 100644
--- a/drivers/gpu/drm/panel/panel-visionox-rm69299.c
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -193,7 +193,6 @@  static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
 
 	mipi_dsi_set_drvdata(dsi, ctx);
 
-	ctx->panel.dev = dev;
 	ctx->dsi = dsi;
 
 	ctx->supplies[0].supply = "vdda";
@@ -215,8 +214,6 @@  static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
 
 	drm_panel_init(&ctx->panel, dev, &visionox_rm69299_drm_funcs,
 		       DRM_MODE_CONNECTOR_DSI);
-	ctx->panel.dev = dev;
-	ctx->panel.funcs = &visionox_rm69299_drm_funcs;
 	drm_panel_add(&ctx->panel);
 
 	dsi->lanes = 4;