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

regulator: mc13xxx: Constify regulator_ops variables

These regulator_ops variables should never change, make them const.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Axel Lin and committed by
Mark Brown
e5680c4d ad542a52

+10 -10
+2 -2
drivers/regulator/mc13783-regulator.c
··· 226 226 5500000, 227 227 }; 228 228 229 - static struct regulator_ops mc13783_gpo_regulator_ops; 229 + static const struct regulator_ops mc13783_gpo_regulator_ops; 230 230 231 231 #define MC13783_DEFINE(prefix, name, node, reg, vsel_reg, voltages) \ 232 232 MC13xxx_DEFINE(MC13783_REG_, name, node, reg, vsel_reg, voltages, \ ··· 380 380 return (val & mc13xxx_regulators[id].enable_bit) != 0; 381 381 } 382 382 383 - static struct regulator_ops mc13783_gpo_regulator_ops = { 383 + static const struct regulator_ops mc13783_gpo_regulator_ops = { 384 384 .enable = mc13783_gpo_regulator_enable, 385 385 .disable = mc13783_gpo_regulator_disable, 386 386 .is_enabled = mc13783_gpo_regulator_is_enabled,
+4 -4
drivers/regulator/mc13892-regulator.c
··· 242 242 5000000, 243 243 }; 244 244 245 - static struct regulator_ops mc13892_gpo_regulator_ops; 246 - static struct regulator_ops mc13892_sw_regulator_ops; 245 + static const struct regulator_ops mc13892_gpo_regulator_ops; 246 + static const struct regulator_ops mc13892_sw_regulator_ops; 247 247 248 248 249 249 #define MC13892_FIXED_DEFINE(name, node, reg, voltages) \ ··· 387 387 } 388 388 389 389 390 - static struct regulator_ops mc13892_gpo_regulator_ops = { 390 + static const struct regulator_ops mc13892_gpo_regulator_ops = { 391 391 .enable = mc13892_gpo_regulator_enable, 392 392 .disable = mc13892_gpo_regulator_disable, 393 393 .is_enabled = mc13892_gpo_regulator_is_enabled, ··· 479 479 return ret; 480 480 } 481 481 482 - static struct regulator_ops mc13892_sw_regulator_ops = { 482 + static const struct regulator_ops mc13892_sw_regulator_ops = { 483 483 .list_voltage = regulator_list_voltage_table, 484 484 .map_voltage = regulator_map_voltage_ascend, 485 485 .set_voltage_sel = mc13892_sw_regulator_set_voltage_sel,
+2 -2
drivers/regulator/mc13xxx-regulator-core.c
··· 99 99 return rdev->desc->volt_table[val]; 100 100 } 101 101 102 - struct regulator_ops mc13xxx_regulator_ops = { 102 + const struct regulator_ops mc13xxx_regulator_ops = { 103 103 .enable = mc13xxx_regulator_enable, 104 104 .disable = mc13xxx_regulator_disable, 105 105 .is_enabled = mc13xxx_regulator_is_enabled, ··· 127 127 } 128 128 EXPORT_SYMBOL_GPL(mc13xxx_fixed_regulator_set_voltage); 129 129 130 - struct regulator_ops mc13xxx_fixed_regulator_ops = { 130 + const struct regulator_ops mc13xxx_fixed_regulator_ops = { 131 131 .enable = mc13xxx_regulator_enable, 132 132 .disable = mc13xxx_regulator_disable, 133 133 .is_enabled = mc13xxx_regulator_is_enabled,
+2 -2
drivers/regulator/mc13xxx.h
··· 53 53 } 54 54 #endif 55 55 56 - extern struct regulator_ops mc13xxx_regulator_ops; 57 - extern struct regulator_ops mc13xxx_fixed_regulator_ops; 56 + extern const struct regulator_ops mc13xxx_regulator_ops; 57 + extern const struct regulator_ops mc13xxx_fixed_regulator_ops; 58 58 59 59 #define MC13xxx_DEFINE(prefix, _name, _node, _reg, _vsel_reg, _voltages, _ops) \ 60 60 [prefix ## _name] = { \