From: Andrzej Hajda Date: Fri, 8 Jul 2016 11:01:01 +0000 (+0200) Subject: drm/panel/s6e3ha2: simplify panel unprepare X-Git-Tag: accepted/tizen/common/20160810.161706~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=81bbe2ef5bbf8ca5308a3f9b1cb0ba19348b28bb;p=platform%2Fkernel%2Flinux-exynos.git 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 --- diff --git a/drivers/gpu/drm/panel/panel-s6e3ha2.c b/drivers/gpu/drm/panel/panel-s6e3ha2.c index 95d7652..03186e6 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)