Skip to content

Commit

Permalink
drm/panel: novatek-nt36672a: stop calling regulator_set_load manually
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240404-drop-panel-unregister-v1-5-9f56953c5fb9@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240404-drop-panel-unregister-v1-5-9f56953c5fb9@linaro.org
  • Loading branch information
Dmitry Baryshkov authored and Neil Armstrong committed Apr 24, 2024
1 parent 9dab1af commit a8ee5f5
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions drivers/gpu/drm/panel/panel-novatek-nt36672a.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,21 +605,16 @@ static int nt36672a_panel_add(struct nt36672a_panel *pinfo)
struct device *dev = &pinfo->link->dev;
int i, ret;

for (i = 0; i < ARRAY_SIZE(pinfo->supplies); i++)
for (i = 0; i < ARRAY_SIZE(pinfo->supplies); i++) {
pinfo->supplies[i].supply = nt36672a_regulator_names[i];
pinfo->supplies[i].init_load_uA = nt36672a_regulator_enable_loads[i];
}

ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(pinfo->supplies),
pinfo->supplies);
if (ret < 0)
return dev_err_probe(dev, ret, "failed to get regulators\n");

for (i = 0; i < ARRAY_SIZE(pinfo->supplies); i++) {
ret = regulator_set_load(pinfo->supplies[i].consumer,
nt36672a_regulator_enable_loads[i]);
if (ret)
return dev_err_probe(dev, ret, "failed to set regulator enable loads\n");
}

pinfo->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(pinfo->reset_gpio))
return dev_err_probe(dev, PTR_ERR(pinfo->reset_gpio),
Expand Down

0 comments on commit a8ee5f5

Please sign in to comment.