Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: qcom: gpucc-msm8998: Use ARRAY_SIZE for num_parents

Where possible, use ARRAY_SIZE to determine the number of parents in
clk_parent_data, instead of hardcoding it.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Link: https://lore.kernel.org/r/20210911121340.261920-5-marijn.suijten@somainline.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Marijn Suijten and committed by
Stephen Boyd
ce336a51 9d67de94

+4 -4
+4 -4
drivers/clk/qcom/gpucc-msm8998.c
··· 126 126 .clkr.hw.init = &(struct clk_init_data){ 127 127 .name = "rbcpr_clk_src", 128 128 .parent_data = gpu_xo_gpll0, 129 - .num_parents = 2, 129 + .num_parents = ARRAY_SIZE(gpu_xo_gpll0), 130 130 .ops = &clk_rcg2_ops, 131 131 }, 132 132 }; ··· 144 144 .clkr.hw.init = &(struct clk_init_data){ 145 145 .name = "gfx3d_clk_src", 146 146 .parent_data = gpu_xo_gpupll0, 147 - .num_parents = 2, 147 + .num_parents = ARRAY_SIZE(gpu_xo_gpupll0), 148 148 .ops = &clk_rcg2_ops, 149 149 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 150 150 }, ··· 163 163 .clkr.hw.init = &(struct clk_init_data){ 164 164 .name = "rbbmtimer_clk_src", 165 165 .parent_data = gpu_xo_gpll0, 166 - .num_parents = 2, 166 + .num_parents = ARRAY_SIZE(gpu_xo_gpll0), 167 167 .ops = &clk_rcg2_ops, 168 168 }, 169 169 }; ··· 184 184 .clkr.hw.init = &(struct clk_init_data){ 185 185 .name = "gfx3d_isense_clk_src", 186 186 .parent_data = gpu_xo_gpll0, 187 - .num_parents = 2, 187 + .num_parents = ARRAY_SIZE(gpu_xo_gpll0), 188 188 .ops = &clk_rcg2_ops, 189 189 }, 190 190 };