Re: [PATCH] drm/panel: visionox-rm69299: Remove redundant assignments of panel fields

From: Dmitry Baryshkov
Date: Mon Dec 02 2024 - 07:50:42 EST


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@xxxxxxxxxxxx>
> ---
> 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
>

--
With best wishes
Dmitry