From: Philippe Begnic Date: Wed, 10 Oct 2012 11:02:26 +0000 (+0200) Subject: i2c-nomadik: Fixup clock handling X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=817315f57408b1a9c78cbc7ff2bf186da45ddcc1;p=openwrt%2Fstaging%2Fblogic.git i2c-nomadik: Fixup clock handling Make sure to clk_prepare as well as clk_enable. Signed-off-by: Philippe Begnic Signed-off-by: Ulf Hansson Signed-off-by: Linus Walleij Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 698d7acb0f08..02c3115a2dfa 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -644,7 +644,11 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap, pm_runtime_get_sync(&dev->adev->dev); - clk_enable(dev->clk); + status = clk_prepare_enable(dev->clk); + if (status) { + dev_err(&dev->adev->dev, "can't prepare_enable clock\n"); + goto out_clk; + } status = init_hw(dev); if (status) @@ -671,7 +675,8 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap, } out: - clk_disable(dev->clk); + clk_disable_unprepare(dev->clk); +out_clk: pm_runtime_put_sync(&dev->adev->dev); dev->busy = false;