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

regulator: tps65912: Constify static regulator_ops

The only usage of tps65912_ops_dcdc and tps65912_ops_ldo is to assign
their address to the ops field in the regulator_desc struct, which is a
const pointer. Make them const to allow the compiler to put them in
read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20200829221104.20870-8-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Rikard Falkeborn and committed by
Mark Brown
e92b8ef8 25c80445

+2 -2
+2 -2
drivers/regulator/tps65912-regulator.c
··· 57 57 }; 58 58 59 59 /* Operations permitted on DCDCx */ 60 - static struct regulator_ops tps65912_ops_dcdc = { 60 + static const struct regulator_ops tps65912_ops_dcdc = { 61 61 .is_enabled = regulator_is_enabled_regmap, 62 62 .enable = regulator_enable_regmap, 63 63 .disable = regulator_disable_regmap, ··· 67 67 }; 68 68 69 69 /* Operations permitted on LDOx */ 70 - static struct regulator_ops tps65912_ops_ldo = { 70 + static const struct regulator_ops tps65912_ops_ldo = { 71 71 .is_enabled = regulator_is_enabled_regmap, 72 72 .enable = regulator_enable_regmap, 73 73 .disable = regulator_disable_regmap,