i2c: tegra: Move clk_prepare/clk_set_rate to probe
authorMikko Perttunen <mperttunen@nvidia.com>
Fri, 5 Sep 2014 09:28:18 +0000 (12:28 +0300)
committerWolfram Sang <wsa@the-dreams.de>
Sat, 20 Sep 2014 09:15:23 +0000 (11:15 +0200)
commitc9a9ef4170b3db3044504cd5512d0bb19c6f23c7
tree1c462a42a9b1d7d29867c6c94020336f6a640e91
parent9e82bf014195d6f0054982c463575cdce24292be
i2c: tegra: Move clk_prepare/clk_set_rate to probe

Currently the i2c-tegra bus driver prepares, enables
and set_rates its clocks separately for each transfer.
This causes locking problems when doing I2C transfers
from clock notifiers; see
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-July/268653.html

This patch moves clk_prepare/unprepare and clk_set_rate calls to
the probe function, leaving only clk_enable/disable to be
done on each transfer. This solves the locking issue.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-tegra.c