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

regulator: lp8788: constify regulator_ops structures

The regulator_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Julia Lawall and committed by
Mark Brown
95dfead1 7629cef1

+4 -4
+2 -2
drivers/regulator/lp8788-buck.c
··· 344 344 REGULATOR_MODE_FAST : REGULATOR_MODE_NORMAL; 345 345 } 346 346 347 - static struct regulator_ops lp8788_buck12_ops = { 347 + static const struct regulator_ops lp8788_buck12_ops = { 348 348 .list_voltage = regulator_list_voltage_table, 349 349 .map_voltage = regulator_map_voltage_ascend, 350 350 .set_voltage_sel = lp8788_buck12_set_voltage_sel, ··· 357 357 .get_mode = lp8788_buck_get_mode, 358 358 }; 359 359 360 - static struct regulator_ops lp8788_buck34_ops = { 360 + static const struct regulator_ops lp8788_buck34_ops = { 361 361 .list_voltage = regulator_list_voltage_table, 362 362 .map_voltage = regulator_map_voltage_ascend, 363 363 .set_voltage_sel = regulator_set_voltage_sel_regmap,
+2 -2
drivers/regulator/lp8788-ldo.c
··· 170 170 return ENABLE_TIME_USEC * val; 171 171 } 172 172 173 - static struct regulator_ops lp8788_ldo_voltage_table_ops = { 173 + static const struct regulator_ops lp8788_ldo_voltage_table_ops = { 174 174 .list_voltage = regulator_list_voltage_table, 175 175 .set_voltage_sel = regulator_set_voltage_sel_regmap, 176 176 .get_voltage_sel = regulator_get_voltage_sel_regmap, ··· 180 180 .enable_time = lp8788_ldo_enable_time, 181 181 }; 182 182 183 - static struct regulator_ops lp8788_ldo_voltage_fixed_ops = { 183 + static const struct regulator_ops lp8788_ldo_voltage_fixed_ops = { 184 184 .list_voltage = regulator_list_voltage_linear, 185 185 .enable = regulator_enable_regmap, 186 186 .disable = regulator_disable_regmap,