clk: pistachio: Fix 32bit integer overflows
authorZdenko Pulitika <zdenko.pulitika@imgtec.com>
Wed, 26 Aug 2015 16:11:37 +0000 (17:11 +0100)
committerStephen Boyd <sboyd@codeaurora.org>
Wed, 26 Aug 2015 18:34:28 +0000 (11:34 -0700)
commit093affb009a3d87848e51217cd1a06ce1135633f
tree4cf8b9e4aa9a722ce259d346ac1603155d3c5309
parentc5a132a84a692f8d81f3b6959b98bcd959659457
clk: pistachio: Fix 32bit integer overflows

This commit fixes 32bit integer overflows throughout the pll driver
(i.e. wherever the result of integer multiplication may exceed the
range of u32).

One of the functions affected by this problem is .recalc_rate. It
returns incorrect rate for some pll settings (not for all though)
which in turn results in the incorrect rate setup of pll's child
clocks.

Fixes: 43049b0c83f17("CLK: Pistachio: Add PLL driver")
Cc: <stable@vger.kernel.org> # 4.1
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Signed-off-by: Zdenko Pulitika <zdenko.pulitika@imgtec.com>
Signed-off-by: Govindraj Raja <govindraj.raja@imgtec.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/pistachio/clk-pll.c
drivers/clk/pistachio/clk.h