diff options
author | Rikard Falkeborn <rikard.falkeborn@gmail.com> | 2020-06-29 21:46:31 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-07-01 18:33:14 +0100 |
commit | 8d41df6469eec8d784137aeeebf87dca7460ce37 (patch) | |
tree | 78e869d4f98bfae0c6d73cade16ee69a3b5e558a /drivers/regulator/qcom_rpm-regulator.c | |
parent | bfa29acd18e53ff44135f2eae2b942419a8582cc (diff) | |
download | linux-8d41df6469eec8d784137aeeebf87dca7460ce37.tar.bz2 |
regulator: qcom_rpm: Constify struct regulator_ops
These are never modified, so make them const to allow the compiler to
put them in read-only memory.
Before:
text data bss dec hex filename
17485 500 8 17993 4649 drivers/regulator/qcom_rpm-regulator.o
After:
text data bss dec hex filename
17881 104 8 17993 4649 drivers/regulator/qcom_rpm-regulator.o
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20200629194632.8147-2-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/qcom_rpm-regulator.c')
-rw-r--r-- | drivers/regulator/qcom_rpm-regulator.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator/qcom_rpm-regulator.c index 0066f850f15d..7f9d66ac37ff 100644 --- a/drivers/regulator/qcom_rpm-regulator.c +++ b/drivers/regulator/qcom_rpm-regulator.c @@ -407,7 +407,7 @@ static int rpm_reg_set_load(struct regulator_dev *rdev, int load_uA) return ret; } -static struct regulator_ops uV_ops = { +static const struct regulator_ops uV_ops = { .list_voltage = regulator_list_voltage_linear_range, .set_voltage_sel = rpm_reg_set_uV_sel, @@ -420,7 +420,7 @@ static struct regulator_ops uV_ops = { .set_load = rpm_reg_set_load, }; -static struct regulator_ops mV_ops = { +static const struct regulator_ops mV_ops = { .list_voltage = regulator_list_voltage_linear_range, .set_voltage_sel = rpm_reg_set_mV_sel, @@ -433,7 +433,7 @@ static struct regulator_ops mV_ops = { .set_load = rpm_reg_set_load, }; -static struct regulator_ops switch_ops = { +static const struct regulator_ops switch_ops = { .enable = rpm_reg_switch_enable, .disable = rpm_reg_switch_disable, .is_enabled = rpm_reg_is_enabled, |