clk: qcom: lcc-ipq806x: use ARRAY_SIZE for num_parents
authorChristian Marangi <ansuelsmth@gmail.com>
Sun, 24 Jul 2022 18:23:29 +0000 (20:23 +0200)
committerBjorn Andersson <andersson@kernel.org>
Mon, 26 Sep 2022 16:18:56 +0000 (11:18 -0500)
Use ARRAY_SIZE for num_parents instead of raw number to prevent any
confusion/mistake.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220724182329.9891-4-ansuelsmth@gmail.com
drivers/clk/qcom/lcc-ipq806x.c

index 1833e59..81a44a9 100644 (file)
@@ -134,7 +134,7 @@ static struct clk_rcg mi2s_osr_src = {
                .hw.init = &(struct clk_init_data){
                        .name = "mi2s_osr_src",
                        .parent_data = lcc_pxo_pll4,
-                       .num_parents = 2,
+                       .num_parents = ARRAY_SIZE(lcc_pxo_pll4),
                        .ops = &clk_rcg_ops,
                        .flags = CLK_SET_RATE_GATE,
                },
@@ -251,7 +251,7 @@ static struct clk_rcg pcm_src = {
                .hw.init = &(struct clk_init_data){
                        .name = "pcm_src",
                        .parent_data = lcc_pxo_pll4,
-                       .num_parents = 2,
+                       .num_parents = ARRAY_SIZE(lcc_pxo_pll4),
                        .ops = &clk_rcg_ops,
                        .flags = CLK_SET_RATE_GATE,
                },
@@ -335,7 +335,7 @@ static struct clk_rcg spdif_src = {
                .hw.init = &(struct clk_init_data){
                        .name = "spdif_src",
                        .parent_data = lcc_pxo_pll4,
-                       .num_parents = 2,
+                       .num_parents = ARRAY_SIZE(lcc_pxo_pll4),
                        .ops = &clk_rcg_ops,
                        .flags = CLK_SET_RATE_GATE,
                },
@@ -392,7 +392,7 @@ static struct clk_rcg ahbix_clk = {
                .hw.init = &(struct clk_init_data){
                        .name = "ahbix",
                        .parent_data = lcc_pxo_pll4,
-                       .num_parents = 2,
+                       .num_parents = ARRAY_SIZE(lcc_pxo_pll4),
                        .ops = &clk_rcg_lcc_ops,
                },
        },