[COMMON] i2c: exynos5: removed clk_unprepare during suspend
authorJung-Ick Guack <ji.guack@samsung.com>
Fri, 1 Jul 2016 07:40:50 +0000 (16:40 +0900)
committermyung-su.cha <myung-su.cha@samsung.com>
Wed, 9 May 2018 12:14:45 +0000 (21:14 +0900)
Fixed warning case during suspend.
There is the case that is calling clk_unprepare
even not called clk_disable during suspend_noirq.

flow of warning case:
exynos5_i2c_runtime_resume    (clk_enable)
-> exynos5_i2c_suspend_noirq  (clk_unprepare)
-> exynos5_i2c_runtime_suspend(clk_disable)

Change-Id: I482c924a2440caa5407e4b6682b1f4fc10648dc5
Signed-off-by: Jung-Ick Guack <ji.guack@samsung.com>
drivers/i2c/busses/i2c-exynos5.c

index 6c9e4311caa8864bdad5a43e2ca62e3c50b7cbaf..9e07d783a258da40ad69e281111a5b51cde7c70e 100644 (file)
@@ -1126,7 +1126,6 @@ static int exynos5_i2c_suspend_noirq(struct device *dev)
 
        i2c_lock_adapter(&i2c->adap);
        i2c->suspended = 1;
-       clk_unprepare(i2c->clk);
        i2c_unlock_adapter(&i2c->adap);
 
        return 0;
@@ -1140,9 +1139,10 @@ static int exynos5_i2c_resume_noirq(struct device *dev)
 
        i2c_lock_adapter(&i2c->adap);
        exynos_update_ip_idle_status(i2c->idle_ip_index, 0);
-       ret = clk_prepare_enable(i2c->clk);
+       ret = clk_enable(i2c->clk);
        if (ret) {
                exynos_update_ip_idle_status(i2c->idle_ip_index, 1);
+               i2c_unlock_adapter(&i2c->adap);
                return ret;
        }
        exynos5_i2c_reset(i2c);