drm/panel: ld9040: Add proper definition for prepare and unprepare
authorAjay Kumar <ajaykumar.rs@samsung.com>
Thu, 31 Jul 2014 17:42:08 +0000 (23:12 +0530)
committerThierry Reding <treding@nvidia.com>
Wed, 6 Aug 2014 14:44:12 +0000 (16:44 +0200)
Move out code from enable and disable routines to prepare
and unprepare routines, so that functionality is properly
distributed across all the panel functions.

Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/panel/panel-ld9040.c

index 9b40bd0..c6aa7f7 100644 (file)
@@ -216,6 +216,11 @@ static int ld9040_power_off(struct ld9040 *ctx)
 
 static int ld9040_disable(struct drm_panel *panel)
 {
+       return 0;
+}
+
+static int ld9040_unprepare(struct drm_panel *panel)
+{
        struct ld9040 *ctx = panel_to_ld9040(panel);
 
        msleep(120);
@@ -228,18 +233,8 @@ static int ld9040_disable(struct drm_panel *panel)
        return ld9040_power_off(ctx);
 }
 
-static int ld9040_unprepare(struct drm_panel *panel)
-{
-       return 0;
-}
-
 static int ld9040_prepare(struct drm_panel *panel)
 {
-       return 0;
-}
-
-static int ld9040_enable(struct drm_panel *panel)
-{
        struct ld9040 *ctx = panel_to_ld9040(panel);
        int ret;
 
@@ -252,11 +247,16 @@ static int ld9040_enable(struct drm_panel *panel)
        ret = ld9040_clear_error(ctx);
 
        if (ret < 0)
-               ld9040_disable(panel);
+               ld9040_unprepare(panel);
 
        return ret;
 }
 
+static int ld9040_enable(struct drm_panel *panel)
+{
+       return 0;
+}
+
 static int ld9040_get_modes(struct drm_panel *panel)
 {
        struct drm_connector *connector = panel->connector;