i2c: uniphier-f: avoid WARN_ON() of clk_disable() in failure path
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 1 Sep 2016 11:46:29 +0000 (20:46 +0900)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 8 Sep 2016 20:41:02 +0000 (22:41 +0200)
commit405188e86a4acb732f94f6d7a00b7fbb89cf5309
treef01feab83fb6f899ff6e28e2a17e9962ab40c682
parent4c91307ce9387519836e17482906ef0f698ea7d9
i2c: uniphier-f: 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-f.c