Skip to content

Commit 1bef098

Browse files
claudiubezneabebarino
authored andcommitted
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 <[email protected]> Reviewed-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 3bf639a commit 1bef098

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

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

233233
/* Check if bestrate is a valid output rate */
234-
if (bestrate < characteristics->output[0].min &&
234+
if (bestrate < characteristics->output[0].min ||
235235
bestrate > characteristics->output[0].max)
236236
return -ERANGE;
237237

0 commit comments

Comments
 (0)