Commit e21f2a94 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by Bjorn Andersson

clk: qcom: gcc-sdx55: use ARRAY_SIZE instead of specifying num_parents

Use ARRAY_SIZE() instead of manually specifying num_parents. This makes
adding/removing entries to/from parent_data/names/hws easy and errorproof.
Reviewed-by: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20221228185237.3111988-12-dmitry.baryshkov@linaro.org
parent bfa78833
...@@ -232,7 +232,7 @@ static struct clk_rcg2 gcc_blsp1_qup1_i2c_apps_clk_src = { ...@@ -232,7 +232,7 @@ static struct clk_rcg2 gcc_blsp1_qup1_i2c_apps_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_blsp1_qup1_i2c_apps_clk_src", .name = "gcc_blsp1_qup1_i2c_apps_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -258,7 +258,7 @@ static struct clk_rcg2 gcc_blsp1_qup1_spi_apps_clk_src = { ...@@ -258,7 +258,7 @@ static struct clk_rcg2 gcc_blsp1_qup1_spi_apps_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_blsp1_qup1_spi_apps_clk_src", .name = "gcc_blsp1_qup1_spi_apps_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -272,7 +272,7 @@ static struct clk_rcg2 gcc_blsp1_qup2_i2c_apps_clk_src = { ...@@ -272,7 +272,7 @@ static struct clk_rcg2 gcc_blsp1_qup2_i2c_apps_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_blsp1_qup2_i2c_apps_clk_src", .name = "gcc_blsp1_qup2_i2c_apps_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -286,7 +286,7 @@ static struct clk_rcg2 gcc_blsp1_qup2_spi_apps_clk_src = { ...@@ -286,7 +286,7 @@ static struct clk_rcg2 gcc_blsp1_qup2_spi_apps_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_blsp1_qup2_spi_apps_clk_src", .name = "gcc_blsp1_qup2_spi_apps_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -300,7 +300,7 @@ static struct clk_rcg2 gcc_blsp1_qup3_i2c_apps_clk_src = { ...@@ -300,7 +300,7 @@ static struct clk_rcg2 gcc_blsp1_qup3_i2c_apps_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_blsp1_qup3_i2c_apps_clk_src", .name = "gcc_blsp1_qup3_i2c_apps_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -314,7 +314,7 @@ static struct clk_rcg2 gcc_blsp1_qup3_spi_apps_clk_src = { ...@@ -314,7 +314,7 @@ static struct clk_rcg2 gcc_blsp1_qup3_spi_apps_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_blsp1_qup3_spi_apps_clk_src", .name = "gcc_blsp1_qup3_spi_apps_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -328,7 +328,7 @@ static struct clk_rcg2 gcc_blsp1_qup4_i2c_apps_clk_src = { ...@@ -328,7 +328,7 @@ static struct clk_rcg2 gcc_blsp1_qup4_i2c_apps_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_blsp1_qup4_i2c_apps_clk_src", .name = "gcc_blsp1_qup4_i2c_apps_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -342,7 +342,7 @@ static struct clk_rcg2 gcc_blsp1_qup4_spi_apps_clk_src = { ...@@ -342,7 +342,7 @@ static struct clk_rcg2 gcc_blsp1_qup4_spi_apps_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_blsp1_qup4_spi_apps_clk_src", .name = "gcc_blsp1_qup4_spi_apps_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -386,7 +386,7 @@ static struct clk_rcg2 gcc_blsp1_uart1_apps_clk_src = { ...@@ -386,7 +386,7 @@ static struct clk_rcg2 gcc_blsp1_uart1_apps_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_blsp1_uart1_apps_clk_src", .name = "gcc_blsp1_uart1_apps_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -400,7 +400,7 @@ static struct clk_rcg2 gcc_blsp1_uart2_apps_clk_src = { ...@@ -400,7 +400,7 @@ static struct clk_rcg2 gcc_blsp1_uart2_apps_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_blsp1_uart2_apps_clk_src", .name = "gcc_blsp1_uart2_apps_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -414,7 +414,7 @@ static struct clk_rcg2 gcc_blsp1_uart3_apps_clk_src = { ...@@ -414,7 +414,7 @@ static struct clk_rcg2 gcc_blsp1_uart3_apps_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_blsp1_uart3_apps_clk_src", .name = "gcc_blsp1_uart3_apps_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -428,7 +428,7 @@ static struct clk_rcg2 gcc_blsp1_uart4_apps_clk_src = { ...@@ -428,7 +428,7 @@ static struct clk_rcg2 gcc_blsp1_uart4_apps_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_blsp1_uart4_apps_clk_src", .name = "gcc_blsp1_uart4_apps_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -450,7 +450,7 @@ static struct clk_rcg2 gcc_cpuss_ahb_clk_src = { ...@@ -450,7 +450,7 @@ static struct clk_rcg2 gcc_cpuss_ahb_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_cpuss_ahb_clk_src", .name = "gcc_cpuss_ahb_clk_src",
.parent_data = gcc_parents_0_ao, .parent_data = gcc_parents_0_ao,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0_ao),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -469,7 +469,7 @@ static struct clk_rcg2 gcc_cpuss_rbcpr_clk_src = { ...@@ -469,7 +469,7 @@ static struct clk_rcg2 gcc_cpuss_rbcpr_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_cpuss_rbcpr_clk_src", .name = "gcc_cpuss_rbcpr_clk_src",
.parent_data = gcc_parents_0_ao, .parent_data = gcc_parents_0_ao,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0_ao),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -493,7 +493,7 @@ static struct clk_rcg2 gcc_emac_clk_src = { ...@@ -493,7 +493,7 @@ static struct clk_rcg2 gcc_emac_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_emac_clk_src", .name = "gcc_emac_clk_src",
.parent_data = gcc_parents_5, .parent_data = gcc_parents_5,
.num_parents = 5, .num_parents = ARRAY_SIZE(gcc_parents_5),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -514,7 +514,7 @@ static struct clk_rcg2 gcc_emac_ptp_clk_src = { ...@@ -514,7 +514,7 @@ static struct clk_rcg2 gcc_emac_ptp_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_emac_ptp_clk_src", .name = "gcc_emac_ptp_clk_src",
.parent_data = gcc_parents_2, .parent_data = gcc_parents_2,
.num_parents = 6, .num_parents = ARRAY_SIZE(gcc_parents_2),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -537,7 +537,7 @@ static struct clk_rcg2 gcc_gp1_clk_src = { ...@@ -537,7 +537,7 @@ static struct clk_rcg2 gcc_gp1_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_gp1_clk_src", .name = "gcc_gp1_clk_src",
.parent_data = gcc_parents_3, .parent_data = gcc_parents_3,
.num_parents = 5, .num_parents = ARRAY_SIZE(gcc_parents_3),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -551,7 +551,7 @@ static struct clk_rcg2 gcc_gp2_clk_src = { ...@@ -551,7 +551,7 @@ static struct clk_rcg2 gcc_gp2_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_gp2_clk_src", .name = "gcc_gp2_clk_src",
.parent_data = gcc_parents_3, .parent_data = gcc_parents_3,
.num_parents = 5, .num_parents = ARRAY_SIZE(gcc_parents_3),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -565,7 +565,7 @@ static struct clk_rcg2 gcc_gp3_clk_src = { ...@@ -565,7 +565,7 @@ static struct clk_rcg2 gcc_gp3_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_gp3_clk_src", .name = "gcc_gp3_clk_src",
.parent_data = gcc_parents_3, .parent_data = gcc_parents_3,
.num_parents = 5, .num_parents = ARRAY_SIZE(gcc_parents_3),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -579,7 +579,7 @@ static struct clk_rcg2 gcc_pcie_aux_phy_clk_src = { ...@@ -579,7 +579,7 @@ static struct clk_rcg2 gcc_pcie_aux_phy_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_pcie_aux_phy_clk_src", .name = "gcc_pcie_aux_phy_clk_src",
.parent_data = gcc_parents_4, .parent_data = gcc_parents_4,
.num_parents = 3, .num_parents = ARRAY_SIZE(gcc_parents_4),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -598,7 +598,7 @@ static struct clk_rcg2 gcc_pcie_rchng_phy_clk_src = { ...@@ -598,7 +598,7 @@ static struct clk_rcg2 gcc_pcie_rchng_phy_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_pcie_rchng_phy_clk_src", .name = "gcc_pcie_rchng_phy_clk_src",
.parent_data = gcc_parents_3, .parent_data = gcc_parents_3,
.num_parents = 5, .num_parents = ARRAY_SIZE(gcc_parents_3),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -619,7 +619,7 @@ static struct clk_rcg2 gcc_pdm2_clk_src = { ...@@ -619,7 +619,7 @@ static struct clk_rcg2 gcc_pdm2_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_pdm2_clk_src", .name = "gcc_pdm2_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -633,7 +633,7 @@ static struct clk_rcg2 gcc_sdcc1_apps_clk_src = { ...@@ -633,7 +633,7 @@ static struct clk_rcg2 gcc_sdcc1_apps_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_sdcc1_apps_clk_src", .name = "gcc_sdcc1_apps_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -652,7 +652,7 @@ static struct clk_rcg2 gcc_usb30_master_clk_src = { ...@@ -652,7 +652,7 @@ static struct clk_rcg2 gcc_usb30_master_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_usb30_master_clk_src", .name = "gcc_usb30_master_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -671,7 +671,7 @@ static struct clk_rcg2 gcc_usb30_mock_utmi_clk_src = { ...@@ -671,7 +671,7 @@ static struct clk_rcg2 gcc_usb30_mock_utmi_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_usb30_mock_utmi_clk_src", .name = "gcc_usb30_mock_utmi_clk_src",
.parent_data = gcc_parents_0, .parent_data = gcc_parents_0,
.num_parents = 4, .num_parents = ARRAY_SIZE(gcc_parents_0),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
...@@ -691,7 +691,7 @@ static struct clk_rcg2 gcc_usb3_phy_aux_clk_src = { ...@@ -691,7 +691,7 @@ static struct clk_rcg2 gcc_usb3_phy_aux_clk_src = {
.clkr.hw.init = &(struct clk_init_data){ .clkr.hw.init = &(struct clk_init_data){
.name = "gcc_usb3_phy_aux_clk_src", .name = "gcc_usb3_phy_aux_clk_src",
.parent_data = gcc_parents_4, .parent_data = gcc_parents_4,
.num_parents = 3, .num_parents = ARRAY_SIZE(gcc_parents_4),
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_ops,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment