Commit 9ed84d24 authored by Rikard Falkeborn's avatar Rikard Falkeborn Committed by Mark Brown

regulator: max8997: Constify struct regulator_ops

These are not modified so make them const to allow the compiler to put
them in read-only memory.

Before:
   text    data     bss     dec     hex filename
  13114    8596       0   21710    54ce drivers/regulator/max8997-regulator.o

After:
   text    data     bss     dec     hex filename
  14038    7672       0   21710    54ce drivers/regulator/max8997-regulator.o
Signed-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20200617223247.25566-6-rikard.falkeborn@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b08af72d
...@@ -732,7 +732,7 @@ static int max8997_reg_disable_suspend(struct regulator_dev *rdev) ...@@ -732,7 +732,7 @@ static int max8997_reg_disable_suspend(struct regulator_dev *rdev)
return max8997_update_reg(i2c, reg, ~pattern, mask); return max8997_update_reg(i2c, reg, ~pattern, mask);
} }
static struct regulator_ops max8997_ldo_ops = { static const struct regulator_ops max8997_ldo_ops = {
.list_voltage = max8997_list_voltage, .list_voltage = max8997_list_voltage,
.is_enabled = max8997_reg_is_enabled, .is_enabled = max8997_reg_is_enabled,
.enable = max8997_reg_enable, .enable = max8997_reg_enable,
...@@ -742,7 +742,7 @@ static struct regulator_ops max8997_ldo_ops = { ...@@ -742,7 +742,7 @@ static struct regulator_ops max8997_ldo_ops = {
.set_suspend_disable = max8997_reg_disable_suspend, .set_suspend_disable = max8997_reg_disable_suspend,
}; };
static struct regulator_ops max8997_buck_ops = { static const struct regulator_ops max8997_buck_ops = {
.list_voltage = max8997_list_voltage, .list_voltage = max8997_list_voltage,
.is_enabled = max8997_reg_is_enabled, .is_enabled = max8997_reg_is_enabled,
.enable = max8997_reg_enable, .enable = max8997_reg_enable,
...@@ -753,7 +753,7 @@ static struct regulator_ops max8997_buck_ops = { ...@@ -753,7 +753,7 @@ static struct regulator_ops max8997_buck_ops = {
.set_suspend_disable = max8997_reg_disable_suspend, .set_suspend_disable = max8997_reg_disable_suspend,
}; };
static struct regulator_ops max8997_fixedvolt_ops = { static const struct regulator_ops max8997_fixedvolt_ops = {
.list_voltage = max8997_list_voltage, .list_voltage = max8997_list_voltage,
.is_enabled = max8997_reg_is_enabled, .is_enabled = max8997_reg_is_enabled,
.enable = max8997_reg_enable, .enable = max8997_reg_enable,
...@@ -761,7 +761,7 @@ static struct regulator_ops max8997_fixedvolt_ops = { ...@@ -761,7 +761,7 @@ static struct regulator_ops max8997_fixedvolt_ops = {
.set_suspend_disable = max8997_reg_disable_suspend, .set_suspend_disable = max8997_reg_disable_suspend,
}; };
static struct regulator_ops max8997_safeout_ops = { static const struct regulator_ops max8997_safeout_ops = {
.list_voltage = regulator_list_voltage_table, .list_voltage = regulator_list_voltage_table,
.is_enabled = max8997_reg_is_enabled, .is_enabled = max8997_reg_is_enabled,
.enable = max8997_reg_enable, .enable = max8997_reg_enable,
...@@ -771,7 +771,7 @@ static struct regulator_ops max8997_safeout_ops = { ...@@ -771,7 +771,7 @@ static struct regulator_ops max8997_safeout_ops = {
.set_suspend_disable = max8997_reg_disable_suspend, .set_suspend_disable = max8997_reg_disable_suspend,
}; };
static struct regulator_ops max8997_fixedstate_ops = { static const struct regulator_ops max8997_fixedstate_ops = {
.list_voltage = max8997_list_voltage_charger_cv, .list_voltage = max8997_list_voltage_charger_cv,
.get_voltage_sel = max8997_get_voltage_sel, .get_voltage_sel = max8997_get_voltage_sel,
.set_voltage = max8997_set_voltage_charger_cv, .set_voltage = max8997_set_voltage_charger_cv,
...@@ -805,7 +805,7 @@ static int max8997_get_current_limit(struct regulator_dev *rdev) ...@@ -805,7 +805,7 @@ static int max8997_get_current_limit(struct regulator_dev *rdev)
return max8997_list_voltage(rdev, sel); return max8997_list_voltage(rdev, sel);
} }
static struct regulator_ops max8997_charger_ops = { static const struct regulator_ops max8997_charger_ops = {
.is_enabled = max8997_reg_is_enabled, .is_enabled = max8997_reg_is_enabled,
.enable = max8997_reg_enable, .enable = max8997_reg_enable,
.disable = max8997_reg_disable, .disable = max8997_reg_disable,
...@@ -813,7 +813,7 @@ static struct regulator_ops max8997_charger_ops = { ...@@ -813,7 +813,7 @@ static struct regulator_ops max8997_charger_ops = {
.set_current_limit = max8997_set_current_limit, .set_current_limit = max8997_set_current_limit,
}; };
static struct regulator_ops max8997_charger_fixedstate_ops = { static const struct regulator_ops max8997_charger_fixedstate_ops = {
.get_current_limit = max8997_get_current_limit, .get_current_limit = max8997_get_current_limit,
.set_current_limit = max8997_set_current_limit, .set_current_limit = max8997_set_current_limit,
}; };
......
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