Skip to contentSkip to conversation

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

PATCH Superseded Chen-Yu Tsai 2 participants 3 messages Dec 2, 2024 – Dec 3, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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

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.

---
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/panel/panel-visionox-rm69299.c +0 -3
index 272490b9565b..1df5303eb57c 100644
@@ -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;
Signature · 1 line
2.47.0.338.g60cca15819-goog
#1 lore raw
Quoted 15 lines · Chen-Yu Tsai

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.

---
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/panel/panel-visionox-rm69299.c +0 -0
index 272490b9565b..1df5303eb57c 100644

drivers/gpu/drm/panel/panel-visionox-rm69299.c static int visionox_rm69299_probe(struct mipi_dsi_device *dsi) · line 196

Quoted 4 lines
drivers/gpu/drm/panel/panel-visionox-rm69299.c +0 -1
@@ -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.

Quoted 15 lines
drivers/gpu/drm/panel/panel-visionox-rm69299.c +0 -2
 	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;
Signature · 1 line
2.47.0.338.g60cca15819-goog
Signature · 2 lines
With best wishes
Dmitry
#2 lore raw
Quoted 18 lines · Dmitry Baryshkov
Quoted 16 lines · Chen-Yu Tsai

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.

---
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/panel/panel-visionox-rm69299.c +0 -0
index 272490b9565b..1df5303eb57c 100644
@@ -193,7 +193,6 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
 
Quoted 6 lines

drivers/gpu/drm/panel/panel-visionox-rm69299.c static int visionox_rm69299_probe(struct mipi_dsi_device *dsi) · line 196

Quoted 3 lines
drivers/gpu/drm/panel/panel-visionox-rm69299.c +0 -1
      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

Quoted 19 lines
Quoted 13 lines
drivers/gpu/drm/panel/panel-visionox-rm69299.c +0 -3
      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;
--
Quoted 2 lines

2.47.0.338.g60cca15819-goog

--
With best wishes
Dmitry