Commit 7d844ac3 authored by Rikard Falkeborn's avatar Rikard Falkeborn Committed by Mark Brown

regulator: tps65090: constify static regulator_ops

The only usages of these are to assign their address to the ops field in
the regulator_desc struct, which is a const pointer. Make them const to
allow the compiler to put them in read-only memory.
Signed-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20200829221104.20870-6-rikard.falkeborn@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2e6d9db8
...@@ -47,7 +47,7 @@ struct tps65090_regulator { ...@@ -47,7 +47,7 @@ struct tps65090_regulator {
int overcurrent_wait; int overcurrent_wait;
}; };
static struct regulator_ops tps65090_ext_control_ops = { static const struct regulator_ops tps65090_ext_control_ops = {
}; };
/** /**
...@@ -167,19 +167,19 @@ static int tps65090_fet_enable(struct regulator_dev *rdev) ...@@ -167,19 +167,19 @@ static int tps65090_fet_enable(struct regulator_dev *rdev)
return ret; return ret;
} }
static struct regulator_ops tps65090_reg_control_ops = { static const struct regulator_ops tps65090_reg_control_ops = {
.enable = regulator_enable_regmap, .enable = regulator_enable_regmap,
.disable = regulator_disable_regmap, .disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap, .is_enabled = regulator_is_enabled_regmap,
}; };
static struct regulator_ops tps65090_fet_control_ops = { static const struct regulator_ops tps65090_fet_control_ops = {
.enable = tps65090_fet_enable, .enable = tps65090_fet_enable,
.disable = regulator_disable_regmap, .disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap, .is_enabled = regulator_is_enabled_regmap,
}; };
static struct regulator_ops tps65090_ldo_ops = { static const struct regulator_ops tps65090_ldo_ops = {
}; };
#define tps65090_REG_DESC(_id, _sname, _en_reg, _en_bits, _nvolt, _volt, _ops) \ #define tps65090_REG_DESC(_id, _sname, _en_reg, _en_bits, _nvolt, _volt, _ops) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment