clk: loongson1: Terminate clk_div_table with sentinel element
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Fri, 18 Feb 2022 00:09:18 +0000 (01:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:08:20 +0000 (09:08 +0200)
[ Upstream commit 3eb00f89162e80083dfcaa842468b510462cfeaa ]

In order that the end of a clk_div_table can be detected, it must be
terminated with a sentinel element (.div = 0).

Fixes: b4626a7f4892 ("CLK: Add Loongson1C clock support")
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Link: https://lore.kernel.org/r/20220218000922.134857-3-j.neuschaefer@gmx.net
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/loongson1/clk-loongson1c.c

index 3466f7320b40be2494190ab5a0d5c3200c1d32e3..e3aa502761a318c6ed1c7932b82b624c7fc4eec9 100644 (file)
@@ -40,6 +40,7 @@ static const struct clk_div_table ahb_div_table[] = {
        [1] = { .val = 1, .div = 4 },
        [2] = { .val = 2, .div = 3 },
        [3] = { .val = 3, .div = 3 },
+       [4] = { /* sentinel */ }
 };
 
 void __init ls1x_clk_init(void)