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

regulator: tps65086: Constify static regulator_ops

The only usage of reg_ops and switch_ops is to assign their addresses 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-5-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Rikard Falkeborn and committed by
Mark Brown
2e6d9db8 01167e88

+2 -2
+2 -2
drivers/regulator/tps65086-regulator.c
··· 101 101 }; 102 102 103 103 /* Operations permitted on regulators */ 104 - static struct regulator_ops reg_ops = { 104 + static const struct regulator_ops reg_ops = { 105 105 .enable = regulator_enable_regmap, 106 106 .disable = regulator_disable_regmap, 107 107 .is_enabled = regulator_is_enabled_regmap, ··· 112 112 }; 113 113 114 114 /* Operations permitted on load switches */ 115 - static struct regulator_ops switch_ops = { 115 + static const struct regulator_ops switch_ops = { 116 116 .enable = regulator_enable_regmap, 117 117 .disable = regulator_disable_regmap, 118 118 .is_enabled = regulator_is_enabled_regmap,