i2c: uniphier: avoid WARN_ON() of clk_disable() in failure path
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 1 Sep 2016 11:46:28 +0000 (20:46 +0900)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 8 Sep 2016 20:40:32 +0000 (22:40 +0200)
commit4c91307ce9387519836e17482906ef0f698ea7d9
tree059b502e466ff8e50b5142bc349365bf73b17997
parentfbf8090b723d4df3cfe18c9491a8bc21ec15a5c0
i2c: uniphier: avoid WARN_ON() of clk_disable() in failure path

If clk_prepare_enable() fails, clk_disable_unprepare() is called in
the failure path, where the enable_count is still zero, so it hits
WARN_ON(core->enable_count == 0) in the clk_core_disable().

To fix this, make the clock setting more linear in the probe function
so that it can exploit "goto err" in case of error.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-uniphier.c