diff mbox series

[6/6] drm/panel: visionox-rm69299: stop calling regulator_set_load manually

Message ID 20240404-drop-panel-unregister-v1-6-9f56953c5fb9@linaro.org (mailing list archive)
State New, archived
Headers show
Series drm/panel: small fixes for visionox and novatek panel drivers | expand

Commit Message

Dmitry Baryshkov April 4, 2024, 10:08 a.m. UTC
Use .init_load_uA part of the bulk regulator API instead of calling
register_set_load() manually.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

Comments

Neil Armstrong April 24, 2024, 6:53 a.m. UTC | #1
On 04/04/2024 12:08, Dmitry Baryshkov wrote:
> Use .init_load_uA part of the bulk regulator API instead of calling
> register_set_load() manually.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>   drivers/gpu/drm/panel/panel-visionox-rm69299.c | 16 ++--------------
>   1 file changed, 2 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> index b15ca56a09a7..272490b9565b 100644
> --- a/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> +++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
> @@ -197,7 +197,9 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
>   	ctx->dsi = dsi;
>   
>   	ctx->supplies[0].supply = "vdda";
> +	ctx->supplies[0].init_load_uA = 32000;
>   	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);
> @@ -227,22 +229,8 @@ static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
>   		goto err_dsi_attach;
>   	}
>   
> -	ret = regulator_set_load(ctx->supplies[0].consumer, 32000);
> -	if (ret) {
> -		dev_err(dev, "regulator set load failed for vdda supply ret = %d\n", ret);
> -		goto err_set_load;
> -	}
> -
> -	ret = regulator_set_load(ctx->supplies[1].consumer, 13200);
> -	if (ret) {
> -		dev_err(dev, "regulator set load failed for vdd3p3 supply ret = %d\n", ret);
> -		goto err_set_load;
> -	}
> -
>   	return 0;
>   
> -err_set_load:
> -	mipi_dsi_detach(dsi);
>   err_dsi_attach:
>   	drm_panel_remove(&ctx->panel);
>   	return ret;
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
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 b15ca56a09a7..272490b9565b 100644
--- a/drivers/gpu/drm/panel/panel-visionox-rm69299.c
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -197,7 +197,9 @@  static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
 	ctx->dsi = dsi;
 
 	ctx->supplies[0].supply = "vdda";
+	ctx->supplies[0].init_load_uA = 32000;
 	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);
@@ -227,22 +229,8 @@  static int visionox_rm69299_probe(struct mipi_dsi_device *dsi)
 		goto err_dsi_attach;
 	}
 
-	ret = regulator_set_load(ctx->supplies[0].consumer, 32000);
-	if (ret) {
-		dev_err(dev, "regulator set load failed for vdda supply ret = %d\n", ret);
-		goto err_set_load;
-	}
-
-	ret = regulator_set_load(ctx->supplies[1].consumer, 13200);
-	if (ret) {
-		dev_err(dev, "regulator set load failed for vdd3p3 supply ret = %d\n", ret);
-		goto err_set_load;
-	}
-
 	return 0;
 
-err_set_load:
-	mipi_dsi_detach(dsi);
 err_dsi_attach:
 	drm_panel_remove(&ctx->panel);
 	return ret;