]> git.baikalelectronics.ru Git - kernel.git/commit
clk: ti: dflt: fix enable_reg validity check
authorSuman Anna <s-anna@ti.com>
Tue, 29 Sep 2015 22:37:47 +0000 (17:37 -0500)
committerTero Kristo <t-kristo@ti.com>
Fri, 2 Oct 2015 06:24:28 +0000 (09:24 +0300)
commit9410c709f2aaa4938798c9bf945c557053c1de4e
tree194b532ee37040c8a2372be24b9d02d072f63675
parent705133d8cf5cc78a0a28783ea2825ee97bf61ced
clk: ti: dflt: fix enable_reg validity check

The default clock enabling functions for TI clocks -
omap2_dflt_clk_enable() and omap2_dflt_clk_disable() perform a
NULL check for the enable_reg field of the clk_hw_omap structure.
This enable_reg field however is merely a combination of the index
of the master IP module, and the offset from the master IP module's
base address. A value of 0 is perfectly valid, and the current error
checking will fail in these cases. The issue was found when trying
to enable the iva2_ck clock on OMAP3 platforms.

So, switch the check to use IS_ERR. This correction is similar to the
logic used in commit cf23bd36de22 ("clk: ti: fix ti_clk_get_reg_addr
error handling").

Fixes: 8999a41a3647 ("clk: ti: dflt: move support for default gate clock..")
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
drivers/clk/ti/clkt_dflt.c