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

regulator: pfuze100: Constify static data

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

authored by

Krzysztof Kozlowski and committed by
Mark Brown
6f4fd2b8 7f1bfca4

+5 -5
+5 -5
drivers/regulator/pfuze100-regulator.c
··· 76 76 struct device *dev; 77 77 struct pfuze_regulator regulator_descs[PFUZE100_MAX_REGULATOR]; 78 78 struct regulator_dev *regulators[PFUZE100_MAX_REGULATOR]; 79 - struct pfuze_regulator *pfuze_regulators; 79 + const struct pfuze_regulator *pfuze_regulators; 80 80 }; 81 81 82 82 static const int pfuze100_swbst[] = { ··· 367 367 } 368 368 369 369 /* PFUZE100 */ 370 - static struct pfuze_regulator pfuze100_regulators[] = { 370 + static const struct pfuze_regulator pfuze100_regulators[] = { 371 371 PFUZE100_SW_REG(PFUZE100, SW1AB, PFUZE100_SW1ABVOL, 300000, 1875000, 25000), 372 372 PFUZE100_SW_REG(PFUZE100, SW1C, PFUZE100_SW1CVOL, 300000, 1875000, 25000), 373 373 PFUZE100_SW_REG(PFUZE100, SW2, PFUZE100_SW2VOL, 400000, 1975000, 25000), ··· 386 386 PFUZE100_COIN_REG(PFUZE100, COIN, PFUZE100_COINVOL, 0x7, pfuze100_coin), 387 387 }; 388 388 389 - static struct pfuze_regulator pfuze200_regulators[] = { 389 + static const struct pfuze_regulator pfuze200_regulators[] = { 390 390 PFUZE100_SW_REG(PFUZE200, SW1AB, PFUZE100_SW1ABVOL, 300000, 1875000, 25000), 391 391 PFUZE100_SW_REG(PFUZE200, SW2, PFUZE100_SW2VOL, 400000, 1975000, 25000), 392 392 PFUZE100_SW_REG(PFUZE200, SW3A, PFUZE100_SW3AVOL, 400000, 1975000, 25000), ··· 403 403 PFUZE100_COIN_REG(PFUZE200, COIN, PFUZE100_COINVOL, 0x7, pfuze100_coin), 404 404 }; 405 405 406 - static struct pfuze_regulator pfuze3000_regulators[] = { 406 + static const struct pfuze_regulator pfuze3000_regulators[] = { 407 407 PFUZE3000_SW_REG(PFUZE3000, SW1A, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a), 408 408 PFUZE100_SW_REG(PFUZE3000, SW1B, PFUZE100_SW1CVOL, 700000, 1475000, 25000), 409 409 PFUZE3000_SW_REG(PFUZE3000, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo), ··· 419 419 PFUZE100_VGEN_REG(PFUZE3000, VLDO4, PFUZE100_VGEN6VOL, 1800000, 3300000, 100000), 420 420 }; 421 421 422 - static struct pfuze_regulator pfuze3001_regulators[] = { 422 + static const struct pfuze_regulator pfuze3001_regulators[] = { 423 423 PFUZE3000_SW_REG(PFUZE3001, SW1, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a), 424 424 PFUZE3000_SW_REG(PFUZE3001, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo), 425 425 PFUZE3000_SW3_REG(PFUZE3001, SW3, PFUZE100_SW3AVOL, 900000, 1650000, 50000),