diff options
Diffstat (limited to 'drivers/clk/mvebu/clk-core.c')
-rw-r--r-- | drivers/clk/mvebu/clk-core.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/clk/mvebu/clk-core.c b/drivers/clk/mvebu/clk-core.c index 69056a7479e..0a53edbae8b 100644 --- a/drivers/clk/mvebu/clk-core.c +++ b/drivers/clk/mvebu/clk-core.c @@ -156,8 +156,8 @@ static u32 __init armada_370_get_cpu_freq(void __iomem *sar) cpu_freq_select = ((readl(sar) >> SARL_A370_PCLK_FREQ_OPT) & SARL_A370_PCLK_FREQ_OPT_MASK); - if (cpu_freq_select > ARRAY_SIZE(armada_370_cpu_frequencies)) { - pr_err("CPU freq select unsuported %d\n", cpu_freq_select); + if (cpu_freq_select >= ARRAY_SIZE(armada_370_cpu_frequencies)) { + pr_err("CPU freq select unsupported %d\n", cpu_freq_select); cpu_freq = 0; } else cpu_freq = armada_370_cpu_frequencies[cpu_freq_select]; @@ -278,8 +278,8 @@ static u32 __init armada_xp_get_cpu_freq(void __iomem *sar) cpu_freq_select |= (((readl(sar+4) >> SARH_AXP_PCLK_FREQ_OPT) & SARH_AXP_PCLK_FREQ_OPT_MASK) << SARH_AXP_PCLK_FREQ_OPT_SHIFT); - if (cpu_freq_select > ARRAY_SIZE(armada_xp_cpu_frequencies)) { - pr_err("CPU freq select unsuported: %d\n", cpu_freq_select); + if (cpu_freq_select >= ARRAY_SIZE(armada_xp_cpu_frequencies)) { + pr_err("CPU freq select unsupported: %d\n", cpu_freq_select); cpu_freq = 0; } else cpu_freq = armada_xp_cpu_frequencies[cpu_freq_select]; |