Skip to content

Commit

Permalink
clk: at91: clk-sam9x60-pll: fix return value check
Browse files Browse the repository at this point in the history
[ Upstream commit 1bd8e27 ]

sam9x60_frac_pll_compute_mul_frac() can't return zero. Remove the check
against zero to reflect this.

Fixes: 43b1bb4 ("clk: at91: clk-sam9x60-pll: re-factor to support plls with multiple outputs")
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230227105931.2812412-1-claudiu.beznea@microchip.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
claudiubeznea authored and gregkh committed May 11, 2023
1 parent fa7f2f5 commit 9b4aa8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/at91/clk-sam9x60-pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock,

ret = sam9x60_frac_pll_compute_mul_frac(&frac->core, FCORE_MIN,
parent_rate, true);
if (ret <= 0) {
if (ret < 0) {
hw = ERR_PTR(ret);
goto free;
}
Expand Down

0 comments on commit 9b4aa8a

Please sign in to comment.