]> git.baikalelectronics.ru Git - kernel.git/commit
clk: qcom: gcc-msm8916: use ARRAY_SIZE instead of specifying num_parents
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Mon, 4 Jul 2022 17:24:49 +0000 (20:24 +0300)
committerBjorn Andersson <andersson@kernel.org>
Mon, 29 Aug 2022 20:42:53 +0000 (15:42 -0500)
commitcd4081023dc3d0a8340193dc11f1cbdf78b4e635
tree6b9ad716ba8c77dc706048e5b14ff733aaaed6d0
parent608671c419a6a5f2ba499c28cd5ab10ea319a294
clk: qcom: gcc-msm8916: 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 easy and errorproof.

This conversion fixes an issue present since the first version of this
driver. For the gp1_clk_src, gp2_clk_src and gp3_clk_src it was
impossible to select sleep_clk as a prent of the clock, since
num_parents was limited to 3 rather than 4. Switching to use num_parents
automatically makes sleep_clk available for selection.

Fixes: d42dee9a11bb ("clk: qcom: Add MSM8916 Global Clock Controller support")
Cc: Georgi Djakov <djakov@kernel.org>
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Georgi Djakov <djakov@kernel.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220704172453.838303-4-dmitry.baryshkov@linaro.org
drivers/clk/qcom/gcc-msm8916.c