From: Wei Yongjun Date: Mon, 11 Nov 2013 14:23:50 +0000 (+0800) Subject: i2c: wmt: add missing clk_disable_unprepare() on error X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2dc9688a106886db7191d30f30ffd61fde827efd;p=linux-beck.git i2c: wmt: add missing clk_disable_unprepare() on error Add the missing clk_disable_unprepare() before return from wmt_i2c_reset_hardware() in the error handling case. Signed-off-by: Wei Yongjun Signed-off-by: Wolfram Sang Cc: stable@kernel.org # 3.11+ --- diff --git a/drivers/i2c/busses/i2c-wmt.c b/drivers/i2c/busses/i2c-wmt.c index c65da3d913a0..4bf9507cd1a1 100644 --- a/drivers/i2c/busses/i2c-wmt.c +++ b/drivers/i2c/busses/i2c-wmt.c @@ -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; }