]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
clk: at91: fix at91sam9x5 peripheral clock number
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 19 Feb 2019 16:51:14 +0000 (17:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:09:54 +0000 (10:09 +0100)
commit 1b328a2e095a009518ebac05e937cc0fc242fede upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/at91/at91sam9x5.c

index d55a151cb7f57a38cbaf522aa1822dbe44c2fd2a..3487e03d4bc61c277fe8f44faeececa326e21876 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;