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

regulator: hi6421: Constify static data

Driver does not modify static data with regulator description (struct
hi6421_regulator_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-6-8934704a5787@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Mark Brown
b94afa51 b3f1e8e3

+7 -7
+7 -7
drivers/regulator/hi6421-regulator.c
··· 303 303 } 304 304 305 305 /* HI6421 regulator information */ 306 - static struct hi6421_regulator_info 306 + static const struct hi6421_regulator_info 307 307 hi6421_regulator_info[HI6421_NUM_REGULATORS] = { 308 308 HI6421_LDO(LDO0, hi6421_vout0, ldo_0_voltages, 0x20, 0x07, 0x20, 0x10, 309 309 10000, 0x20, 8000), ··· 384 384 385 385 static unsigned int hi6421_regulator_ldo_get_mode(struct regulator_dev *rdev) 386 386 { 387 - struct hi6421_regulator_info *info; 387 + const struct hi6421_regulator_info *info; 388 388 unsigned int reg_val; 389 389 390 390 info = container_of(rdev->desc, struct hi6421_regulator_info, desc); ··· 397 397 398 398 static unsigned int hi6421_regulator_buck_get_mode(struct regulator_dev *rdev) 399 399 { 400 - struct hi6421_regulator_info *info; 400 + const struct hi6421_regulator_info *info; 401 401 unsigned int reg_val; 402 402 403 403 info = container_of(rdev->desc, struct hi6421_regulator_info, desc); ··· 411 411 static int hi6421_regulator_ldo_set_mode(struct regulator_dev *rdev, 412 412 unsigned int mode) 413 413 { 414 - struct hi6421_regulator_info *info; 414 + const struct hi6421_regulator_info *info; 415 415 unsigned int new_mode; 416 416 417 417 info = container_of(rdev->desc, struct hi6421_regulator_info, desc); ··· 436 436 static int hi6421_regulator_buck_set_mode(struct regulator_dev *rdev, 437 437 unsigned int mode) 438 438 { 439 - struct hi6421_regulator_info *info; 439 + const struct hi6421_regulator_info *info; 440 440 unsigned int new_mode; 441 441 442 442 info = container_of(rdev->desc, struct hi6421_regulator_info, desc); ··· 462 462 hi6421_regulator_ldo_get_optimum_mode(struct regulator_dev *rdev, 463 463 int input_uV, int output_uV, int load_uA) 464 464 { 465 - struct hi6421_regulator_info *info; 465 + const struct hi6421_regulator_info *info; 466 466 467 467 info = container_of(rdev->desc, struct hi6421_regulator_info, desc); 468 468 ··· 539 539 { 540 540 struct hi6421_pmic *pmic = dev_get_drvdata(pdev->dev.parent); 541 541 struct hi6421_regulator_pdata *pdata; 542 - struct hi6421_regulator_info *info; 542 + const struct hi6421_regulator_info *info; 543 543 struct regulator_config config = { }; 544 544 struct regulator_dev *rdev; 545 545 int i;