Skip to content

Commit

Permalink
i2c: wmt: add missing clk_disable_unprepare() on error
Browse files Browse the repository at this point in the history
Add the missing clk_disable_unprepare() before return
from wmt_i2c_reset_hardware() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org # 3.11+
  • Loading branch information
Wei Yongjun authored and Wolfram Sang committed Nov 14, 2013
1 parent 25b3dfc commit 2dc9688
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/i2c/busses/i2c-wmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ static int wmt_i2c_reset_hardware(struct wmt_i2c_dev *i2c_dev)
err = clk_set_rate(i2c_dev->clk, 20000000);
if (err) {
dev_err(i2c_dev->dev, "failed to set clock = 20Mhz\n");
clk_disable_unprepare(i2c_dev->clk);
return err;
}

Expand Down

0 comments on commit 2dc9688

Please sign in to comment.