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

regulator: tps6586x: Constify static regulator_ops

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

authored by

Rikard Falkeborn and committed by
Mark Brown
25c80445 7d844ac3

+4 -4
+4 -4
drivers/regulator/tps6586x-regulator.c
··· 60 60 int enable_reg[2]; 61 61 }; 62 62 63 - static struct regulator_ops tps6586x_rw_regulator_ops = { 63 + static const struct regulator_ops tps6586x_rw_regulator_ops = { 64 64 .list_voltage = regulator_list_voltage_table, 65 65 .map_voltage = regulator_map_voltage_ascend, 66 66 .get_voltage_sel = regulator_get_voltage_sel_regmap, ··· 71 71 .disable = regulator_disable_regmap, 72 72 }; 73 73 74 - static struct regulator_ops tps6586x_rw_linear_regulator_ops = { 74 + static const struct regulator_ops tps6586x_rw_linear_regulator_ops = { 75 75 .list_voltage = regulator_list_voltage_linear, 76 76 .get_voltage_sel = regulator_get_voltage_sel_regmap, 77 77 .set_voltage_sel = regulator_set_voltage_sel_regmap, ··· 81 81 .disable = regulator_disable_regmap, 82 82 }; 83 83 84 - static struct regulator_ops tps6586x_ro_regulator_ops = { 84 + static const struct regulator_ops tps6586x_ro_regulator_ops = { 85 85 .list_voltage = regulator_list_voltage_table, 86 86 .map_voltage = regulator_map_voltage_ascend, 87 87 .get_voltage_sel = regulator_get_voltage_sel_regmap, ··· 91 91 .disable = regulator_disable_regmap, 92 92 }; 93 93 94 - static struct regulator_ops tps6586x_sys_regulator_ops = { 94 + static const struct regulator_ops tps6586x_sys_regulator_ops = { 95 95 }; 96 96 97 97 static const unsigned int tps6586x_ldo0_voltages[] = {