]> git.karo-electronics.de Git - karo-tx-linux.git/commit
i2c: tegra: check the clk_prepare_enable() return value
authorLaxman Dewangan <ldewangan@nvidia.com>
Fri, 15 Mar 2013 05:34:08 +0000 (05:34 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Mar 2013 19:17:47 +0000 (12:17 -0700)
commit0ff6c945a305b150ed5a88ccc321dcec30712f48
tree3877f968eb2fc36fa73008c70188f52d67af3d86
parent0e7a2fe01333f72c1cec1cd4d5293a62c770fa4f
i2c: tegra: check the clk_prepare_enable() return value

commit 132c803f7b70b17322579f6f4f3f65cf68e55135 upstream.

NVIDIA's Tegra SoC allows read/write of controller register only
if controller clock is enabled. System hangs if read/write happens
to registers without enabling clock.

clk_prepare_enable() can be fail due to unknown reason and hence
adding check for return value of this function. If this function
success then only access register otherwise return to caller with
error.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-tegra.c