Skip to content

Commit 6c66eba

Browse files
committed
drm/panel: ilitek-ili9881c: turn off power-supply when init fails
The prepare function turns on the power-supply regulator first, when preparing the display. But in an error case, just returns the error code, but does not power off the regulator again, fix that. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20250707164906.1445288-2-heiko@sntech.de
1 parent 73b81fc commit 6c66eba

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

drivers/gpu/drm/panel/panel-ilitek-ili9881c.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,7 @@ static int ili9881c_prepare(struct drm_panel *panel)
14861486
instr->arg.cmd.data);
14871487

14881488
if (ret)
1489-
return ret;
1489+
goto disable_power;
14901490
}
14911491

14921492
ret = ili9881c_switch_page(ctx, 0);
@@ -1498,18 +1498,22 @@ static int ili9881c_prepare(struct drm_panel *panel)
14981498
&ctx->address_mode,
14991499
sizeof(ctx->address_mode));
15001500
if (ret < 0)
1501-
return ret;
1501+
goto disable_power;
15021502
}
15031503

15041504
ret = mipi_dsi_dcs_set_tear_on(ctx->dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
15051505
if (ret)
1506-
return ret;
1506+
goto disable_power;
15071507

15081508
ret = mipi_dsi_dcs_exit_sleep_mode(ctx->dsi);
15091509
if (ret)
1510-
return ret;
1510+
goto disable_power;
15111511

15121512
return 0;
1513+
1514+
disable_power:
1515+
regulator_disable(ctx->power);
1516+
return ret;
15131517
}
15141518

15151519
static int ili9881c_enable(struct drm_panel *panel)

0 commit comments

Comments
 (0)