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

regulator: hi6421v600: Constify static data

Driver does not modify static data with regulator description (struct
hi6421_spmi_reg_info), so make it const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240909-regulator-const-v1-7-8934704a5787@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Mark Brown
5ec424af b94afa51

+5 -5
+5 -5
drivers/regulator/hi6421v600-regulator.c
··· 118 118 119 119 static unsigned int hi6421_spmi_regulator_get_mode(struct regulator_dev *rdev) 120 120 { 121 - struct hi6421_spmi_reg_info *sreg; 121 + const struct hi6421_spmi_reg_info *sreg; 122 122 unsigned int reg_val; 123 123 124 124 sreg = container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); ··· 133 133 static int hi6421_spmi_regulator_set_mode(struct regulator_dev *rdev, 134 134 unsigned int mode) 135 135 { 136 - struct hi6421_spmi_reg_info *sreg; 136 + const struct hi6421_spmi_reg_info *sreg; 137 137 unsigned int val; 138 138 139 139 sreg = container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); ··· 160 160 int input_uV, int output_uV, 161 161 int load_uA) 162 162 { 163 - struct hi6421_spmi_reg_info *sreg; 163 + const struct hi6421_spmi_reg_info *sreg; 164 164 165 165 sreg = container_of(rdev->desc, struct hi6421_spmi_reg_info, desc); 166 166 ··· 195 195 hi6421v600_ldo34, 196 196 }; 197 197 198 - static struct hi6421_spmi_reg_info regulator_info[] = { 198 + static const struct hi6421_spmi_reg_info regulator_info[] = { 199 199 HI6421V600_LDO(ldo3, range_1v5_to_2v0, 200 200 0x16, 0x01, 0x51, 201 201 20000, 120, ··· 235 235 struct device *pmic_dev = pdev->dev.parent; 236 236 struct regulator_config config = { }; 237 237 struct hi6421_spmi_reg_priv *priv; 238 - struct hi6421_spmi_reg_info *info; 238 + const struct hi6421_spmi_reg_info *info; 239 239 struct device *dev = &pdev->dev; 240 240 struct regmap *regmap; 241 241 struct regulator_dev *rdev;