Skip to content

Commit

Permalink
clk: socfpga: stratix10: fix rate caclulationg for cnt_clks
Browse files Browse the repository at this point in the history
Checking bypass_reg is incorrect for calculating the cnt_clk rates.
Instead we should be checking that there is a proper hardware register
that holds the clock divider.

Cc: stable@vger.kernel.org
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Link: https://lkml.kernel.org/r/20190814153014.12962-1-dinguyen@kernel.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
Dinh Nguyen authored and Stephen Boyd committed Aug 14, 2019
1 parent baf7b79 commit c7ec75e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/socfpga/clk-periph-s10.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static unsigned long clk_peri_cnt_clk_recalc_rate(struct clk_hw *hwclk,
if (socfpgaclk->fixed_div) {
div = socfpgaclk->fixed_div;
} else {
if (!socfpgaclk->bypass_reg)
if (socfpgaclk->hw.reg)
div = ((readl(socfpgaclk->hw.reg) & 0x7ff) + 1);
}

Expand Down

0 comments on commit c7ec75e

Please sign in to comment.