Skip to contentSkip to conversation

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

PATCH In review Chen-Yu Tsai 3 participants 3 messages Dec 4, 2024 – Dec 5, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 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. Also fix up any uses of ctx->panel.dev to use dev directly.

---
Changes since v1:
- Also fix uses of ctx->panel.dev

 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/gpu/drm/panel/panel-visionox-rm69299.c +2 -7
index 272490b9565b..be3a9797fbce 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";
@@ -201,13 +200,11 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
 	ctx->supplies[1].supply = "vdd3p3";
 	ctx->supplies[1].init_load_uA = 13200;
 
-	ret = devm_regulator_bulk_get(ctx->panel.dev, ARRAY_SIZE(ctx->supplies),
-				      ctx->supplies);
+	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), ctx->supplies);
 	if (ret < 0)
 		return ret;
 
-	ctx->reset_gpio = devm_gpiod_get(ctx->panel.dev,
-					 "reset", GPIOD_OUT_LOW);
+	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
 	if (IS_ERR(ctx->reset_gpio)) {
 		dev_err(dev, "cannot get reset gpio %ld\n", PTR_ERR(ctx->reset_gpio));
 		return PTR_ERR(ctx->reset_gpio);
@@ -215,8 +212,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
Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 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. Also fix up any uses of ctx->panel.dev to use dev directly.

Quoted 47 lines

---
Changes since v1:
- Also fix uses of ctx->panel.dev

  drivers/gpu/drm/panel/panel-visionox-rm69299.c | 9 ++-------
  1 file changed, 2 insertions(+), 7 deletions(-)
drivers/gpu/drm/panel/panel-visionox-rm69299.c +2 -7
index 272490b9565b..be3a9797fbce 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";
@@ -201,13 +200,11 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
  	ctx->supplies[1].supply = "vdd3p3";
  	ctx->supplies[1].init_load_uA = 13200;
 
-	ret = devm_regulator_bulk_get(ctx->panel.dev, ARRAY_SIZE(ctx->supplies),
-				      ctx->supplies);
+	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), ctx->supplies);
  	if (ret < 0)
  		return ret;
 
-	ctx->reset_gpio = devm_gpiod_get(ctx->panel.dev,
-					 "reset", GPIOD_OUT_LOW);
+	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
  	if (IS_ERR(ctx->reset_gpio)) {
  		dev_err(dev, "cannot get reset gpio %ld\n", PTR_ERR(ctx->reset_gpio));
  		return PTR_ERR(ctx->reset_gpio);
@@ -215,8 +212,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
Reviewed-by on v2 1/1
#2 lore raw
In reply to Chen-Yu Tsai
Quoted 6 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. Also fix up any uses of ctx->panel.dev to use dev directly.

Quoted 8 lines

---
Changes since v1:
- Also fix uses of ctx->panel.dev

 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
Signature · 2 lines
With best wishes
Dmitry