summaryrefslogtreecommitdiffstats
path: root/drivers/clk/at91
diff options
context:
space:
mode:
authorClaudiu Beznea <claudiu.beznea@microchip.com>2020-07-22 09:38:12 +0200
committerStephen Boyd <sboyd@kernel.org>2020-07-24 11:18:47 +0200
commit1bef0986b125942d65d39c10cbfa75b20c3b94b3 (patch)
tree2bb93247ca03b7e01038f40c9ff00f500d601268 /drivers/clk/at91
parentclk: at91: clk-sam9x60-pll: fix mul mask (diff)
downloadlinux-1bef0986b125942d65d39c10cbfa75b20c3b94b3.tar.xz
linux-1bef0986b125942d65d39c10cbfa75b20c3b94b3.zip
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: a436c2a447e59 ("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>
Diffstat (limited to 'drivers/clk/at91')
-rw-r--r--drivers/clk/at91/clk-sam9x60-pll.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/at91/clk-sam9x60-pll.c b/drivers/clk/at91/clk-sam9x60-pll.c
index 3522eae2edd6..4b7b6c435d4e 100644
--- a/drivers/clk/at91/clk-sam9x60-pll.c
+++ b/drivers/clk/at91/clk-sam9x60-pll.c
@@ -231,7 +231,7 @@ static long sam9x60_pll_get_best_div_mul(struct sam9x60_pll *pll,
}
/* 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)
return -ERANGE;