Commit b08af72d authored by Rikard Falkeborn's avatar Rikard Falkeborn Committed by Mark Brown

regulator: max8907: Constify static structs

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
   2753    7328       0   10081    2761 drivers/regulator/max8907-regulator.o

After:
   text    data     bss     dec     hex filename
   9405     684       0   10089    2769 drivers/regulator/max8907-regulator.o
Signed-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20200617223247.25566-5-rikard.falkeborn@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b37f076d
...@@ -109,7 +109,7 @@ struct max8907_regulator { ...@@ -109,7 +109,7 @@ struct max8907_regulator {
static const struct regulator_ops max8907_mbatt_ops = { static const struct regulator_ops max8907_mbatt_ops = {
}; };
static struct regulator_ops max8907_ldo_ops = { static const struct regulator_ops max8907_ldo_ops = {
.list_voltage = regulator_list_voltage_linear, .list_voltage = regulator_list_voltage_linear,
.set_voltage_sel = regulator_set_voltage_sel_regmap, .set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap, .get_voltage_sel = regulator_get_voltage_sel_regmap,
...@@ -128,7 +128,7 @@ static const struct regulator_ops max8907_fixed_ops = { ...@@ -128,7 +128,7 @@ static const struct regulator_ops max8907_fixed_ops = {
.list_voltage = regulator_list_voltage_linear, .list_voltage = regulator_list_voltage_linear,
}; };
static struct regulator_ops max8907_out5v_ops = { static const struct regulator_ops max8907_out5v_ops = {
.list_voltage = regulator_list_voltage_linear, .list_voltage = regulator_list_voltage_linear,
.enable = regulator_enable_regmap, .enable = regulator_enable_regmap,
.disable = regulator_disable_regmap, .disable = regulator_disable_regmap,
...@@ -145,7 +145,7 @@ static const struct regulator_ops max8907_bbat_ops = { ...@@ -145,7 +145,7 @@ static const struct regulator_ops max8907_bbat_ops = {
.get_voltage_sel = regulator_get_voltage_sel_regmap, .get_voltage_sel = regulator_get_voltage_sel_regmap,
}; };
static struct regulator_desc max8907_regulators[] = { static const struct regulator_desc max8907_regulators[] = {
REG_MBATT(), REG_MBATT(),
REG_LDO(SD1, "in-v1", MAX8907_REG_SDCTL1, 650000, 2225000, 25000), REG_LDO(SD1, "in-v1", MAX8907_REG_SDCTL1, 650000, 2225000, 25000),
REG_LDO(SD2, "in-v2", MAX8907_REG_SDCTL2, 637500, 1425000, 12500), REG_LDO(SD2, "in-v2", MAX8907_REG_SDCTL2, 637500, 1425000, 12500),
......
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