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

regulator: tps65090: constify static regulator_ops

The only usages of these are 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-6-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Rikard Falkeborn and committed by
Mark Brown
7d844ac3 2e6d9db8

+4 -4
+4 -4
drivers/regulator/tps65090-regulator.c
··· 47 47 int overcurrent_wait; 48 48 }; 49 49 50 - static struct regulator_ops tps65090_ext_control_ops = { 50 + static const struct regulator_ops tps65090_ext_control_ops = { 51 51 }; 52 52 53 53 /** ··· 167 167 return ret; 168 168 } 169 169 170 - static struct regulator_ops tps65090_reg_control_ops = { 170 + static const struct regulator_ops tps65090_reg_control_ops = { 171 171 .enable = regulator_enable_regmap, 172 172 .disable = regulator_disable_regmap, 173 173 .is_enabled = regulator_is_enabled_regmap, 174 174 }; 175 175 176 - static struct regulator_ops tps65090_fet_control_ops = { 176 + static const struct regulator_ops tps65090_fet_control_ops = { 177 177 .enable = tps65090_fet_enable, 178 178 .disable = regulator_disable_regmap, 179 179 .is_enabled = regulator_is_enabled_regmap, 180 180 }; 181 181 182 - static struct regulator_ops tps65090_ldo_ops = { 182 + static const struct regulator_ops tps65090_ldo_ops = { 183 183 }; 184 184 185 185 #define tps65090_REG_DESC(_id, _sname, _en_reg, _en_bits, _nvolt, _volt, _ops) \