drm/panel/s6e3ha2: simplify panel unprepare
authorAndrzej Hajda <a.hajda@samsung.com>
Fri, 8 Jul 2016 11:01:01 +0000 (13:01 +0200)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:52:12 +0000 (13:52 +0900)
Special helper should be used instead of directly checking ctx->error.

Change-Id: If472a2771691df95244bd5f2c41fa98b7013fee5
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
drivers/gpu/drm/panel/panel-s6e3ha2.c

index 95d7652..03186e6 100644 (file)
@@ -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)