1 From a6aedd6532131bc81d47bbf63385dfcf2a0e9faa Mon Sep 17 00:00:00 2001
2 From: Ansuel Smith <ansuelsmth@gmail.com>
3 Date: Sat, 26 Feb 2022 14:52:26 +0100
4 Subject: [PATCH 06/14] clk: qcom: gcc-ipq806x: use ARRAY_SIZE for num_parents
6 Use ARRAY_SIZE for num_parents instead of hardcoding the value.
8 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
9 Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
10 Reviewed-by: Stephen Boyd <sboyd@kernel.org>
11 Tested-by: Jonathan McDowell <noodles@earth.li>
12 Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
13 Link: https://lore.kernel.org/r/20220226135235.10051-7-ansuelsmth@gmail.com
15 drivers/clk/qcom/gcc-ipq806x.c | 68 +++++++++++++++++-----------------
16 1 file changed, 34 insertions(+), 34 deletions(-)
18 --- a/drivers/clk/qcom/gcc-ipq806x.c
19 +++ b/drivers/clk/qcom/gcc-ipq806x.c
20 @@ -373,7 +373,7 @@ static struct clk_rcg gsbi1_uart_src = {
21 .hw.init = &(struct clk_init_data){
22 .name = "gsbi1_uart_src",
23 .parent_data = gcc_pxo_pll8,
25 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
27 .flags = CLK_SET_PARENT_GATE,
29 @@ -424,7 +424,7 @@ static struct clk_rcg gsbi2_uart_src = {
30 .hw.init = &(struct clk_init_data){
31 .name = "gsbi2_uart_src",
32 .parent_data = gcc_pxo_pll8,
34 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
36 .flags = CLK_SET_PARENT_GATE,
38 @@ -475,7 +475,7 @@ static struct clk_rcg gsbi4_uart_src = {
39 .hw.init = &(struct clk_init_data){
40 .name = "gsbi4_uart_src",
41 .parent_data = gcc_pxo_pll8,
43 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
45 .flags = CLK_SET_PARENT_GATE,
47 @@ -526,7 +526,7 @@ static struct clk_rcg gsbi5_uart_src = {
48 .hw.init = &(struct clk_init_data){
49 .name = "gsbi5_uart_src",
50 .parent_data = gcc_pxo_pll8,
52 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
54 .flags = CLK_SET_PARENT_GATE,
56 @@ -577,7 +577,7 @@ static struct clk_rcg gsbi6_uart_src = {
57 .hw.init = &(struct clk_init_data){
58 .name = "gsbi6_uart_src",
59 .parent_data = gcc_pxo_pll8,
61 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
63 .flags = CLK_SET_PARENT_GATE,
65 @@ -628,7 +628,7 @@ static struct clk_rcg gsbi7_uart_src = {
66 .hw.init = &(struct clk_init_data){
67 .name = "gsbi7_uart_src",
68 .parent_data = gcc_pxo_pll8,
70 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
72 .flags = CLK_SET_PARENT_GATE,
74 @@ -692,7 +692,7 @@ static struct clk_rcg gsbi1_qup_src = {
75 .hw.init = &(struct clk_init_data){
76 .name = "gsbi1_qup_src",
77 .parent_data = gcc_pxo_pll8,
79 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
81 .flags = CLK_SET_PARENT_GATE,
83 @@ -743,7 +743,7 @@ static struct clk_rcg gsbi2_qup_src = {
84 .hw.init = &(struct clk_init_data){
85 .name = "gsbi2_qup_src",
86 .parent_data = gcc_pxo_pll8,
88 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
90 .flags = CLK_SET_PARENT_GATE,
92 @@ -794,7 +794,7 @@ static struct clk_rcg gsbi4_qup_src = {
93 .hw.init = &(struct clk_init_data){
94 .name = "gsbi4_qup_src",
95 .parent_data = gcc_pxo_pll8,
97 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
99 .flags = CLK_SET_PARENT_GATE,
101 @@ -845,7 +845,7 @@ static struct clk_rcg gsbi5_qup_src = {
102 .hw.init = &(struct clk_init_data){
103 .name = "gsbi5_qup_src",
104 .parent_data = gcc_pxo_pll8,
106 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
108 .flags = CLK_SET_PARENT_GATE,
110 @@ -896,7 +896,7 @@ static struct clk_rcg gsbi6_qup_src = {
111 .hw.init = &(struct clk_init_data){
112 .name = "gsbi6_qup_src",
113 .parent_data = gcc_pxo_pll8,
115 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
117 .flags = CLK_SET_PARENT_GATE,
119 @@ -947,7 +947,7 @@ static struct clk_rcg gsbi7_qup_src = {
120 .hw.init = &(struct clk_init_data){
121 .name = "gsbi7_qup_src",
122 .parent_data = gcc_pxo_pll8,
124 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
126 .flags = CLK_SET_PARENT_GATE,
128 @@ -1099,7 +1099,7 @@ static struct clk_rcg gp0_src = {
129 .hw.init = &(struct clk_init_data){
131 .parent_data = gcc_pxo_pll8_cxo,
133 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8_cxo),
135 .flags = CLK_SET_PARENT_GATE,
137 @@ -1150,7 +1150,7 @@ static struct clk_rcg gp1_src = {
138 .hw.init = &(struct clk_init_data){
140 .parent_data = gcc_pxo_pll8_cxo,
142 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8_cxo),
144 .flags = CLK_SET_RATE_GATE,
146 @@ -1201,7 +1201,7 @@ static struct clk_rcg gp2_src = {
147 .hw.init = &(struct clk_init_data){
149 .parent_data = gcc_pxo_pll8_cxo,
151 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8_cxo),
153 .flags = CLK_SET_RATE_GATE,
155 @@ -1257,7 +1257,7 @@ static struct clk_rcg prng_src = {
156 .hw.init = &(struct clk_init_data){
158 .parent_data = gcc_pxo_pll8,
160 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
164 @@ -1321,7 +1321,7 @@ static struct clk_rcg sdc1_src = {
165 .hw.init = &(struct clk_init_data){
167 .parent_data = gcc_pxo_pll8,
169 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
173 @@ -1371,7 +1371,7 @@ static struct clk_rcg sdc3_src = {
174 .hw.init = &(struct clk_init_data){
176 .parent_data = gcc_pxo_pll8,
178 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
182 @@ -1456,7 +1456,7 @@ static struct clk_rcg tsif_ref_src = {
183 .hw.init = &(struct clk_init_data){
184 .name = "tsif_ref_src",
185 .parent_data = gcc_pxo_pll8,
187 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8),
191 @@ -1620,7 +1620,7 @@ static struct clk_rcg pcie_ref_src = {
192 .hw.init = &(struct clk_init_data){
193 .name = "pcie_ref_src",
194 .parent_data = gcc_pxo_pll3,
196 + .num_parents = ARRAY_SIZE(gcc_pxo_pll3),
198 .flags = CLK_SET_RATE_GATE,
200 @@ -1714,7 +1714,7 @@ static struct clk_rcg pcie1_ref_src = {
201 .hw.init = &(struct clk_init_data){
202 .name = "pcie1_ref_src",
203 .parent_data = gcc_pxo_pll3,
205 + .num_parents = ARRAY_SIZE(gcc_pxo_pll3),
207 .flags = CLK_SET_RATE_GATE,
209 @@ -1808,7 +1808,7 @@ static struct clk_rcg pcie2_ref_src = {
210 .hw.init = &(struct clk_init_data){
211 .name = "pcie2_ref_src",
212 .parent_data = gcc_pxo_pll3,
214 + .num_parents = ARRAY_SIZE(gcc_pxo_pll3),
216 .flags = CLK_SET_RATE_GATE,
218 @@ -1907,7 +1907,7 @@ static struct clk_rcg sata_ref_src = {
219 .hw.init = &(struct clk_init_data){
220 .name = "sata_ref_src",
221 .parent_data = gcc_pxo_pll3,
223 + .num_parents = ARRAY_SIZE(gcc_pxo_pll3),
225 .flags = CLK_SET_RATE_GATE,
227 @@ -2048,7 +2048,7 @@ static struct clk_rcg usb30_master_clk_s
228 .hw.init = &(struct clk_init_data){
229 .name = "usb30_master_ref_src",
230 .parent_data = gcc_pxo_pll8_pll0,
232 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8_pll0),
234 .flags = CLK_SET_RATE_GATE,
236 @@ -2122,7 +2122,7 @@ static struct clk_rcg usb30_utmi_clk = {
237 .hw.init = &(struct clk_init_data){
238 .name = "usb30_utmi_clk",
239 .parent_data = gcc_pxo_pll8_pll0,
241 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8_pll0),
243 .flags = CLK_SET_RATE_GATE,
245 @@ -2196,7 +2196,7 @@ static struct clk_rcg usb_hs1_xcvr_clk_s
246 .hw.init = &(struct clk_init_data){
247 .name = "usb_hs1_xcvr_src",
248 .parent_data = gcc_pxo_pll8_pll0,
250 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8_pll0),
252 .flags = CLK_SET_RATE_GATE,
254 @@ -2262,7 +2262,7 @@ static struct clk_rcg usb_fs1_xcvr_clk_s
255 .hw.init = &(struct clk_init_data){
256 .name = "usb_fs1_xcvr_src",
257 .parent_data = gcc_pxo_pll8_pll0,
259 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8_pll0),
261 .flags = CLK_SET_RATE_GATE,
263 @@ -2398,7 +2398,7 @@ static struct clk_dyn_rcg gmac_core1_src
264 .hw.init = &(struct clk_init_data){
265 .name = "gmac_core1_src",
266 .parent_data = gcc_pxo_pll8_pll14_pll18_pll0,
268 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8_pll14_pll18_pll0),
269 .ops = &clk_dyn_rcg_ops,
272 @@ -2470,7 +2470,7 @@ static struct clk_dyn_rcg gmac_core2_src
273 .hw.init = &(struct clk_init_data){
274 .name = "gmac_core2_src",
275 .parent_data = gcc_pxo_pll8_pll14_pll18_pll0,
277 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8_pll14_pll18_pll0),
278 .ops = &clk_dyn_rcg_ops,
281 @@ -2542,7 +2542,7 @@ static struct clk_dyn_rcg gmac_core3_src
282 .hw.init = &(struct clk_init_data){
283 .name = "gmac_core3_src",
284 .parent_data = gcc_pxo_pll8_pll14_pll18_pll0,
286 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8_pll14_pll18_pll0),
287 .ops = &clk_dyn_rcg_ops,
290 @@ -2614,7 +2614,7 @@ static struct clk_dyn_rcg gmac_core4_src
291 .hw.init = &(struct clk_init_data){
292 .name = "gmac_core4_src",
293 .parent_data = gcc_pxo_pll8_pll14_pll18_pll0,
295 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8_pll14_pll18_pll0),
296 .ops = &clk_dyn_rcg_ops,
299 @@ -2674,7 +2674,7 @@ static struct clk_dyn_rcg nss_tcm_src =
300 .hw.init = &(struct clk_init_data){
301 .name = "nss_tcm_src",
302 .parent_data = gcc_pxo_pll8_pll14_pll18_pll0,
304 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8_pll14_pll18_pll0),
305 .ops = &clk_dyn_rcg_ops,
308 @@ -2752,7 +2752,7 @@ static struct clk_dyn_rcg ubi32_core1_sr
309 .hw.init = &(struct clk_init_data){
310 .name = "ubi32_core1_src_clk",
311 .parent_data = gcc_pxo_pll8_pll14_pll18_pll0,
313 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8_pll14_pll18_pll0),
314 .ops = &clk_dyn_rcg_ops,
315 .flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
317 @@ -2805,7 +2805,7 @@ static struct clk_dyn_rcg ubi32_core2_sr
318 .hw.init = &(struct clk_init_data){
319 .name = "ubi32_core2_src_clk",
320 .parent_data = gcc_pxo_pll8_pll14_pll18_pll0,
322 + .num_parents = ARRAY_SIZE(gcc_pxo_pll8_pll14_pll18_pll0),
323 .ops = &clk_dyn_rcg_ops,
324 .flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,