Skip to content

Commit 016018b

Browse files
masneybgregkh
authored andcommitted
rtc: nct3018y: fix incorrect maximum clock rate handling
[ Upstream commit 437c59e ] When nct3018y_clkout_round_rate() is called with a requested rate higher than the highest supported rate, it currently returns 0, which disables the clock. According to the clk API, round_rate() should instead return the highest supported rate. Update the function to return the maximum supported rate in this case. Fixes: 5adbaed ("rtc: Add NCT3018Y real time clock driver") Signed-off-by: Brian Masney <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 81d18fd commit 016018b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/rtc/rtc-nct3018y.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static long nct3018y_clkout_round_rate(struct clk_hw *hw, unsigned long rate,
376376
if (clkout_rates[i] <= rate)
377377
return clkout_rates[i];
378378

379-
return 0;
379+
return clkout_rates[0];
380380
}
381381

382382
static int nct3018y_clkout_set_rate(struct clk_hw *hw, unsigned long rate,

0 commit comments

Comments
 (0)