Commit 1bef0986 authored by Claudiu Beznea's avatar Claudiu Beznea Committed by Stephen Boyd

clk: at91: sam9x60-pll: use logical or for range check

Use logical or for range check. In case bestrate is not in
characteristics->output[0].min..characteristics->output[0].max
range we should return -ERANGE.

Fixes: a436c2a4 ("clk: at91: add sam9x60 PLL driver")
Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/1595403506-8209-5-git-send-email-claudiu.beznea@microchip.comSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 3bf639a6
...@@ -231,7 +231,7 @@ static long sam9x60_pll_get_best_div_mul(struct sam9x60_pll *pll, ...@@ -231,7 +231,7 @@ static long sam9x60_pll_get_best_div_mul(struct sam9x60_pll *pll,
} }
/* Check if bestrate is a valid output rate */ /* Check if bestrate is a valid output rate */
if (bestrate < characteristics->output[0].min && if (bestrate < characteristics->output[0].min ||
bestrate > characteristics->output[0].max) bestrate > characteristics->output[0].max)
return -ERANGE; return -ERANGE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment