msm: clock-generic: Handle round rate return values greater than LONG_MAX
The return type of clk_round_rate() is long. So, technically it can return
only rates as large as LONG_MAX (~2.1 GHz). But CPU clocks can already go
past 2.1 GHz and any return value greater than LONG_MAX will appear as a
negative number to the caller.
So, make the clock-generic implementation a bit more selective/intelligent
about treating negative return values from clk_round_rate() as errors. If
the returned negative number is not one of the standard error values
(IS_ERR_VALUE), then treat the negative long number as an unsigned long
rate.
Change-Id: I27383bdb74ed6986667fee681005adec7b16bde9
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
1 file changed