From: Sachin Kamat Date: Wed, 6 Nov 2013 09:39:18 +0000 (+0530) Subject: i2c: exynos5: Remove incorrect clk_disable_unprepare X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3cd0c2dfb482c90dd0547ec492c32adeb31e2bd5;p=linux-beck.git i2c: exynos5: Remove incorrect clk_disable_unprepare clk_disable_unprepare in remove causes an imbalance and hence gives the below crash on module remove. While at it also remove some duplicate code from probe. / $ rmmod i2c-exynos5 [ 6.996374] ------------[ cut here ]------------ [ 6.999523] WARNING: CPU: 2 PID: 1137 at drivers/clk/clk.c:842 clk_disable+0x18/0x24() [ 7.007403] Modules linked in: i2c_exynos5(-) [ 7.011747] CPU: 2 PID: 1137 Comm: rmmod Not tainted 3.12.0-next-20131105-00083-g16f4799-dirty #21 [ 7.020696] [] (unwind_backtrace+0x0/0xf4) from [] (show_stack+0x10/0x14) [ 7.029190] [] (show_stack+0x10/0x14) from [] (dump_stack+0x7c/0xb0) [ 7.037255] [] (dump_stack+0x7c/0xb0) from [] (warn_slowpath_common+0x6c/0x88) [ 7.046190] [] (warn_slowpath_common+0x6c/0x88) from [] (warn_slowpath_null+0x1c/0x24) [ 7.055818] [] (warn_slowpath_null+0x1c/0x24) from [] (clk_disable+0x18/0x24) [ 7.064670] [] (clk_disable+0x18/0x24) from [] (exynos5_i2c_remove+0x1c/0x34 [i2c_exynos5]) [ 7.074736] [] (exynos5_i2c_remove+0x1c/0x34 [i2c_exynos5]) from [] (__device_release_driver+0x58/0xb0) [ 7.085836] [] (__device_release_driver+0x58/0xb0) from [] (driver_detach+0xac/0xb0) [ 7.095291] [] (driver_detach+0xac/0xb0) from [] (bus_remove_driver+0x4c/0xa0) [ 7.104227] [] (bus_remove_driver+0x4c/0xa0) from [] (SyS_delete_module+0x124/0x194) [ 7.113682] [] (SyS_delete_module+0x124/0x194) from [] (ret_fast_syscall+0x0/0x30) [ 7.122957] ---[ end trace 23bb6e4e0bf52196 ]--- Signed-off-by: Sachin Kamat Acked-by: Naveen Krishna Chatradhi Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index aca3991b7636..da39ff0deab5 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -702,10 +702,6 @@ static int exynos5_i2c_probe(struct platform_device *pdev) platform_set_drvdata(pdev, i2c); - clk_disable_unprepare(i2c->clk); - - return 0; - err_clk: clk_disable_unprepare(i2c->clk); return ret; @@ -716,7 +712,6 @@ static int exynos5_i2c_remove(struct platform_device *pdev) struct exynos5_i2c *i2c = platform_get_drvdata(pdev); i2c_del_adapter(&i2c->adap); - clk_disable_unprepare(i2c->clk); return 0; }