Skip to content

Commit

Permalink
i2c-nomadik: Fixup clock handling
Browse files Browse the repository at this point in the history
Make sure to clk_prepare as well as clk_enable.

Signed-off-by: Philippe Begnic <philippe.begnic@stericsson.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
  • Loading branch information
Philippe Begnic authored and Wolfram Sang committed Nov 2, 2012
1 parent 82fa63b commit 817315f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/i2c/busses/i2c-nomadik.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand Down

0 comments on commit 817315f

Please sign in to comment.