Commit cc2db2ef authored by Douglas Anderson's avatar Douglas Anderson Committed by Neil Armstrong

drm/panel: himax-hx8394: Handle errors from mipi_dsi_dcs_set_display_on() better

If mipi_dsi_dcs_set_display_on() returned an error then we'd store
that in the "ret" variable and jump to error handling. We'd then
attempt an orderly poweroff. Unfortunately we then blew away the value
stored in "ret". That means that if the orderly poweroff actually
worked then we're return 0 (no error) from hx8394_enable() even though
the panel wasn't enabled.

Fix this by not blowing away "ret".

Found by code inspection.

Fixes: 65dc9360 ("drm: panel: Add Himax HX8394 panel controller driver")
Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240517143643.1.I0a6836fffd8d7620f353becb3df2370d2898f803@changeidSigned-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240517143643.1.I0a6836fffd8d7620f353becb3df2370d2898f803@changeid
parent b593ea94
...@@ -370,8 +370,7 @@ static int hx8394_enable(struct drm_panel *panel) ...@@ -370,8 +370,7 @@ static int hx8394_enable(struct drm_panel *panel)
sleep_in: sleep_in:
/* This will probably fail, but let's try orderly power off anyway. */ /* This will probably fail, but let's try orderly power off anyway. */
ret = mipi_dsi_dcs_enter_sleep_mode(dsi); if (!mipi_dsi_dcs_enter_sleep_mode(dsi))
if (!ret)
msleep(50); msleep(50);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment