Skip to content

Commit eb16ddb

Browse files
bijudasbebarino
authored andcommitted
clk: versaclock3: Update vc3_get_div() to avoid divide by zero
Update vc3_get_div() to avoid divide by zero operation on vc3_div_round_rate() by returning1, if there is no table match found. Signed-off-by: Biju Das <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent b85ea95 commit eb16ddb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/clk/clk-versaclock3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static unsigned int vc3_get_div(const struct clk_div_table *table,
477477
if (clkt->val == val)
478478
return clkt->div;
479479

480-
return 0;
480+
return 1;
481481
}
482482

483483
static unsigned long vc3_div_recalc_rate(struct clk_hw *hw,

0 commit comments

Comments
 (0)