media: rcar_jpu: Add missing clk_disable_unprepare() on error in jpu_open()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tue, 12 Jul 2016 11:21:46 +0000 (07:21 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 11 May 2018 15:23:54 +0000 (11:23 -0400)
Add the missing clk_disable_unprepare() before return from
jpu_open() in the software reset error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/rcar_jpu.c

index f6092ae459129478aebb628f39685d9d35669532..8b44a849ab4189b6da29511f0c7f98b6cfc26747 100644 (file)
@@ -1280,7 +1280,7 @@ static int jpu_open(struct file *file)
                /* ...issue software reset */
                ret = jpu_reset(jpu);
                if (ret)
-                       goto device_prepare_rollback;
+                       goto jpu_reset_rollback;
        }
 
        jpu->ref_count++;
@@ -1288,6 +1288,8 @@ static int jpu_open(struct file *file)
        mutex_unlock(&jpu->mutex);
        return 0;
 
+jpu_reset_rollback:
+       clk_disable_unprepare(jpu->clk);
 device_prepare_rollback:
        mutex_unlock(&jpu->mutex);
 v4l_prepare_rollback: