Skip to content

Commit 51c7917

Browse files
committed
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: a436c2a ("clk: at91: add sam9x60 PLL driver") Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/1595403506-8209-5-git-send-email-claudiu.beznea@microchip.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 08b8ccd commit 51c7917

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/clk/at91/clk-sam9x60-pll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static long sam9x60_pll_get_best_div_mul(struct sam9x60_pll *pll,
250250
}
251251

252252
/* Check if bestrate is a valid output rate */
253-
if (bestrate < characteristics->output[0].min &&
253+
if (bestrate < characteristics->output[0].min ||
254254
bestrate > characteristics->output[0].max)
255255
return -ERANGE;
256256

0 commit comments

Comments
 (0)