ARM: tegra: clock: Fix round rate error checking
authorAlex Frid <afrid@nvidia.com>
Sun, 10 Mar 2013 07:53:31 +0000 (23:53 -0800)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 20:02:17 +0000 (13:02 -0700)
commited37e65eda8e2c5b7c1c757ee935b9ccffff9baf
treedb4f3d5b55e6af393b076dd6fff4b8ec7457d8a3
parent6776e02ab99bac6aaf848a1e6d0f2c7bb36d0270
ARM: tegra: clock: Fix round rate error checking

Some callers of clk_round_rate() API assume that return signed value
is negative in case of error, and positive if API succeeded. The latter
is not true when the clock rate crosses ~2.1 GHz (2,147,483,647 Hz)
boundary on 32-bit machine. To prevent false bailing out on 2.1GHz and
above rates callers of round rate API should cast the rounded rate as
unsigned, and use IS_ERR_VALUE() macro to detect errors instead of
checking sign of the returned value.

This commit fixed round rate error checking for callers in mach-tegra
directory.

Change-Id: Ic1d09f8ba9aa6f95132b63ad15760270c44e9814
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/207912
Reviewed-by: Harshada Kale <hkale@nvidia.com>
Tested-by: Harshada Kale <hkale@nvidia.com>
arch/arm/mach-tegra/clock.c
arch/arm/mach-tegra/tegra11_clocks.c
arch/arm/mach-tegra/tegra14_clocks.c