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

regulator: as3711-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/as3711-regulator.o
text data bss dec hex filename
1517 4144 0 5661 161d regulator/as3711-regulator.o

File size after: drivers/regulator/as3711-regulator.o
text data bss dec hex filename
2301 3376 0 5677 162d regulator/as3711-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
1bacf463 d00b7461

+3 -3
+3 -3
drivers/regulator/as3711-regulator.c
··· 82 82 return -EINVAL; 83 83 } 84 84 85 - static struct regulator_ops as3711_sd_ops = { 85 + static const struct regulator_ops as3711_sd_ops = { 86 86 .is_enabled = regulator_is_enabled_regmap, 87 87 .enable = regulator_enable_regmap, 88 88 .disable = regulator_disable_regmap, ··· 94 94 .set_mode = as3711_set_mode_sd, 95 95 }; 96 96 97 - static struct regulator_ops as3711_aldo_ops = { 97 + static const struct regulator_ops as3711_aldo_ops = { 98 98 .is_enabled = regulator_is_enabled_regmap, 99 99 .enable = regulator_enable_regmap, 100 100 .disable = regulator_disable_regmap, ··· 104 104 .map_voltage = regulator_map_voltage_linear_range, 105 105 }; 106 106 107 - static struct regulator_ops as3711_dldo_ops = { 107 + static const struct regulator_ops as3711_dldo_ops = { 108 108 .is_enabled = regulator_is_enabled_regmap, 109 109 .enable = regulator_enable_regmap, 110 110 .disable = regulator_disable_regmap,