Skip to content

Commit

Permalink
regulator: twl: Constify regulator_ops
Browse files Browse the repository at this point in the history
These regulator_ops variables never need to be modified, make them const so
compiler can put them to .rodata.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Apr 3, 2019
1 parent 55c083d commit 401861f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/regulator/twl-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ static int twl4030ldo_get_voltage_sel(struct regulator_dev *rdev)
return vsel;
}

static struct regulator_ops twl4030ldo_ops = {
static const struct regulator_ops twl4030ldo_ops = {
.list_voltage = twl4030ldo_list_voltage,

.set_voltage_sel = twl4030ldo_set_voltage_sel,
Expand Down Expand Up @@ -430,14 +430,14 @@ static int twl4030smps_get_voltage(struct regulator_dev *rdev)
return vsel * 12500 + 600000;
}

static struct regulator_ops twl4030smps_ops = {
static const struct regulator_ops twl4030smps_ops = {
.set_voltage = twl4030smps_set_voltage,
.get_voltage = twl4030smps_get_voltage,
};

/*----------------------------------------------------------------------*/

static struct regulator_ops twl4030fixed_ops = {
static const struct regulator_ops twl4030fixed_ops = {
.list_voltage = regulator_list_voltage_linear,

.enable = twl4030reg_enable,
Expand Down

0 comments on commit 401861f

Please sign in to comment.