clk: at91: fix at91sam9x5 peripheral clock number
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 19 Feb 2019 16:51:14 +0000 (17:51 +0100)
committerStephen Boyd <sboyd@kernel.org>
Wed, 20 Feb 2019 19:34:24 +0000 (11:34 -0800)
nck() looks at the last id in an array and unfortunately,
at91sam9x35_periphck has a sentinel, hence the id is 0 and the calculated
number of peripheral clocks is 1 instead of a maximum of 31.

Fixes: 1eabdc2f9dd8 ("clk: at91: add at91sam9x5 PMCs driver")
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: <stable@vger.kernel.org> # v4.20+
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/at91/at91sam9x5.c

index 2fe225a697df8be805ce90e739f2e85208bf071e..d37e7ed9eb906817eb86c39204f52bde94d62940 100644 (file)
@@ -144,8 +144,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
                return;
 
        at91sam9x5_pmc = pmc_data_allocate(PMC_MAIN + 1,
-                                          nck(at91sam9x5_systemck),
-                                          nck(at91sam9x35_periphck), 0);
+                                          nck(at91sam9x5_systemck), 31, 0);
        if (!at91sam9x5_pmc)
                return;