Skip to content

Commit

Permalink
regulator: max8907-regulator: constify regulator_ops structure
Browse files Browse the repository at this point in the history
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/max8907-regulator.o
   text	   data	    bss	    dec	    hex	filename
   1384	   9424	    256	  11064	   2b38 regulator/max8907-regulator.o

File size after: drivers/regulator/max8907-regulator.o
   text	   data	    bss	    dec	    hex	filename
   2664	   8400	      0	  11064	   2b38 regulator/max8907-regulator.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Bhumika Goyal authored and Mark Brown committed Jan 31, 2017
1 parent d00b746 commit 88c9d47
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/regulator/max8907-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ struct max8907_regulator {
#define LDO_650_25(id, supply, base) REG_LDO(id, supply, (base), \
650000, 2225000, 25000)

static struct regulator_ops max8907_mbatt_ops = {
static const struct regulator_ops max8907_mbatt_ops = {
};

static struct regulator_ops max8907_ldo_ops = {
Expand All @@ -121,13 +121,13 @@ static struct regulator_ops max8907_ldo_ops = {
.is_enabled = regulator_is_enabled_regmap,
};

static struct regulator_ops max8907_ldo_hwctl_ops = {
static const struct regulator_ops max8907_ldo_hwctl_ops = {
.list_voltage = regulator_list_voltage_linear,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
};

static struct regulator_ops max8907_fixed_ops = {
static const struct regulator_ops max8907_fixed_ops = {
.list_voltage = regulator_list_voltage_linear,
};

Expand All @@ -138,11 +138,11 @@ static struct regulator_ops max8907_out5v_ops = {
.is_enabled = regulator_is_enabled_regmap,
};

static struct regulator_ops max8907_out5v_hwctl_ops = {
static const struct regulator_ops max8907_out5v_hwctl_ops = {
.list_voltage = regulator_list_voltage_linear,
};

static struct regulator_ops max8907_bbat_ops = {
static const struct regulator_ops max8907_bbat_ops = {
.list_voltage = regulator_list_voltage_linear,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
Expand Down

0 comments on commit 88c9d47

Please sign in to comment.