Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: ti: dpll: change error return from ~0 to -EINVAL

When the requested rate cannot be achieved, omap2_dpll_round_rate()
will return ~0. Let's change this to -EINVAL to make the code a little
cleaner to read. This is no functional change.

Tested-by: Anddreas Kemnade <andreas@kemnade.info> # OMAP3 GTA04, OMAP4 Panda
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Tested-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>

+4 -4
+4 -4
drivers/clk/ti/clkt_dpll.c
··· 277 277 * possible, programmable rate for this DPLL. Attempts to select the 278 278 * minimum possible n. Stores the computed (m, n) in the DPLL's 279 279 * dpll_data structure so set_rate() will not need to call this 280 - * (expensive) function again. Returns ~0 if the target rate cannot 281 - * be rounded, or the rounded rate upon success. 280 + * (expensive) function again. Returns -EINVAL if the target rate 281 + * cannot be rounded, or the rounded rate upon success. 282 282 */ 283 283 long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate, 284 284 unsigned long *parent_rate) ··· 295 295 const char *clk_name; 296 296 297 297 if (!clk || !clk->dpll_data) 298 - return ~0; 298 + return -EINVAL; 299 299 300 300 dd = clk->dpll_data; 301 301 ··· 360 360 if (prev_min_delta == LONG_MAX) { 361 361 pr_debug("clock: %s: cannot round to rate %lu\n", 362 362 clk_name, target_rate); 363 - return ~0; 363 + return -EINVAL; 364 364 } 365 365 366 366 dd->last_rounded_m = min_delta_m;