From: Heiko Stuebner Date: Mon, 7 Jul 2025 16:48:54 +0000 (+0200) Subject: drm/panel: ilitek-ili9881c: turn off power-supply when init fails X-Git-Tag: v6.17.8~506 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7b7dbcb98c856b66a3ae733574f7f9cdc1722ad;p=thirdparty%2Fkernel%2Fstable.git drm/panel: ilitek-ili9881c: turn off power-supply when init fails [ Upstream commit 6c66eba502709a78281333187c1add7b71f7201f ] 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 Signed-off-by: Heiko Stuebner Link: https://lore.kernel.org/r/20250707164906.1445288-2-heiko@sntech.de Signed-off-by: Sasha Levin --- diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index ac433345a1794..3af22a5f5700c 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -1486,7 +1486,7 @@ static int ili9881c_prepare(struct drm_panel *panel) instr->arg.cmd.data); if (ret) - return ret; + goto disable_power; } ret = ili9881c_switch_page(ctx, 0); @@ -1498,18 +1498,22 @@ static int ili9881c_prepare(struct drm_panel *panel) &ctx->address_mode, sizeof(ctx->address_mode)); if (ret < 0) - return ret; + goto disable_power; } ret = mipi_dsi_dcs_set_tear_on(ctx->dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK); if (ret) - return ret; + goto disable_power; ret = mipi_dsi_dcs_exit_sleep_mode(ctx->dsi); if (ret) - return ret; + goto disable_power; return 0; + +disable_power: + regulator_disable(ctx->power); + return ret; } static int ili9881c_enable(struct drm_panel *panel)