]> git.baikalelectronics.ru Git - kernel.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)
committerWolfram Sang <wsa@the-dreams.de>
Fri, 22 Mar 2013 09:28:55 +0000 (10:28 +0100)
commite032eab645268614c4fc9771039819e2200c6608
treebb819b313733035c821a9984ded83e3dc2a1f6d8
parent3829be578a2ef96ca061ccf37a65232d261a8e76
i2c: tegra: check the clk_prepare_enable() return value

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>
Cc: stable@kernel.org
drivers/i2c/busses/i2c-tegra.c