From 81bbe2ef5bbf8ca5308a3f9b1cb0ba19348b28bb Mon Sep 17 00:00:00 2001 From: Andrzej Hajda Date: Fri, 8 Jul 2016 13:01:01 +0200 Subject: [PATCH] drm/panel/s6e3ha2: simplify panel unprepare Special helper should be used instead of directly checking ctx->error. Change-Id: If472a2771691df95244bd5f2c41fa98b7013fee5 Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/panel/panel-s6e3ha2.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-s6e3ha2.c b/drivers/gpu/drm/panel/panel-s6e3ha2.c index 95d76525a055..03186e61b161 100644 --- a/drivers/gpu/drm/panel/panel-s6e3ha2.c +++ b/drivers/gpu/drm/panel/panel-s6e3ha2.c @@ -623,6 +623,7 @@ err: static int s6e3ha2_unprepare(struct drm_panel *panel) { struct s6e3ha2 *ctx = panel_to_s6e3ha2(panel); + int ret; /* * This function is called by mipi dsi driver @@ -635,17 +636,13 @@ static int s6e3ha2_unprepare(struct drm_panel *panel) } s6e3ha2_power_off(ctx); - if (ctx->error != 0) { - mutex_unlock(&ctx->lock); - return ctx->error; - } - - s6e3ha2_clear_error(ctx); - ctx->bl_dev->props.power = FB_BLANK_POWERDOWN; + ret = s6e3ha2_clear_error(ctx); + if (!ret) + ctx->bl_dev->props.power = FB_BLANK_POWERDOWN; mutex_unlock(&ctx->lock); - return 0; + return ret; } static int s6e3ha2_power_on(struct s6e3ha2 *ctx) -- 2.34.1