* [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data
@ 2026-03-31 9:17 Krzysztof Kozlowski
2026-03-31 9:17 ` [PATCH 2/2] clk: qcom: Constify list of critical CBCR registers Krzysztof Kozlowski
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-31 9:17 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Maxime Coquelin,
Alexandre Torgue, linux-arm-msm, linux-clk, linux-kernel,
linux-stm32, linux-arm-kernel
Cc: Krzysztof Kozlowski
The static 'struct qcom_cc_driver_data' contains probe match-like data
and is not modified: neither by the driver defining it nor by common.c
code using it.
Make it const for code safety and code readability.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
drivers/clk/qcom/apss-ipq5424.c | 2 +-
drivers/clk/qcom/cambistmclkcc-kaanapali.c | 2 +-
drivers/clk/qcom/cambistmclkcc-sm8750.c | 2 +-
drivers/clk/qcom/camcc-kaanapali.c | 2 +-
drivers/clk/qcom/camcc-milos.c | 2 +-
drivers/clk/qcom/camcc-qcs615.c | 2 +-
drivers/clk/qcom/camcc-sc8180x.c | 2 +-
drivers/clk/qcom/camcc-sm8450.c | 2 +-
drivers/clk/qcom/camcc-sm8550.c | 2 +-
drivers/clk/qcom/camcc-sm8650.c | 2 +-
drivers/clk/qcom/camcc-sm8750.c | 2 +-
drivers/clk/qcom/camcc-x1e80100.c | 2 +-
drivers/clk/qcom/common.h | 2 +-
drivers/clk/qcom/dispcc-eliza.c | 2 +-
drivers/clk/qcom/dispcc-glymur.c | 2 +-
drivers/clk/qcom/dispcc-kaanapali.c | 2 +-
drivers/clk/qcom/dispcc-milos.c | 2 +-
drivers/clk/qcom/dispcc-qcs615.c | 2 +-
drivers/clk/qcom/gcc-eliza.c | 2 +-
drivers/clk/qcom/gcc-glymur.c | 2 +-
drivers/clk/qcom/gcc-kaanapali.c | 2 +-
drivers/clk/qcom/gcc-milos.c | 2 +-
drivers/clk/qcom/gcc-sc8180x.c | 2 +-
drivers/clk/qcom/gpucc-glymur.c | 2 +-
drivers/clk/qcom/gpucc-kaanapali.c | 2 +-
drivers/clk/qcom/gpucc-milos.c | 2 +-
drivers/clk/qcom/gpucc-qcs615.c | 2 +-
drivers/clk/qcom/videocc-glymur.c | 2 +-
drivers/clk/qcom/videocc-kaanapali.c | 2 +-
drivers/clk/qcom/videocc-milos.c | 2 +-
drivers/clk/qcom/videocc-qcs615.c | 2 +-
drivers/clk/qcom/videocc-sm8450.c | 2 +-
drivers/clk/qcom/videocc-sm8750.c | 2 +-
33 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/drivers/clk/qcom/apss-ipq5424.c b/drivers/clk/qcom/apss-ipq5424.c
index 2d622c1fe5d0..1662c83058bc 100644
--- a/drivers/clk/qcom/apss-ipq5424.c
+++ b/drivers/clk/qcom/apss-ipq5424.c
@@ -211,7 +211,7 @@ static struct clk_alpha_pll *ipa5424_apss_plls[] = {
&ipq5424_apss_pll,
};
-static struct qcom_cc_driver_data ipa5424_apss_driver_data = {
+static const struct qcom_cc_driver_data ipa5424_apss_driver_data = {
.alpha_plls = ipa5424_apss_plls,
.num_alpha_plls = ARRAY_SIZE(ipa5424_apss_plls),
};
diff --git a/drivers/clk/qcom/cambistmclkcc-kaanapali.c b/drivers/clk/qcom/cambistmclkcc-kaanapali.c
index 6ad912403b8b..77adb453ab21 100644
--- a/drivers/clk/qcom/cambistmclkcc-kaanapali.c
+++ b/drivers/clk/qcom/cambistmclkcc-kaanapali.c
@@ -395,7 +395,7 @@ static const struct regmap_config cam_bist_mclk_cc_kaanapali_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data cam_bist_mclk_cc_kaanapali_driver_data = {
+static const struct qcom_cc_driver_data cam_bist_mclk_cc_kaanapali_driver_data = {
.alpha_plls = cam_bist_mclk_cc_kaanapali_plls,
.num_alpha_plls = ARRAY_SIZE(cam_bist_mclk_cc_kaanapali_plls),
.clk_cbcrs = cam_bist_mclk_cc_kaanapali_critical_cbcrs,
diff --git a/drivers/clk/qcom/cambistmclkcc-sm8750.c b/drivers/clk/qcom/cambistmclkcc-sm8750.c
index d889a8f6561d..f0d7e3b7c532 100644
--- a/drivers/clk/qcom/cambistmclkcc-sm8750.c
+++ b/drivers/clk/qcom/cambistmclkcc-sm8750.c
@@ -414,7 +414,7 @@ static const struct regmap_config cam_bist_mclk_cc_sm8750_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data cam_bist_mclk_cc_sm8750_driver_data = {
+static const struct qcom_cc_driver_data cam_bist_mclk_cc_sm8750_driver_data = {
.alpha_plls = cam_bist_mclk_cc_sm8750_plls,
.num_alpha_plls = ARRAY_SIZE(cam_bist_mclk_cc_sm8750_plls),
.clk_cbcrs = cam_bist_mclk_cc_sm8750_critical_cbcrs,
diff --git a/drivers/clk/qcom/camcc-kaanapali.c b/drivers/clk/qcom/camcc-kaanapali.c
index c848ca99e9df..acf5f476955b 100644
--- a/drivers/clk/qcom/camcc-kaanapali.c
+++ b/drivers/clk/qcom/camcc-kaanapali.c
@@ -2615,7 +2615,7 @@ static const struct regmap_config cam_cc_kaanapali_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data cam_cc_kaanapali_driver_data = {
+static const struct qcom_cc_driver_data cam_cc_kaanapali_driver_data = {
.alpha_plls = cam_cc_kaanapali_plls,
.num_alpha_plls = ARRAY_SIZE(cam_cc_kaanapali_plls),
.clk_cbcrs = cam_cc_kaanapali_critical_cbcrs,
diff --git a/drivers/clk/qcom/camcc-milos.c b/drivers/clk/qcom/camcc-milos.c
index 0077c9c9249f..556c3c33c106 100644
--- a/drivers/clk/qcom/camcc-milos.c
+++ b/drivers/clk/qcom/camcc-milos.c
@@ -2117,7 +2117,7 @@ static const struct regmap_config cam_cc_milos_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data cam_cc_milos_driver_data = {
+static const struct qcom_cc_driver_data cam_cc_milos_driver_data = {
.alpha_plls = cam_cc_milos_plls,
.num_alpha_plls = ARRAY_SIZE(cam_cc_milos_plls),
.clk_cbcrs = cam_cc_milos_critical_cbcrs,
diff --git a/drivers/clk/qcom/camcc-qcs615.c b/drivers/clk/qcom/camcc-qcs615.c
index c063a3bfacd0..8377126c2cfe 100644
--- a/drivers/clk/qcom/camcc-qcs615.c
+++ b/drivers/clk/qcom/camcc-qcs615.c
@@ -1556,7 +1556,7 @@ static const struct regmap_config cam_cc_qcs615_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data cam_cc_qcs615_driver_data = {
+static const struct qcom_cc_driver_data cam_cc_qcs615_driver_data = {
.alpha_plls = cam_cc_qcs615_plls,
.num_alpha_plls = ARRAY_SIZE(cam_cc_qcs615_plls),
};
diff --git a/drivers/clk/qcom/camcc-sc8180x.c b/drivers/clk/qcom/camcc-sc8180x.c
index 0291e2f3ea80..bd06d271928e 100644
--- a/drivers/clk/qcom/camcc-sc8180x.c
+++ b/drivers/clk/qcom/camcc-sc8180x.c
@@ -2842,7 +2842,7 @@ static const struct regmap_config cam_cc_sc8180x_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data cam_cc_sc8180x_driver_data = {
+static const struct qcom_cc_driver_data cam_cc_sc8180x_driver_data = {
.alpha_plls = cam_cc_sc8180x_plls,
.num_alpha_plls = ARRAY_SIZE(cam_cc_sc8180x_plls),
.clk_cbcrs = cam_cc_sc8180x_critical_cbcrs,
diff --git a/drivers/clk/qcom/camcc-sm8450.c b/drivers/clk/qcom/camcc-sm8450.c
index ef8cf54d0eed..430b436a673e 100644
--- a/drivers/clk/qcom/camcc-sm8450.c
+++ b/drivers/clk/qcom/camcc-sm8450.c
@@ -3030,7 +3030,7 @@ static struct gdsc *cam_cc_sm8450_gdscs[] = {
[TITAN_TOP_GDSC] = &titan_top_gdsc,
};
-static struct qcom_cc_driver_data cam_cc_sm8450_driver_data = {
+static const struct qcom_cc_driver_data cam_cc_sm8450_driver_data = {
.alpha_plls = cam_cc_sm8450_plls,
.num_alpha_plls = ARRAY_SIZE(cam_cc_sm8450_plls),
.clk_cbcrs = cam_cc_sm8450_critical_cbcrs,
diff --git a/drivers/clk/qcom/camcc-sm8550.c b/drivers/clk/qcom/camcc-sm8550.c
index b8ece8a57a8a..8c42ae7544aa 100644
--- a/drivers/clk/qcom/camcc-sm8550.c
+++ b/drivers/clk/qcom/camcc-sm8550.c
@@ -3530,7 +3530,7 @@ static const struct regmap_config cam_cc_sm8550_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data cam_cc_sm8550_driver_data = {
+static const struct qcom_cc_driver_data cam_cc_sm8550_driver_data = {
.alpha_plls = cam_cc_sm8550_plls,
.num_alpha_plls = ARRAY_SIZE(cam_cc_sm8550_plls),
.clk_cbcrs = cam_cc_sm8550_critical_cbcrs,
diff --git a/drivers/clk/qcom/camcc-sm8650.c b/drivers/clk/qcom/camcc-sm8650.c
index 8b388904f56f..c0055fb08f62 100644
--- a/drivers/clk/qcom/camcc-sm8650.c
+++ b/drivers/clk/qcom/camcc-sm8650.c
@@ -3548,7 +3548,7 @@ static const struct regmap_config cam_cc_sm8650_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data cam_cc_sm8650_driver_data = {
+static const struct qcom_cc_driver_data cam_cc_sm8650_driver_data = {
.alpha_plls = cam_cc_sm8650_plls,
.num_alpha_plls = ARRAY_SIZE(cam_cc_sm8650_plls),
.clk_cbcrs = cam_cc_sm8650_critical_cbcrs,
diff --git a/drivers/clk/qcom/camcc-sm8750.c b/drivers/clk/qcom/camcc-sm8750.c
index a797b783d4a9..9b6d49981267 100644
--- a/drivers/clk/qcom/camcc-sm8750.c
+++ b/drivers/clk/qcom/camcc-sm8750.c
@@ -2666,7 +2666,7 @@ static const struct regmap_config cam_cc_sm8750_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data cam_cc_sm8750_driver_data = {
+static const struct qcom_cc_driver_data cam_cc_sm8750_driver_data = {
.alpha_plls = cam_cc_sm8750_plls,
.num_alpha_plls = ARRAY_SIZE(cam_cc_sm8750_plls),
.clk_cbcrs = cam_cc_sm8750_critical_cbcrs,
diff --git a/drivers/clk/qcom/camcc-x1e80100.c b/drivers/clk/qcom/camcc-x1e80100.c
index cbcc1c9fcb34..387420533125 100644
--- a/drivers/clk/qcom/camcc-x1e80100.c
+++ b/drivers/clk/qcom/camcc-x1e80100.c
@@ -2447,7 +2447,7 @@ static const struct regmap_config cam_cc_x1e80100_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data cam_cc_x1e80100_driver_data = {
+static const struct qcom_cc_driver_data cam_cc_x1e80100_driver_data = {
.alpha_plls = cam_cc_x1e80100_plls,
.num_alpha_plls = ARRAY_SIZE(cam_cc_x1e80100_plls),
.clk_cbcrs = cam_cc_x1e80100_critical_cbcrs,
diff --git a/drivers/clk/qcom/common.h b/drivers/clk/qcom/common.h
index 953c91f7b145..69c4b21333e5 100644
--- a/drivers/clk/qcom/common.h
+++ b/drivers/clk/qcom/common.h
@@ -49,7 +49,7 @@ struct qcom_cc_desc {
size_t num_icc_hws;
unsigned int icc_first_node_id;
bool use_rpm;
- struct qcom_cc_driver_data *driver_data;
+ const struct qcom_cc_driver_data *driver_data;
};
/**
diff --git a/drivers/clk/qcom/dispcc-eliza.c b/drivers/clk/qcom/dispcc-eliza.c
index 062be01c1b01..60de3c743621 100644
--- a/drivers/clk/qcom/dispcc-eliza.c
+++ b/drivers/clk/qcom/dispcc-eliza.c
@@ -2076,7 +2076,7 @@ static void clk_eliza_regs_configure(struct device *dev, struct regmap *regmap)
regmap_set_bits(regmap, DISP_CC_MISC_CMD, BIT(4));
}
-static struct qcom_cc_driver_data disp_cc_eliza_driver_data = {
+static const struct qcom_cc_driver_data disp_cc_eliza_driver_data = {
.alpha_plls = disp_cc_eliza_plls,
.num_alpha_plls = ARRAY_SIZE(disp_cc_eliza_plls),
.clk_cbcrs = disp_cc_eliza_critical_cbcrs,
diff --git a/drivers/clk/qcom/dispcc-glymur.c b/drivers/clk/qcom/dispcc-glymur.c
index fd085cb90667..aae60291b55e 100644
--- a/drivers/clk/qcom/dispcc-glymur.c
+++ b/drivers/clk/qcom/dispcc-glymur.c
@@ -1934,7 +1934,7 @@ static const struct regmap_config disp_cc_glymur_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data disp_cc_glymur_driver_data = {
+static const struct qcom_cc_driver_data disp_cc_glymur_driver_data = {
.alpha_plls = disp_cc_glymur_plls,
.num_alpha_plls = ARRAY_SIZE(disp_cc_glymur_plls),
.clk_cbcrs = disp_cc_glymur_critical_cbcrs,
diff --git a/drivers/clk/qcom/dispcc-kaanapali.c b/drivers/clk/qcom/dispcc-kaanapali.c
index 5ec4d2ab6b67..ffdb4de3a33e 100644
--- a/drivers/clk/qcom/dispcc-kaanapali.c
+++ b/drivers/clk/qcom/dispcc-kaanapali.c
@@ -1907,7 +1907,7 @@ static void clk_kaanapali_regs_configure(struct device *dev, struct regmap *regm
regmap_update_bits(regmap, DISP_CC_MISC_CMD, BIT(4), BIT(4));
}
-static struct qcom_cc_driver_data disp_cc_kaanapali_driver_data = {
+static const struct qcom_cc_driver_data disp_cc_kaanapali_driver_data = {
.alpha_plls = disp_cc_kaanapali_plls,
.num_alpha_plls = ARRAY_SIZE(disp_cc_kaanapali_plls),
.clk_cbcrs = disp_cc_kaanapali_critical_cbcrs,
diff --git a/drivers/clk/qcom/dispcc-milos.c b/drivers/clk/qcom/dispcc-milos.c
index 0a483fb6683a..17ff10cb2f6b 100644
--- a/drivers/clk/qcom/dispcc-milos.c
+++ b/drivers/clk/qcom/dispcc-milos.c
@@ -926,7 +926,7 @@ static void disp_cc_milos_clk_regs_configure(struct device *dev, struct regmap *
}
-static struct qcom_cc_driver_data disp_cc_milos_driver_data = {
+static const struct qcom_cc_driver_data disp_cc_milos_driver_data = {
.alpha_plls = disp_cc_milos_plls,
.num_alpha_plls = ARRAY_SIZE(disp_cc_milos_plls),
.clk_cbcrs = disp_cc_milos_critical_cbcrs,
diff --git a/drivers/clk/qcom/dispcc-qcs615.c b/drivers/clk/qcom/dispcc-qcs615.c
index 4a6d78466098..21974e2574f5 100644
--- a/drivers/clk/qcom/dispcc-qcs615.c
+++ b/drivers/clk/qcom/dispcc-qcs615.c
@@ -751,7 +751,7 @@ static const struct regmap_config disp_cc_qcs615_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data disp_cc_qcs615_driver_data = {
+static const struct qcom_cc_driver_data disp_cc_qcs615_driver_data = {
.alpha_plls = disp_cc_qcs615_plls,
.num_alpha_plls = ARRAY_SIZE(disp_cc_qcs615_plls),
.clk_cbcrs = disp_cc_qcs615_critical_cbcrs,
diff --git a/drivers/clk/qcom/gcc-eliza.c b/drivers/clk/qcom/gcc-eliza.c
index 06ee1469badd..9356c5bf0a03 100644
--- a/drivers/clk/qcom/gcc-eliza.c
+++ b/drivers/clk/qcom/gcc-eliza.c
@@ -3050,7 +3050,7 @@ static void clk_eliza_regs_configure(struct device *dev, struct regmap *regmap)
qcom_branch_set_force_mem_core(regmap, gcc_ufs_phy_ice_core_clk, true);
}
-static struct qcom_cc_driver_data gcc_eliza_driver_data = {
+static const struct qcom_cc_driver_data gcc_eliza_driver_data = {
.clk_cbcrs = gcc_eliza_critical_cbcrs,
.num_clk_cbcrs = ARRAY_SIZE(gcc_eliza_critical_cbcrs),
.dfs_rcgs = gcc_eliza_dfs_clocks,
diff --git a/drivers/clk/qcom/gcc-glymur.c b/drivers/clk/qcom/gcc-glymur.c
index 1a5d3d182705..7a199e1bd493 100644
--- a/drivers/clk/qcom/gcc-glymur.c
+++ b/drivers/clk/qcom/gcc-glymur.c
@@ -8561,7 +8561,7 @@ static void clk_glymur_regs_configure(struct device *dev, struct regmap *regmap)
qcom_branch_set_force_mem_core(regmap, gcc_ufs_phy_ice_core_clk, true);
}
-static struct qcom_cc_driver_data gcc_glymur_driver_data = {
+static const struct qcom_cc_driver_data gcc_glymur_driver_data = {
.clk_cbcrs = gcc_glymur_critical_cbcrs,
.num_clk_cbcrs = ARRAY_SIZE(gcc_glymur_critical_cbcrs),
.dfs_rcgs = gcc_dfs_clocks,
diff --git a/drivers/clk/qcom/gcc-kaanapali.c b/drivers/clk/qcom/gcc-kaanapali.c
index 210ec7afbb67..44275bac095e 100644
--- a/drivers/clk/qcom/gcc-kaanapali.c
+++ b/drivers/clk/qcom/gcc-kaanapali.c
@@ -3485,7 +3485,7 @@ static void clk_kaanapali_regs_configure(struct device *dev, struct regmap *regm
qcom_branch_set_force_mem_core(regmap, gcc_ufs_phy_ice_core_clk, true);
}
-static struct qcom_cc_driver_data gcc_kaanapali_driver_data = {
+static const struct qcom_cc_driver_data gcc_kaanapali_driver_data = {
.clk_cbcrs = gcc_kaanapali_critical_cbcrs,
.num_clk_cbcrs = ARRAY_SIZE(gcc_kaanapali_critical_cbcrs),
.dfs_rcgs = gcc_dfs_clocks,
diff --git a/drivers/clk/qcom/gcc-milos.c b/drivers/clk/qcom/gcc-milos.c
index 81fa09ec55d7..3438fb9039ee 100644
--- a/drivers/clk/qcom/gcc-milos.c
+++ b/drivers/clk/qcom/gcc-milos.c
@@ -3171,7 +3171,7 @@ static const struct regmap_config gcc_milos_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data gcc_milos_driver_data = {
+static const struct qcom_cc_driver_data gcc_milos_driver_data = {
.clk_cbcrs = gcc_milos_critical_cbcrs,
.num_clk_cbcrs = ARRAY_SIZE(gcc_milos_critical_cbcrs),
.dfs_rcgs = gcc_milos_dfs_clocks,
diff --git a/drivers/clk/qcom/gcc-sc8180x.c b/drivers/clk/qcom/gcc-sc8180x.c
index 88b95d5326d9..35c2e9d555b8 100644
--- a/drivers/clk/qcom/gcc-sc8180x.c
+++ b/drivers/clk/qcom/gcc-sc8180x.c
@@ -4675,7 +4675,7 @@ static void clk_sc8180x_regs_configure(struct device *dev, struct regmap *regmap
regmap_update_bits(regmap, 0x71028, 0x3, 0x3);
}
-static struct qcom_cc_driver_data gcc_sc8180x_driver_data = {
+static const struct qcom_cc_driver_data gcc_sc8180x_driver_data = {
.clk_cbcrs = gcc_sc8180x_critical_cbcrs,
.num_clk_cbcrs = ARRAY_SIZE(gcc_sc8180x_critical_cbcrs),
.dfs_rcgs = gcc_sc8180x_dfs_clocks,
diff --git a/drivers/clk/qcom/gpucc-glymur.c b/drivers/clk/qcom/gpucc-glymur.c
index 1a1d946347d0..824b4e09c3f9 100644
--- a/drivers/clk/qcom/gpucc-glymur.c
+++ b/drivers/clk/qcom/gpucc-glymur.c
@@ -574,7 +574,7 @@ static const struct regmap_config gpu_cc_glymur_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data gpu_cc_glymur_driver_data = {
+static const struct qcom_cc_driver_data gpu_cc_glymur_driver_data = {
.alpha_plls = gpu_cc_glymur_plls,
.num_alpha_plls = ARRAY_SIZE(gpu_cc_glymur_plls),
.clk_cbcrs = gpu_cc_glymur_critical_cbcrs,
diff --git a/drivers/clk/qcom/gpucc-kaanapali.c b/drivers/clk/qcom/gpucc-kaanapali.c
index d93d06067fbf..94f0feb254b3 100644
--- a/drivers/clk/qcom/gpucc-kaanapali.c
+++ b/drivers/clk/qcom/gpucc-kaanapali.c
@@ -437,7 +437,7 @@ static const struct regmap_config gpu_cc_kaanapali_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data gpu_cc_kaanapali_driver_data = {
+static const struct qcom_cc_driver_data gpu_cc_kaanapali_driver_data = {
.alpha_plls = gpu_cc_kaanapali_plls,
.num_alpha_plls = ARRAY_SIZE(gpu_cc_kaanapali_plls),
.clk_cbcrs = gpu_cc_kaanapali_critical_cbcrs,
diff --git a/drivers/clk/qcom/gpucc-milos.c b/drivers/clk/qcom/gpucc-milos.c
index 4ee09879156e..7a8a3917db9b 100644
--- a/drivers/clk/qcom/gpucc-milos.c
+++ b/drivers/clk/qcom/gpucc-milos.c
@@ -518,7 +518,7 @@ static const struct regmap_config gpu_cc_milos_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data gpu_cc_milos_driver_data = {
+static const struct qcom_cc_driver_data gpu_cc_milos_driver_data = {
.alpha_plls = gpu_cc_milos_plls,
.num_alpha_plls = ARRAY_SIZE(gpu_cc_milos_plls),
.clk_cbcrs = gpu_cc_milos_critical_cbcrs,
diff --git a/drivers/clk/qcom/gpucc-qcs615.c b/drivers/clk/qcom/gpucc-qcs615.c
index ec6739c08425..8233136db4d8 100644
--- a/drivers/clk/qcom/gpucc-qcs615.c
+++ b/drivers/clk/qcom/gpucc-qcs615.c
@@ -485,7 +485,7 @@ static void clk_qcs615_regs_crc_configure(struct device *dev, struct regmap *reg
regmap_update_bits(regmap, 0x1024, 0x00800000, 0x00800000);
}
-static struct qcom_cc_driver_data gpu_cc_qcs615_driver_data = {
+static const struct qcom_cc_driver_data gpu_cc_qcs615_driver_data = {
.alpha_plls = gpu_cc_qcs615_plls,
.num_alpha_plls = ARRAY_SIZE(gpu_cc_qcs615_plls),
.clk_cbcrs = gpu_cc_qcs615_critical_cbcrs,
diff --git a/drivers/clk/qcom/videocc-glymur.c b/drivers/clk/qcom/videocc-glymur.c
index ea20605dd1e5..4f1ad0db30e5 100644
--- a/drivers/clk/qcom/videocc-glymur.c
+++ b/drivers/clk/qcom/videocc-glymur.c
@@ -487,7 +487,7 @@ static void clk_glymur_regs_configure(struct device *dev, struct regmap *regmap)
regmap_update_bits(regmap, 0x9f24, BIT(0), BIT(0));
}
-static struct qcom_cc_driver_data video_cc_glymur_driver_data = {
+static const struct qcom_cc_driver_data video_cc_glymur_driver_data = {
.alpha_plls = video_cc_glymur_plls,
.num_alpha_plls = ARRAY_SIZE(video_cc_glymur_plls),
.clk_cbcrs = video_cc_glymur_critical_cbcrs,
diff --git a/drivers/clk/qcom/videocc-kaanapali.c b/drivers/clk/qcom/videocc-kaanapali.c
index 835a59536ba7..b060ee34e8a4 100644
--- a/drivers/clk/qcom/videocc-kaanapali.c
+++ b/drivers/clk/qcom/videocc-kaanapali.c
@@ -776,7 +776,7 @@ static void clk_kaanapali_regs_configure(struct device *dev, struct regmap *regm
regmap_set_bits(regmap, 0x8158, ACCU_CFG_MASK);
}
-static struct qcom_cc_driver_data video_cc_kaanapali_driver_data = {
+static const struct qcom_cc_driver_data video_cc_kaanapali_driver_data = {
.alpha_plls = video_cc_kaanapali_plls,
.num_alpha_plls = ARRAY_SIZE(video_cc_kaanapali_plls),
.clk_cbcrs = video_cc_kaanapali_critical_cbcrs,
diff --git a/drivers/clk/qcom/videocc-milos.c b/drivers/clk/qcom/videocc-milos.c
index acc9df295d4f..012a13f8fb0b 100644
--- a/drivers/clk/qcom/videocc-milos.c
+++ b/drivers/clk/qcom/videocc-milos.c
@@ -359,7 +359,7 @@ static const struct regmap_config video_cc_milos_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data video_cc_milos_driver_data = {
+static const struct qcom_cc_driver_data video_cc_milos_driver_data = {
.alpha_plls = video_cc_milos_plls,
.num_alpha_plls = ARRAY_SIZE(video_cc_milos_plls),
.clk_cbcrs = video_cc_milos_critical_cbcrs,
diff --git a/drivers/clk/qcom/videocc-qcs615.c b/drivers/clk/qcom/videocc-qcs615.c
index 1b41fa44c17e..338ab803d56a 100644
--- a/drivers/clk/qcom/videocc-qcs615.c
+++ b/drivers/clk/qcom/videocc-qcs615.c
@@ -295,7 +295,7 @@ static const struct regmap_config video_cc_qcs615_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data video_cc_qcs615_driver_data = {
+static const struct qcom_cc_driver_data video_cc_qcs615_driver_data = {
.alpha_plls = video_cc_qcs615_plls,
.num_alpha_plls = ARRAY_SIZE(video_cc_qcs615_plls),
.clk_cbcrs = video_cc_qcs615_critical_cbcrs,
diff --git a/drivers/clk/qcom/videocc-sm8450.c b/drivers/clk/qcom/videocc-sm8450.c
index dc168ce199cc..acd0928be1f6 100644
--- a/drivers/clk/qcom/videocc-sm8450.c
+++ b/drivers/clk/qcom/videocc-sm8450.c
@@ -427,7 +427,7 @@ static const struct regmap_config video_cc_sm8450_regmap_config = {
.fast_io = true,
};
-static struct qcom_cc_driver_data video_cc_sm8450_driver_data = {
+static const struct qcom_cc_driver_data video_cc_sm8450_driver_data = {
.alpha_plls = video_cc_sm8450_plls,
.num_alpha_plls = ARRAY_SIZE(video_cc_sm8450_plls),
.clk_cbcrs = video_cc_sm8450_critical_cbcrs,
diff --git a/drivers/clk/qcom/videocc-sm8750.c b/drivers/clk/qcom/videocc-sm8750.c
index 5c1034dd5f57..7e77822c132c 100644
--- a/drivers/clk/qcom/videocc-sm8750.c
+++ b/drivers/clk/qcom/videocc-sm8750.c
@@ -407,7 +407,7 @@ static void clk_sm8750_regs_configure(struct device *dev, struct regmap *regmap)
regmap_update_bits(regmap, 0x9f24, BIT(0), BIT(0));
}
-static struct qcom_cc_driver_data video_cc_sm8750_driver_data = {
+static const struct qcom_cc_driver_data video_cc_sm8750_driver_data = {
.alpha_plls = video_cc_sm8750_plls,
.num_alpha_plls = ARRAY_SIZE(video_cc_sm8750_plls),
.clk_cbcrs = video_cc_sm8750_critical_cbcrs,
--
2.51.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/2] clk: qcom: Constify list of critical CBCR registers
2026-03-31 9:17 [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data Krzysztof Kozlowski
@ 2026-03-31 9:17 ` Krzysztof Kozlowski
2026-03-31 10:30 ` Konrad Dybcio
2026-03-31 10:44 ` Vladimir Zapolskiy
2026-03-31 9:33 ` [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data Konrad Dybcio
` (2 subsequent siblings)
3 siblings, 2 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-31 9:17 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Maxime Coquelin,
Alexandre Torgue, linux-arm-msm, linux-clk, linux-kernel,
linux-stm32, linux-arm-kernel
Cc: Krzysztof Kozlowski
The static array 'xxx_critical_cbcrs' contains probe match-like data and
is not modified: neither by the driver defining it nor by common.c code
using it.
Make it const for code safety and code readability.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
drivers/clk/qcom/cambistmclkcc-kaanapali.c | 2 +-
drivers/clk/qcom/cambistmclkcc-sm8750.c | 2 +-
drivers/clk/qcom/camcc-kaanapali.c | 2 +-
drivers/clk/qcom/camcc-milos.c | 2 +-
drivers/clk/qcom/camcc-sc8180x.c | 2 +-
drivers/clk/qcom/camcc-sm8450.c | 2 +-
drivers/clk/qcom/camcc-sm8550.c | 2 +-
drivers/clk/qcom/camcc-sm8650.c | 2 +-
drivers/clk/qcom/camcc-sm8750.c | 2 +-
drivers/clk/qcom/camcc-x1e80100.c | 2 +-
drivers/clk/qcom/common.h | 2 +-
drivers/clk/qcom/dispcc-eliza.c | 2 +-
drivers/clk/qcom/dispcc-glymur.c | 2 +-
drivers/clk/qcom/dispcc-kaanapali.c | 2 +-
drivers/clk/qcom/dispcc-milos.c | 2 +-
drivers/clk/qcom/dispcc-qcs615.c | 2 +-
drivers/clk/qcom/gcc-eliza.c | 2 +-
drivers/clk/qcom/gcc-glymur.c | 2 +-
drivers/clk/qcom/gcc-kaanapali.c | 2 +-
drivers/clk/qcom/gcc-milos.c | 2 +-
drivers/clk/qcom/gcc-sc8180x.c | 2 +-
drivers/clk/qcom/gpucc-glymur.c | 2 +-
drivers/clk/qcom/gpucc-kaanapali.c | 2 +-
drivers/clk/qcom/gpucc-milos.c | 2 +-
drivers/clk/qcom/gpucc-qcs615.c | 2 +-
drivers/clk/qcom/videocc-glymur.c | 2 +-
drivers/clk/qcom/videocc-kaanapali.c | 2 +-
drivers/clk/qcom/videocc-milos.c | 2 +-
drivers/clk/qcom/videocc-qcs615.c | 2 +-
drivers/clk/qcom/videocc-sm8450.c | 2 +-
drivers/clk/qcom/videocc-sm8550.c | 4 ++--
drivers/clk/qcom/videocc-sm8750.c | 2 +-
32 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/drivers/clk/qcom/cambistmclkcc-kaanapali.c b/drivers/clk/qcom/cambistmclkcc-kaanapali.c
index 77adb453ab21..6028d8f6959c 100644
--- a/drivers/clk/qcom/cambistmclkcc-kaanapali.c
+++ b/drivers/clk/qcom/cambistmclkcc-kaanapali.c
@@ -383,7 +383,7 @@ static struct clk_alpha_pll *cam_bist_mclk_cc_kaanapali_plls[] = {
&cam_bist_mclk_cc_pll0,
};
-static u32 cam_bist_mclk_cc_kaanapali_critical_cbcrs[] = {
+static const u32 cam_bist_mclk_cc_kaanapali_critical_cbcrs[] = {
0x40e0, /* CAM_BIST_MCLK_CC_SLEEP_CLK */
};
diff --git a/drivers/clk/qcom/cambistmclkcc-sm8750.c b/drivers/clk/qcom/cambistmclkcc-sm8750.c
index f0d7e3b7c532..5df12aced4a5 100644
--- a/drivers/clk/qcom/cambistmclkcc-sm8750.c
+++ b/drivers/clk/qcom/cambistmclkcc-sm8750.c
@@ -402,7 +402,7 @@ static struct clk_alpha_pll *cam_bist_mclk_cc_sm8750_plls[] = {
&cam_bist_mclk_cc_pll0,
};
-static u32 cam_bist_mclk_cc_sm8750_critical_cbcrs[] = {
+static const u32 cam_bist_mclk_cc_sm8750_critical_cbcrs[] = {
0x40f8, /* CAM_BIST_MCLK_CC_SLEEP_CLK */
};
diff --git a/drivers/clk/qcom/camcc-kaanapali.c b/drivers/clk/qcom/camcc-kaanapali.c
index acf5f476955b..af5486418492 100644
--- a/drivers/clk/qcom/camcc-kaanapali.c
+++ b/drivers/clk/qcom/camcc-kaanapali.c
@@ -2600,7 +2600,7 @@ static struct clk_alpha_pll *cam_cc_kaanapali_plls[] = {
&cam_cc_pll7,
};
-static u32 cam_cc_kaanapali_critical_cbcrs[] = {
+static const u32 cam_cc_kaanapali_critical_cbcrs[] = {
0x21398, /* CAM_CC_DRV_AHB_CLK */
0x21390, /* CAM_CC_DRV_XO_CLK */
0x21364, /* CAM_CC_GDSC_CLK */
diff --git a/drivers/clk/qcom/camcc-milos.c b/drivers/clk/qcom/camcc-milos.c
index 556c3c33c106..409d47098c10 100644
--- a/drivers/clk/qcom/camcc-milos.c
+++ b/drivers/clk/qcom/camcc-milos.c
@@ -2104,7 +2104,7 @@ static struct clk_alpha_pll *cam_cc_milos_plls[] = {
&cam_cc_pll6,
};
-static u32 cam_cc_milos_critical_cbcrs[] = {
+static const u32 cam_cc_milos_critical_cbcrs[] = {
0x25038, /* CAM_CC_GDSC_CLK */
0x2505c, /* CAM_CC_SLEEP_CLK */
};
diff --git a/drivers/clk/qcom/camcc-sc8180x.c b/drivers/clk/qcom/camcc-sc8180x.c
index bd06d271928e..016f37d08468 100644
--- a/drivers/clk/qcom/camcc-sc8180x.c
+++ b/drivers/clk/qcom/camcc-sc8180x.c
@@ -2829,7 +2829,7 @@ static struct clk_alpha_pll *cam_cc_sc8180x_plls[] = {
&cam_cc_pll6,
};
-static u32 cam_cc_sc8180x_critical_cbcrs[] = {
+static const u32 cam_cc_sc8180x_critical_cbcrs[] = {
0xc1e4, /* CAM_CC_GDSC_CLK */
0xc200, /* CAM_CC_SLEEP_CLK */
};
diff --git a/drivers/clk/qcom/camcc-sm8450.c b/drivers/clk/qcom/camcc-sm8450.c
index 430b436a673e..1891262a559b 100644
--- a/drivers/clk/qcom/camcc-sm8450.c
+++ b/drivers/clk/qcom/camcc-sm8450.c
@@ -2915,7 +2915,7 @@ static struct clk_alpha_pll *cam_cc_sm8450_plls[] = {
&cam_cc_pll8,
};
-static u32 cam_cc_sm8450_critical_cbcrs[] = {
+static const u32 cam_cc_sm8450_critical_cbcrs[] = {
0x1320c, /* CAM_CC_GDSC_CLK */
};
diff --git a/drivers/clk/qcom/camcc-sm8550.c b/drivers/clk/qcom/camcc-sm8550.c
index 8c42ae7544aa..34d53e2ffad7 100644
--- a/drivers/clk/qcom/camcc-sm8550.c
+++ b/drivers/clk/qcom/camcc-sm8550.c
@@ -3517,7 +3517,7 @@ static struct clk_alpha_pll *cam_cc_sm8550_plls[] = {
&cam_cc_pll12,
};
-static u32 cam_cc_sm8550_critical_cbcrs[] = {
+static const u32 cam_cc_sm8550_critical_cbcrs[] = {
0x1419c, /* CAM_CC_GDSC_CLK */
0x142cc, /* CAM_CC_SLEEP_CLK */
};
diff --git a/drivers/clk/qcom/camcc-sm8650.c b/drivers/clk/qcom/camcc-sm8650.c
index c0055fb08f62..9dea43e74cb6 100644
--- a/drivers/clk/qcom/camcc-sm8650.c
+++ b/drivers/clk/qcom/camcc-sm8650.c
@@ -3533,7 +3533,7 @@ static struct clk_alpha_pll *cam_cc_sm8650_plls[] = {
&cam_cc_pll10,
};
-static u32 cam_cc_sm8650_critical_cbcrs[] = {
+static const u32 cam_cc_sm8650_critical_cbcrs[] = {
0x132ec, /* CAM_CC_GDSC_CLK */
0x13308, /* CAM_CC_SLEEP_CLK */
0x13314, /* CAM_CC_DRV_XO_CLK */
diff --git a/drivers/clk/qcom/camcc-sm8750.c b/drivers/clk/qcom/camcc-sm8750.c
index 9b6d49981267..6618b074c90e 100644
--- a/drivers/clk/qcom/camcc-sm8750.c
+++ b/drivers/clk/qcom/camcc-sm8750.c
@@ -2651,7 +2651,7 @@ static struct clk_alpha_pll *cam_cc_sm8750_plls[] = {
&cam_cc_pll6,
};
-static u32 cam_cc_sm8750_critical_cbcrs[] = {
+static const u32 cam_cc_sm8750_critical_cbcrs[] = {
0x113c4, /* CAM_CC_DRV_AHB_CLK */
0x113c0, /* CAM_CC_DRV_XO_CLK */
0x1137c, /* CAM_CC_GDSC_CLK */
diff --git a/drivers/clk/qcom/camcc-x1e80100.c b/drivers/clk/qcom/camcc-x1e80100.c
index 387420533125..81f579ff6993 100644
--- a/drivers/clk/qcom/camcc-x1e80100.c
+++ b/drivers/clk/qcom/camcc-x1e80100.c
@@ -2434,7 +2434,7 @@ static struct clk_alpha_pll *cam_cc_x1e80100_plls[] = {
&cam_cc_pll8,
};
-static u32 cam_cc_x1e80100_critical_cbcrs[] = {
+static const u32 cam_cc_x1e80100_critical_cbcrs[] = {
0x13a9c, /* CAM_CC_GDSC_CLK */
0x13ab8, /* CAM_CC_SLEEP_CLK */
};
diff --git a/drivers/clk/qcom/common.h b/drivers/clk/qcom/common.h
index 69c4b21333e5..6f2406f8839e 100644
--- a/drivers/clk/qcom/common.h
+++ b/drivers/clk/qcom/common.h
@@ -28,7 +28,7 @@ struct qcom_icc_hws_data {
struct qcom_cc_driver_data {
struct clk_alpha_pll **alpha_plls;
size_t num_alpha_plls;
- u32 *clk_cbcrs;
+ const u32 *clk_cbcrs;
size_t num_clk_cbcrs;
const struct clk_rcg_dfs_data *dfs_rcgs;
size_t num_dfs_rcgs;
diff --git a/drivers/clk/qcom/dispcc-eliza.c b/drivers/clk/qcom/dispcc-eliza.c
index 60de3c743621..479f26e0dde2 100644
--- a/drivers/clk/qcom/dispcc-eliza.c
+++ b/drivers/clk/qcom/dispcc-eliza.c
@@ -2063,7 +2063,7 @@ static struct clk_alpha_pll *disp_cc_eliza_plls[] = {
&disp_cc_pll2,
};
-static u32 disp_cc_eliza_critical_cbcrs[] = {
+static const u32 disp_cc_eliza_critical_cbcrs[] = {
0xe07c, /* DISP_CC_SLEEP_CLK */
0xe05c, /* DISP_CC_XO_CLK */
0xc00c, /* DISP_CC_MDSS_RSCC_AHB_CLK */
diff --git a/drivers/clk/qcom/dispcc-glymur.c b/drivers/clk/qcom/dispcc-glymur.c
index aae60291b55e..c4bb328d432f 100644
--- a/drivers/clk/qcom/dispcc-glymur.c
+++ b/drivers/clk/qcom/dispcc-glymur.c
@@ -1921,7 +1921,7 @@ static struct clk_alpha_pll *disp_cc_glymur_plls[] = {
&disp_cc_pll1,
};
-static u32 disp_cc_glymur_critical_cbcrs[] = {
+static const u32 disp_cc_glymur_critical_cbcrs[] = {
0xe07c, /* DISP_CC_SLEEP_CLK */
0xe05c, /* DISP_CC_XO_CLK */
};
diff --git a/drivers/clk/qcom/dispcc-kaanapali.c b/drivers/clk/qcom/dispcc-kaanapali.c
index ffdb4de3a33e..42912c617c31 100644
--- a/drivers/clk/qcom/dispcc-kaanapali.c
+++ b/drivers/clk/qcom/dispcc-kaanapali.c
@@ -1886,7 +1886,7 @@ static struct clk_alpha_pll *disp_cc_kaanapali_plls[] = {
&disp_cc_pll2,
};
-static u32 disp_cc_kaanapali_critical_cbcrs[] = {
+static const u32 disp_cc_kaanapali_critical_cbcrs[] = {
0xe064, /* DISP_CC_SLEEP_CLK */
0xe05c, /* DISP_CC_XO_CLK */
0xc00c, /* DISP_CC_MDSS_RSCC_AHB_CLK */
diff --git a/drivers/clk/qcom/dispcc-milos.c b/drivers/clk/qcom/dispcc-milos.c
index 17ff10cb2f6b..dfffb6d14b0e 100644
--- a/drivers/clk/qcom/dispcc-milos.c
+++ b/drivers/clk/qcom/dispcc-milos.c
@@ -906,7 +906,7 @@ static struct clk_alpha_pll *disp_cc_milos_plls[] = {
&disp_cc_pll0,
};
-static u32 disp_cc_milos_critical_cbcrs[] = {
+static const u32 disp_cc_milos_critical_cbcrs[] = {
0xe06c, /* DISP_CC_SLEEP_CLK */
0xe04c, /* DISP_CC_XO_CLK */
};
diff --git a/drivers/clk/qcom/dispcc-qcs615.c b/drivers/clk/qcom/dispcc-qcs615.c
index 21974e2574f5..637698e6dc2b 100644
--- a/drivers/clk/qcom/dispcc-qcs615.c
+++ b/drivers/clk/qcom/dispcc-qcs615.c
@@ -739,7 +739,7 @@ static struct clk_alpha_pll *disp_cc_qcs615_plls[] = {
&disp_cc_pll0,
};
-static u32 disp_cc_qcs615_critical_cbcrs[] = {
+static const u32 disp_cc_qcs615_critical_cbcrs[] = {
0x6054, /* DISP_CC_XO_CLK */
};
diff --git a/drivers/clk/qcom/gcc-eliza.c b/drivers/clk/qcom/gcc-eliza.c
index 9356c5bf0a03..42a83be34e01 100644
--- a/drivers/clk/qcom/gcc-eliza.c
+++ b/drivers/clk/qcom/gcc-eliza.c
@@ -3005,7 +3005,7 @@ static const struct qcom_reset_map gcc_eliza_resets[] = {
[GCC_VIDEO_BCR] = { 0x32000 },
};
-static u32 gcc_eliza_critical_cbcrs[] = {
+static const u32 gcc_eliza_critical_cbcrs[] = {
0xa0004, /* GCC_CAM_BIST_MCLK_AHB_CLK */
0x26004, /* GCC_CAMERA_AHB_CLK */
0x26034, /* GCC_CAMERA_XO_CLK */
diff --git a/drivers/clk/qcom/gcc-glymur.c b/drivers/clk/qcom/gcc-glymur.c
index 7a199e1bd493..2736465efdea 100644
--- a/drivers/clk/qcom/gcc-glymur.c
+++ b/drivers/clk/qcom/gcc-glymur.c
@@ -8538,7 +8538,7 @@ static const struct clk_rcg_dfs_data gcc_dfs_clocks[] = {
DEFINE_RCG_DFS(gcc_qupv3_wrap2_s7_clk_src),
};
-static u32 gcc_glymur_critical_cbcrs[] = {
+static const u32 gcc_glymur_critical_cbcrs[] = {
0x26004, /* GCC_CAMERA_AHB_CLK */
0x26040, /* GCC_CAMERA_XO_CLK */
0x27004, /* GCC_DISP_AHB_CLK */
diff --git a/drivers/clk/qcom/gcc-kaanapali.c b/drivers/clk/qcom/gcc-kaanapali.c
index 44275bac095e..6e628b51f38c 100644
--- a/drivers/clk/qcom/gcc-kaanapali.c
+++ b/drivers/clk/qcom/gcc-kaanapali.c
@@ -3457,7 +3457,7 @@ static const struct clk_rcg_dfs_data gcc_dfs_clocks[] = {
DEFINE_RCG_DFS(gcc_qupv3_wrap4_s4_clk_src),
};
-static u32 gcc_kaanapali_critical_cbcrs[] = {
+static const u32 gcc_kaanapali_critical_cbcrs[] = {
0xa0004, /* GCC_CAM_BIST_MCLK_AHB_CLK */
0x26004, /* GCC_CAMERA_AHB_CLK */
0x2603c, /* GCC_CAMERA_XO_CLK */
diff --git a/drivers/clk/qcom/gcc-milos.c b/drivers/clk/qcom/gcc-milos.c
index 3438fb9039ee..67d0eee8ef35 100644
--- a/drivers/clk/qcom/gcc-milos.c
+++ b/drivers/clk/qcom/gcc-milos.c
@@ -3152,7 +3152,7 @@ static struct gdsc *gcc_milos_gdscs[] = {
[USB3_PHY_GDSC] = &usb3_phy_gdsc,
};
-static u32 gcc_milos_critical_cbcrs[] = {
+static const u32 gcc_milos_critical_cbcrs[] = {
0x26004, /* GCC_CAMERA_AHB_CLK */
0x26018, /* GCC_CAMERA_HF_XO_CLK */
0x2601c, /* GCC_CAMERA_SF_XO_CLK */
diff --git a/drivers/clk/qcom/gcc-sc8180x.c b/drivers/clk/qcom/gcc-sc8180x.c
index 35c2e9d555b8..e6b7f1a5dcef 100644
--- a/drivers/clk/qcom/gcc-sc8180x.c
+++ b/drivers/clk/qcom/gcc-sc8180x.c
@@ -4647,7 +4647,7 @@ static struct gdsc *gcc_sc8180x_gdscs[] = {
[HLOS1_VOTE_TURING_MMU_TBU1_GDSC] = &hlos1_vote_turing_mmu_tbu1_gdsc,
};
-static u32 gcc_sc8180x_critical_cbcrs[] = {
+static const u32 gcc_sc8180x_critical_cbcrs[] = {
0xb004, /* GCC_VIDEO_AHB_CLK */
0xb008, /* GCC_CAMERA_AHB_CLK */
0xb00c, /* GCC_DISP_AHB_CLK */
diff --git a/drivers/clk/qcom/gpucc-glymur.c b/drivers/clk/qcom/gpucc-glymur.c
index 824b4e09c3f9..54cc3127718a 100644
--- a/drivers/clk/qcom/gpucc-glymur.c
+++ b/drivers/clk/qcom/gpucc-glymur.c
@@ -560,7 +560,7 @@ static struct clk_alpha_pll *gpu_cc_glymur_plls[] = {
&gpu_cc_pll0,
};
-static u32 gpu_cc_glymur_critical_cbcrs[] = {
+static const u32 gpu_cc_glymur_critical_cbcrs[] = {
0x93a4, /* GPU_CC_CB_CLK */
0x9008, /* GPU_CC_CXO_AON_CLK */
0x9004, /* GPU_CC_RSCC_XO_AON_CLK */
diff --git a/drivers/clk/qcom/gpucc-kaanapali.c b/drivers/clk/qcom/gpucc-kaanapali.c
index 94f0feb254b3..7f6013b348ad 100644
--- a/drivers/clk/qcom/gpucc-kaanapali.c
+++ b/drivers/clk/qcom/gpucc-kaanapali.c
@@ -423,7 +423,7 @@ static struct clk_alpha_pll *gpu_cc_kaanapali_plls[] = {
&gpu_cc_pll0,
};
-static u32 gpu_cc_kaanapali_critical_cbcrs[] = {
+static const u32 gpu_cc_kaanapali_critical_cbcrs[] = {
0x9008, /* GPU_CC_CXO_AON_CLK */
0x93e8, /* GPU_CC_RSCC_HUB_AON_CLK */
0x9004, /* GPU_CC_RSCC_XO_AON_CLK */
diff --git a/drivers/clk/qcom/gpucc-milos.c b/drivers/clk/qcom/gpucc-milos.c
index 7a8a3917db9b..1448d95cb1dc 100644
--- a/drivers/clk/qcom/gpucc-milos.c
+++ b/drivers/clk/qcom/gpucc-milos.c
@@ -500,7 +500,7 @@ static struct clk_alpha_pll *gpu_cc_milos_plls[] = {
&gpu_cc_pll0,
};
-static u32 gpu_cc_milos_critical_cbcrs[] = {
+static const u32 gpu_cc_milos_critical_cbcrs[] = {
0x93a4, /* GPU_CC_CB_CLK */
0x9008, /* GPU_CC_CXO_AON_CLK */
0x9010, /* GPU_CC_DEMET_CLK */
diff --git a/drivers/clk/qcom/gpucc-qcs615.c b/drivers/clk/qcom/gpucc-qcs615.c
index 8233136db4d8..91919cdb75ae 100644
--- a/drivers/clk/qcom/gpucc-qcs615.c
+++ b/drivers/clk/qcom/gpucc-qcs615.c
@@ -459,7 +459,7 @@ static struct clk_alpha_pll *gpu_cc_qcs615_plls[] = {
&gpu_cc_pll1,
};
-static u32 gpu_cc_qcs615_critical_cbcrs[] = {
+static const u32 gpu_cc_qcs615_critical_cbcrs[] = {
0x1078, /* GPU_CC_AHB_CLK */
};
diff --git a/drivers/clk/qcom/videocc-glymur.c b/drivers/clk/qcom/videocc-glymur.c
index 4f1ad0db30e5..bbf13f4ba82d 100644
--- a/drivers/clk/qcom/videocc-glymur.c
+++ b/drivers/clk/qcom/videocc-glymur.c
@@ -467,7 +467,7 @@ static struct clk_alpha_pll *video_cc_glymur_plls[] = {
&video_cc_pll0,
};
-static u32 video_cc_glymur_critical_cbcrs[] = {
+static const u32 video_cc_glymur_critical_cbcrs[] = {
0x80e0, /* VIDEO_CC_AHB_CLK */
0x8138, /* VIDEO_CC_SLEEP_CLK */
0x8110, /* VIDEO_CC_XO_CLK */
diff --git a/drivers/clk/qcom/videocc-kaanapali.c b/drivers/clk/qcom/videocc-kaanapali.c
index b060ee34e8a4..b29e3da465e5 100644
--- a/drivers/clk/qcom/videocc-kaanapali.c
+++ b/drivers/clk/qcom/videocc-kaanapali.c
@@ -741,7 +741,7 @@ static struct clk_alpha_pll *video_cc_kaanapali_plls[] = {
&video_cc_pll3,
};
-static u32 video_cc_kaanapali_critical_cbcrs[] = {
+static const u32 video_cc_kaanapali_critical_cbcrs[] = {
0x817c, /* VIDEO_CC_AHB_CLK */
0x81bc, /* VIDEO_CC_SLEEP_CLK */
0x81b0, /* VIDEO_CC_TS_XO_CLK */
diff --git a/drivers/clk/qcom/videocc-milos.c b/drivers/clk/qcom/videocc-milos.c
index 012a13f8fb0b..3cce34e8c71a 100644
--- a/drivers/clk/qcom/videocc-milos.c
+++ b/drivers/clk/qcom/videocc-milos.c
@@ -345,7 +345,7 @@ static struct clk_alpha_pll *video_cc_milos_plls[] = {
&video_cc_pll0,
};
-static u32 video_cc_milos_critical_cbcrs[] = {
+static const u32 video_cc_milos_critical_cbcrs[] = {
0x80f4, /* VIDEO_CC_AHB_CLK */
0x8140, /* VIDEO_CC_SLEEP_CLK */
0x8124, /* VIDEO_CC_XO_CLK */
diff --git a/drivers/clk/qcom/videocc-qcs615.c b/drivers/clk/qcom/videocc-qcs615.c
index 338ab803d56a..3203cb938ad1 100644
--- a/drivers/clk/qcom/videocc-qcs615.c
+++ b/drivers/clk/qcom/videocc-qcs615.c
@@ -283,7 +283,7 @@ static struct clk_alpha_pll *video_cc_qcs615_plls[] = {
&video_pll0,
};
-static u32 video_cc_qcs615_critical_cbcrs[] = {
+static const u32 video_cc_qcs615_critical_cbcrs[] = {
0xab8, /* VIDEO_CC_XO_CLK */
};
diff --git a/drivers/clk/qcom/videocc-sm8450.c b/drivers/clk/qcom/videocc-sm8450.c
index acd0928be1f6..18b191f598b5 100644
--- a/drivers/clk/qcom/videocc-sm8450.c
+++ b/drivers/clk/qcom/videocc-sm8450.c
@@ -413,7 +413,7 @@ static struct clk_alpha_pll *video_cc_sm8450_plls[] = {
&video_cc_pll1,
};
-static u32 video_cc_sm8450_critical_cbcrs[] = {
+static const u32 video_cc_sm8450_critical_cbcrs[] = {
0x80e4, /* VIDEO_CC_AHB_CLK */
0x8114, /* VIDEO_CC_XO_CLK */
0x8130, /* VIDEO_CC_SLEEP_CLK */
diff --git a/drivers/clk/qcom/videocc-sm8550.c b/drivers/clk/qcom/videocc-sm8550.c
index 32a6505abe26..4e35964f0803 100644
--- a/drivers/clk/qcom/videocc-sm8550.c
+++ b/drivers/clk/qcom/videocc-sm8550.c
@@ -536,13 +536,13 @@ static struct clk_alpha_pll *video_cc_sm8550_plls[] = {
&video_cc_pll1,
};
-static u32 video_cc_sm8550_critical_cbcrs[] = {
+static const u32 video_cc_sm8550_critical_cbcrs[] = {
0x80f4, /* VIDEO_CC_AHB_CLK */
0x8124, /* VIDEO_CC_XO_CLK */
0x8140, /* VIDEO_CC_SLEEP_CLK */
};
-static u32 video_cc_sm8650_critical_cbcrs[] = {
+static const u32 video_cc_sm8650_critical_cbcrs[] = {
0x80f4, /* VIDEO_CC_AHB_CLK */
0x8124, /* VIDEO_CC_XO_CLK */
0x8150, /* VIDEO_CC_SLEEP_CLK */
diff --git a/drivers/clk/qcom/videocc-sm8750.c b/drivers/clk/qcom/videocc-sm8750.c
index 7e77822c132c..e9414390a3cc 100644
--- a/drivers/clk/qcom/videocc-sm8750.c
+++ b/drivers/clk/qcom/videocc-sm8750.c
@@ -392,7 +392,7 @@ static struct clk_alpha_pll *video_cc_sm8750_plls[] = {
&video_cc_pll0,
};
-static u32 video_cc_sm8750_critical_cbcrs[] = {
+static const u32 video_cc_sm8750_critical_cbcrs[] = {
0x80a4, /* VIDEO_CC_AHB_CLK */
0x80f8, /* VIDEO_CC_SLEEP_CLK */
0x80d4, /* VIDEO_CC_XO_CLK */
--
2.51.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data
2026-03-31 9:17 [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data Krzysztof Kozlowski
2026-03-31 9:17 ` [PATCH 2/2] clk: qcom: Constify list of critical CBCR registers Krzysztof Kozlowski
@ 2026-03-31 9:33 ` Konrad Dybcio
2026-03-31 10:09 ` Krzysztof Kozlowski
2026-03-31 10:43 ` Vladimir Zapolskiy
2026-04-05 19:40 ` (subset) " Bjorn Andersson
3 siblings, 1 reply; 13+ messages in thread
From: Konrad Dybcio @ 2026-03-31 9:33 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Michael Turquette,
Stephen Boyd, Maxime Coquelin, Alexandre Torgue, linux-arm-msm,
linux-clk, linux-kernel, linux-stm32, linux-arm-kernel
On 3/31/26 11:17 AM, Krzysztof Kozlowski wrote:
> The static 'struct qcom_cc_driver_data' contains probe match-like data
> and is not modified: neither by the driver defining it nor by common.c
> code using it.
>
> Make it const for code safety and code readability.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
[...]
> --- a/drivers/clk/qcom/common.h
> +++ b/drivers/clk/qcom/common.h
> @@ -49,7 +49,7 @@ struct qcom_cc_desc {
> size_t num_icc_hws;
> unsigned int icc_first_node_id;
> bool use_rpm;
> - struct qcom_cc_driver_data *driver_data;
> + const struct qcom_cc_driver_data *driver_data;
This can be a const ptr to const data, even
Konrad
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data
2026-03-31 9:33 ` [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data Konrad Dybcio
@ 2026-03-31 10:09 ` Krzysztof Kozlowski
2026-03-31 10:10 ` Konrad Dybcio
0 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-31 10:09 UTC (permalink / raw)
To: Konrad Dybcio, Bjorn Andersson, Michael Turquette, Stephen Boyd,
Maxime Coquelin, Alexandre Torgue, linux-arm-msm, linux-clk,
linux-kernel, linux-stm32, linux-arm-kernel
On 31/03/2026 11:33, Konrad Dybcio wrote:
> On 3/31/26 11:17 AM, Krzysztof Kozlowski wrote:
>> The static 'struct qcom_cc_driver_data' contains probe match-like data
>> and is not modified: neither by the driver defining it nor by common.c
>> code using it.
>>
>> Make it const for code safety and code readability.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>> ---
>
> [...]
>
>> --- a/drivers/clk/qcom/common.h
>> +++ b/drivers/clk/qcom/common.h
>> @@ -49,7 +49,7 @@ struct qcom_cc_desc {
>> size_t num_icc_hws;
>> unsigned int icc_first_node_id;
>> bool use_rpm;
>> - struct qcom_cc_driver_data *driver_data;
>> + const struct qcom_cc_driver_data *driver_data;
>
> This can be a const ptr to const data, even
None of other elements in 'qcom_cc_desc' is const pointer, even though
they also could. If doing this change, let's make it consistent - so
shall all of them be const?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data
2026-03-31 10:09 ` Krzysztof Kozlowski
@ 2026-03-31 10:10 ` Konrad Dybcio
2026-03-31 10:13 ` Krzysztof Kozlowski
0 siblings, 1 reply; 13+ messages in thread
From: Konrad Dybcio @ 2026-03-31 10:10 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Michael Turquette,
Stephen Boyd, Maxime Coquelin, Alexandre Torgue, linux-arm-msm,
linux-clk, linux-kernel, linux-stm32, linux-arm-kernel
On 3/31/26 12:09 PM, Krzysztof Kozlowski wrote:
> On 31/03/2026 11:33, Konrad Dybcio wrote:
>> On 3/31/26 11:17 AM, Krzysztof Kozlowski wrote:
>>> The static 'struct qcom_cc_driver_data' contains probe match-like data
>>> and is not modified: neither by the driver defining it nor by common.c
>>> code using it.
>>>
>>> Make it const for code safety and code readability.
>>>
>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>>> ---
>>
>> [...]
>>
>>> --- a/drivers/clk/qcom/common.h
>>> +++ b/drivers/clk/qcom/common.h
>>> @@ -49,7 +49,7 @@ struct qcom_cc_desc {
>>> size_t num_icc_hws;
>>> unsigned int icc_first_node_id;
>>> bool use_rpm;
>>> - struct qcom_cc_driver_data *driver_data;
>>> + const struct qcom_cc_driver_data *driver_data;
>>
>> This can be a const ptr to const data, even
>
> None of other elements in 'qcom_cc_desc' is const pointer, even though
> they also could. If doing this change, let's make it consistent - so
> shall all of them be const?
I thought about it, but then it turns out that videocc-sm8550.c has:
video_cc_sm8550_driver_data.clk_cbcrs = video_cc_sm8650_critical_cbcrs
So we'd have to duplicate the entire struct
Konrad
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data
2026-03-31 10:10 ` Konrad Dybcio
@ 2026-03-31 10:13 ` Krzysztof Kozlowski
2026-03-31 10:17 ` Konrad Dybcio
2026-03-31 10:20 ` Krzysztof Kozlowski
0 siblings, 2 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-31 10:13 UTC (permalink / raw)
To: Konrad Dybcio, Bjorn Andersson, Michael Turquette, Stephen Boyd,
Maxime Coquelin, Alexandre Torgue, linux-arm-msm, linux-clk,
linux-kernel, linux-stm32, linux-arm-kernel
On 31/03/2026 12:10, Konrad Dybcio wrote:
> On 3/31/26 12:09 PM, Krzysztof Kozlowski wrote:
>> On 31/03/2026 11:33, Konrad Dybcio wrote:
>>> On 3/31/26 11:17 AM, Krzysztof Kozlowski wrote:
>>>> The static 'struct qcom_cc_driver_data' contains probe match-like data
>>>> and is not modified: neither by the driver defining it nor by common.c
>>>> code using it.
>>>>
>>>> Make it const for code safety and code readability.
>>>>
>>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>>>> ---
>>>
>>> [...]
>>>
>>>> --- a/drivers/clk/qcom/common.h
>>>> +++ b/drivers/clk/qcom/common.h
>>>> @@ -49,7 +49,7 @@ struct qcom_cc_desc {
>>>> size_t num_icc_hws;
>>>> unsigned int icc_first_node_id;
>>>> bool use_rpm;
>>>> - struct qcom_cc_driver_data *driver_data;
>>>> + const struct qcom_cc_driver_data *driver_data;
>>>
>>> This can be a const ptr to const data, even
>>
>> None of other elements in 'qcom_cc_desc' is const pointer, even though
>> they also could. If doing this change, let's make it consistent - so
>> shall all of them be const?
>
> I thought about it, but then it turns out that videocc-sm8550.c has:
>
> video_cc_sm8550_driver_data.clk_cbcrs = video_cc_sm8650_critical_cbcrs
>
> So we'd have to duplicate the entire struct
No, that's not a problem. Pointer is not modified and we speak here
about const pointer.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data
2026-03-31 10:13 ` Krzysztof Kozlowski
@ 2026-03-31 10:17 ` Konrad Dybcio
2026-03-31 10:20 ` Krzysztof Kozlowski
1 sibling, 0 replies; 13+ messages in thread
From: Konrad Dybcio @ 2026-03-31 10:17 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Michael Turquette,
Stephen Boyd, Maxime Coquelin, Alexandre Torgue, linux-arm-msm,
linux-clk, linux-kernel, linux-stm32, linux-arm-kernel
On 3/31/26 12:13 PM, Krzysztof Kozlowski wrote:
> On 31/03/2026 12:10, Konrad Dybcio wrote:
>> On 3/31/26 12:09 PM, Krzysztof Kozlowski wrote:
>>> On 31/03/2026 11:33, Konrad Dybcio wrote:
>>>> On 3/31/26 11:17 AM, Krzysztof Kozlowski wrote:
>>>>> The static 'struct qcom_cc_driver_data' contains probe match-like data
>>>>> and is not modified: neither by the driver defining it nor by common.c
>>>>> code using it.
>>>>>
>>>>> Make it const for code safety and code readability.
>>>>>
>>>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>>>>> ---
>>>>
>>>> [...]
>>>>
>>>>> --- a/drivers/clk/qcom/common.h
>>>>> +++ b/drivers/clk/qcom/common.h
>>>>> @@ -49,7 +49,7 @@ struct qcom_cc_desc {
>>>>> size_t num_icc_hws;
>>>>> unsigned int icc_first_node_id;
>>>>> bool use_rpm;
>>>>> - struct qcom_cc_driver_data *driver_data;
>>>>> + const struct qcom_cc_driver_data *driver_data;
>>>>
>>>> This can be a const ptr to const data, even
>>>
>>> None of other elements in 'qcom_cc_desc' is const pointer, even though
>>> they also could. If doing this change, let's make it consistent - so
>>> shall all of them be const?
>>
>> I thought about it, but then it turns out that videocc-sm8550.c has:
>>
>> video_cc_sm8550_driver_data.clk_cbcrs = video_cc_sm8650_critical_cbcrs
>>
>> So we'd have to duplicate the entire struct
>
> No, that's not a problem. Pointer is not modified and we speak here
> about const pointer.
Right, I already had constifying the various struct members in mind
Konrad
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data
2026-03-31 10:13 ` Krzysztof Kozlowski
2026-03-31 10:17 ` Konrad Dybcio
@ 2026-03-31 10:20 ` Krzysztof Kozlowski
2026-03-31 10:30 ` Konrad Dybcio
1 sibling, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-31 10:20 UTC (permalink / raw)
To: Konrad Dybcio, Bjorn Andersson, Michael Turquette, Stephen Boyd,
Maxime Coquelin, Alexandre Torgue, linux-arm-msm, linux-clk,
linux-kernel, linux-stm32, linux-arm-kernel
On 31/03/2026 12:13, Krzysztof Kozlowski wrote:
> On 31/03/2026 12:10, Konrad Dybcio wrote:
>> On 3/31/26 12:09 PM, Krzysztof Kozlowski wrote:
>>> On 31/03/2026 11:33, Konrad Dybcio wrote:
>>>> On 3/31/26 11:17 AM, Krzysztof Kozlowski wrote:
>>>>> The static 'struct qcom_cc_driver_data' contains probe match-like data
>>>>> and is not modified: neither by the driver defining it nor by common.c
>>>>> code using it.
>>>>>
>>>>> Make it const for code safety and code readability.
>>>>>
>>>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>>>>> ---
>>>>
>>>> [...]
>>>>
>>>>> --- a/drivers/clk/qcom/common.h
>>>>> +++ b/drivers/clk/qcom/common.h
>>>>> @@ -49,7 +49,7 @@ struct qcom_cc_desc {
>>>>> size_t num_icc_hws;
>>>>> unsigned int icc_first_node_id;
>>>>> bool use_rpm;
>>>>> - struct qcom_cc_driver_data *driver_data;
>>>>> + const struct qcom_cc_driver_data *driver_data;
>>>>
>>>> This can be a const ptr to const data, even
>>>
>>> None of other elements in 'qcom_cc_desc' is const pointer, even though
>>> they also could. If doing this change, let's make it consistent - so
>>> shall all of them be const?
>>
>> I thought about it, but then it turns out that videocc-sm8550.c has:
>>
>> video_cc_sm8550_driver_data.clk_cbcrs = video_cc_sm8650_critical_cbcrs
>>
>> So we'd have to duplicate the entire struct
>
> No, that's not a problem. Pointer is not modified and we speak here
> about const pointer.
>
So to clarify what the code is doing now: I constified the pointed data.
Not the pointer. If you ask me to constify the pointer itself, it's
fine, it will compile/work as well, but do you want it?
It allows only definition with initialization, no further changes later.
All existing drivers would be fine with it, so just confirm that's your
preferred expression.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data
2026-03-31 10:20 ` Krzysztof Kozlowski
@ 2026-03-31 10:30 ` Konrad Dybcio
0 siblings, 0 replies; 13+ messages in thread
From: Konrad Dybcio @ 2026-03-31 10:30 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Michael Turquette,
Stephen Boyd, Maxime Coquelin, Alexandre Torgue, linux-arm-msm,
linux-clk, linux-kernel, linux-stm32, linux-arm-kernel
On 3/31/26 12:20 PM, Krzysztof Kozlowski wrote:
> On 31/03/2026 12:13, Krzysztof Kozlowski wrote:
>> On 31/03/2026 12:10, Konrad Dybcio wrote:
>>> On 3/31/26 12:09 PM, Krzysztof Kozlowski wrote:
>>>> On 31/03/2026 11:33, Konrad Dybcio wrote:
>>>>> On 3/31/26 11:17 AM, Krzysztof Kozlowski wrote:
>>>>>> The static 'struct qcom_cc_driver_data' contains probe match-like data
>>>>>> and is not modified: neither by the driver defining it nor by common.c
>>>>>> code using it.
>>>>>>
>>>>>> Make it const for code safety and code readability.
>>>>>>
>>>>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>>>>>> ---
>>>>>
>>>>> [...]
>>>>>
>>>>>> --- a/drivers/clk/qcom/common.h
>>>>>> +++ b/drivers/clk/qcom/common.h
>>>>>> @@ -49,7 +49,7 @@ struct qcom_cc_desc {
>>>>>> size_t num_icc_hws;
>>>>>> unsigned int icc_first_node_id;
>>>>>> bool use_rpm;
>>>>>> - struct qcom_cc_driver_data *driver_data;
>>>>>> + const struct qcom_cc_driver_data *driver_data;
>>>>>
>>>>> This can be a const ptr to const data, even
>>>>
>>>> None of other elements in 'qcom_cc_desc' is const pointer, even though
>>>> they also could. If doing this change, let's make it consistent - so
>>>> shall all of them be const?
>>>
>>> I thought about it, but then it turns out that videocc-sm8550.c has:
>>>
>>> video_cc_sm8550_driver_data.clk_cbcrs = video_cc_sm8650_critical_cbcrs
>>>
>>> So we'd have to duplicate the entire struct
>>
>> No, that's not a problem. Pointer is not modified and we speak here
>> about const pointer.
>>
>
> So to clarify what the code is doing now: I constified the pointed data.
> Not the pointer. If you ask me to constify the pointer itself, it's
> fine, it will compile/work as well, but do you want it?
>
> It allows only definition with initialization, no further changes later.
> All existing drivers would be fine with it, so just confirm that's your
> preferred expression.
I'm actually a little on the verge. Maybe let's keep the current
iteration of this patch after all, as it'd be a mess to undo if it turned
out to be useful
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] clk: qcom: Constify list of critical CBCR registers
2026-03-31 9:17 ` [PATCH 2/2] clk: qcom: Constify list of critical CBCR registers Krzysztof Kozlowski
@ 2026-03-31 10:30 ` Konrad Dybcio
2026-03-31 10:44 ` Vladimir Zapolskiy
1 sibling, 0 replies; 13+ messages in thread
From: Konrad Dybcio @ 2026-03-31 10:30 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Michael Turquette,
Stephen Boyd, Maxime Coquelin, Alexandre Torgue, linux-arm-msm,
linux-clk, linux-kernel, linux-stm32, linux-arm-kernel
On 3/31/26 11:17 AM, Krzysztof Kozlowski wrote:
> The static array 'xxx_critical_cbcrs' contains probe match-like data and
> is not modified: neither by the driver defining it nor by common.c code
> using it.
>
> Make it const for code safety and code readability.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data
2026-03-31 9:17 [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data Krzysztof Kozlowski
2026-03-31 9:17 ` [PATCH 2/2] clk: qcom: Constify list of critical CBCR registers Krzysztof Kozlowski
2026-03-31 9:33 ` [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data Konrad Dybcio
@ 2026-03-31 10:43 ` Vladimir Zapolskiy
2026-04-05 19:40 ` (subset) " Bjorn Andersson
3 siblings, 0 replies; 13+ messages in thread
From: Vladimir Zapolskiy @ 2026-03-31 10:43 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Michael Turquette,
Stephen Boyd, Maxime Coquelin, Alexandre Torgue, linux-arm-msm,
linux-clk, linux-kernel, linux-stm32, linux-arm-kernel
On 3/31/26 12:17, Krzysztof Kozlowski wrote:
> The static 'struct qcom_cc_driver_data' contains probe match-like data
> and is not modified: neither by the driver defining it nor by common.c
> code using it.
>
> Make it const for code safety and code readability.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
--
Best wishes,
Vladimir
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] clk: qcom: Constify list of critical CBCR registers
2026-03-31 9:17 ` [PATCH 2/2] clk: qcom: Constify list of critical CBCR registers Krzysztof Kozlowski
2026-03-31 10:30 ` Konrad Dybcio
@ 2026-03-31 10:44 ` Vladimir Zapolskiy
1 sibling, 0 replies; 13+ messages in thread
From: Vladimir Zapolskiy @ 2026-03-31 10:44 UTC (permalink / raw)
To: Krzysztof Kozlowski, Bjorn Andersson, Michael Turquette,
Stephen Boyd, Maxime Coquelin, Alexandre Torgue, linux-arm-msm,
linux-clk, linux-kernel, linux-stm32, linux-arm-kernel
On 3/31/26 12:17, Krzysztof Kozlowski wrote:
> The static array 'xxx_critical_cbcrs' contains probe match-like data and
> is not modified: neither by the driver defining it nor by common.c code
> using it.
>
> Make it const for code safety and code readability.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
--
Best wishes,
Vladimir
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: (subset) [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data
2026-03-31 9:17 [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data Krzysztof Kozlowski
` (2 preceding siblings ...)
2026-03-31 10:43 ` Vladimir Zapolskiy
@ 2026-04-05 19:40 ` Bjorn Andersson
3 siblings, 0 replies; 13+ messages in thread
From: Bjorn Andersson @ 2026-04-05 19:40 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Maxime Coquelin,
Alexandre Torgue, linux-arm-msm, linux-clk, linux-kernel,
linux-stm32, linux-arm-kernel, Krzysztof Kozlowski
On Tue, 31 Mar 2026 11:17:22 +0200, Krzysztof Kozlowski wrote:
> The static 'struct qcom_cc_driver_data' contains probe match-like data
> and is not modified: neither by the driver defining it nor by common.c
> code using it.
>
> Make it const for code safety and code readability.
>
>
> [...]
Applied, thanks!
[2/2] clk: qcom: Constify list of critical CBCR registers
commit: 87df31ea43eef5f6b9e7be0fa2555e58a9455e05
Best regards,
--
Bjorn Andersson <andersson@kernel.org>
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2026-04-05 19:40 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31 9:17 [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data Krzysztof Kozlowski
2026-03-31 9:17 ` [PATCH 2/2] clk: qcom: Constify list of critical CBCR registers Krzysztof Kozlowski
2026-03-31 10:30 ` Konrad Dybcio
2026-03-31 10:44 ` Vladimir Zapolskiy
2026-03-31 9:33 ` [PATCH 1/2] clk: qcom: Constify qcom_cc_driver_data Konrad Dybcio
2026-03-31 10:09 ` Krzysztof Kozlowski
2026-03-31 10:10 ` Konrad Dybcio
2026-03-31 10:13 ` Krzysztof Kozlowski
2026-03-31 10:17 ` Konrad Dybcio
2026-03-31 10:20 ` Krzysztof Kozlowski
2026-03-31 10:30 ` Konrad Dybcio
2026-03-31 10:43 ` Vladimir Zapolskiy
2026-04-05 19:40 ` (subset) " Bjorn Andersson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox