drm/exynos: add error messages if clks failed to get enabled
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>
Wed, 3 Jun 2015 20:17:16 +0000 (17:17 -0300)
committerInki Dae <daeinki@gmail.com>
Fri, 19 Jun 2015 15:32:54 +0000 (00:32 +0900)
Check error and call DRM_ERROR if clk_prepare_enable() fails.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos7_drm_decon.c
drivers/gpu/drm/exynos/exynos_drm_fimd.c
drivers/gpu/drm/exynos/exynos_mixer.c

index d659ba24c8c2aab3cfc773d402ca80b3d6aa2beb..d9798e2aedda5b16941b31ca73106e4bb0d8f852 100644 (file)
@@ -606,6 +606,7 @@ static void decon_init(struct decon_context *ctx)
 static void decon_enable(struct exynos_drm_crtc *crtc)
 {
        struct decon_context *ctx = crtc->ctx;
+       int ret;
 
        if (!ctx->suspended)
                return;
@@ -614,10 +615,29 @@ static void decon_enable(struct exynos_drm_crtc *crtc)
 
        pm_runtime_get_sync(ctx->dev);
 
-       clk_prepare_enable(ctx->pclk);
-       clk_prepare_enable(ctx->aclk);
-       clk_prepare_enable(ctx->eclk);
-       clk_prepare_enable(ctx->vclk);
+       ret = clk_prepare_enable(ctx->pclk);
+       if (ret < 0) {
+               DRM_ERROR("Failed to prepare_enable the pclk [%d]\n", ret);
+               return;
+       }
+
+       ret = clk_prepare_enable(ctx->aclk);
+       if (ret < 0) {
+               DRM_ERROR("Failed to prepare_enable the aclk [%d]\n", ret);
+               return;
+       }
+
+       ret = clk_prepare_enable(ctx->eclk);
+       if  (ret < 0) {
+               DRM_ERROR("Failed to prepare_enable the eclk [%d]\n", ret);
+               return;
+       }
+
+       ret = clk_prepare_enable(ctx->vclk);
+       if  (ret < 0) {
+               DRM_ERROR("Failed to prepare_enable the vclk [%d]\n", ret);
+               return;
+       }
 
        decon_init(ctx);
 
index 96618534358e1e1772bb69d80a2866a9969acc3d..7c8ba614cd44176d1a8dd7c10bb5b2da4638b975 100644 (file)
@@ -808,6 +808,7 @@ static void fimd_apply(struct fimd_context *ctx)
 static void fimd_enable(struct exynos_drm_crtc *crtc)
 {
        struct fimd_context *ctx = crtc->ctx;
+       int ret;
 
        if (!ctx->suspended)
                return;
@@ -816,8 +817,17 @@ static void fimd_enable(struct exynos_drm_crtc *crtc)
 
        pm_runtime_get_sync(ctx->dev);
 
-       clk_prepare_enable(ctx->bus_clk);
-       clk_prepare_enable(ctx->lcd_clk);
+       ret = clk_prepare_enable(ctx->bus_clk);
+       if (ret < 0) {
+               DRM_ERROR("Failed to prepare_enable the bus clk [%d]\n", ret);
+               return;
+       }
+
+       ret = clk_prepare_enable(ctx->lcd_clk);
+       if  (ret < 0) {
+               DRM_ERROR("Failed to prepare_enable the lcd clk [%d]\n", ret);
+               return;
+       }
 
        /* if vblank was enabled status, enable it again. */
        if (test_and_clear_bit(0, &ctx->irq_flags))
index 6bab71704bab4179b3f5d741b8b395abc3bc388b..1b77fc766051229977d72f4769b12e5855c1858c 100644 (file)
@@ -1031,6 +1031,7 @@ static void mixer_enable(struct exynos_drm_crtc *crtc)
 {
        struct mixer_context *ctx = crtc->ctx;
        struct mixer_resources *res = &ctx->mixer_res;
+       int ret;
 
        mutex_lock(&ctx->mixer_mutex);
        if (ctx->powered) {
@@ -1042,12 +1043,32 @@ static void mixer_enable(struct exynos_drm_crtc *crtc)
 
        pm_runtime_get_sync(ctx->dev);
 
-       clk_prepare_enable(res->mixer);
-       clk_prepare_enable(res->hdmi);
+       ret = clk_prepare_enable(res->mixer);
+       if (ret < 0) {
+               DRM_ERROR("Failed to prepare_enable the mixer clk [%d]\n", ret);
+               return;
+       }
+       ret = clk_prepare_enable(res->hdmi);
+       if (ret < 0) {
+               DRM_ERROR("Failed to prepare_enable the hdmi clk [%d]\n", ret);
+               return;
+       }
        if (ctx->vp_enabled) {
-               clk_prepare_enable(res->vp);
-               if (ctx->has_sclk)
-                       clk_prepare_enable(res->sclk_mixer);
+               ret = clk_prepare_enable(res->vp);
+               if (ret < 0) {
+                       DRM_ERROR("Failed to prepare_enable the vp clk [%d]\n",
+                                 ret);
+                       return;
+               }
+               if (ctx->has_sclk) {
+                       ret = clk_prepare_enable(res->sclk_mixer);
+                       if (ret < 0) {
+                               DRM_ERROR("Failed to prepare_enable the " \
+                                          "sclk_mixer clk [%d]\n",
+                                         ret);
+                               return;
+                       }
+               }
        }
 
        mutex_lock(&ctx->mixer_mutex);