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

regulator: max77686-regulator: constify regulator_ops structure

Declare regulator_ops structure as const as it is only stored in the ops
field of a regulator_desc structure. This field is of type const, so
regulator_ops structures having this property can be made const too.

File size before: drivers/regulator/max77686-regulator.o
text data bss dec hex filename
9904 1320 0 11224 2bd8 regulator/max77686-regulator.o

File size after: drivers/regulator/max77686-regulator.o
text data bss dec hex filename
10928 280 0 11208 2bc8 regulator/max77686-regulator.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Bhumika Goyal and committed by
Mark Brown
404826cb d00b7461

+4 -4
+4 -4
drivers/regulator/max77686-regulator.c
··· 289 289 return 0; 290 290 } 291 291 292 - static struct regulator_ops max77686_ops = { 292 + static const struct regulator_ops max77686_ops = { 293 293 .list_voltage = regulator_list_voltage_linear, 294 294 .map_voltage = regulator_map_voltage_linear, 295 295 .is_enabled = regulator_is_enabled_regmap, ··· 301 301 .set_suspend_mode = max77686_set_suspend_mode, 302 302 }; 303 303 304 - static struct regulator_ops max77686_ldo_ops = { 304 + static const struct regulator_ops max77686_ldo_ops = { 305 305 .list_voltage = regulator_list_voltage_linear, 306 306 .map_voltage = regulator_map_voltage_linear, 307 307 .is_enabled = regulator_is_enabled_regmap, ··· 314 314 .set_suspend_disable = max77686_set_suspend_disable, 315 315 }; 316 316 317 - static struct regulator_ops max77686_buck1_ops = { 317 + static const struct regulator_ops max77686_buck1_ops = { 318 318 .list_voltage = regulator_list_voltage_linear, 319 319 .map_voltage = regulator_map_voltage_linear, 320 320 .is_enabled = regulator_is_enabled_regmap, ··· 326 326 .set_suspend_disable = max77686_set_suspend_disable, 327 327 }; 328 328 329 - static struct regulator_ops max77686_buck_dvs_ops = { 329 + static const struct regulator_ops max77686_buck_dvs_ops = { 330 330 .list_voltage = regulator_list_voltage_linear, 331 331 .map_voltage = regulator_map_voltage_linear, 332 332 .is_enabled = regulator_is_enabled_regmap,