Commit d69323ee authored by Mark Brown's avatar Mark Brown

Merge series "regulator/qcom: Constify static structs" from Rikard Falkeborn...

Merge series "regulator/qcom: Constify static structs" from Rikard Falkeborn <rikard.falkeborn@gmail.com>:

Constify some static structs to allow the compiler to put them in
read-only memory.

Rikard Falkeborn (2):
  regulator: qcom_rpm: Constify struct regulator_ops
  regulator: qcom_spmi: Constify struct regulator_ops

 drivers/regulator/qcom_rpm-regulator.c  |  6 +++---
 drivers/regulator/qcom_spmi-regulator.c | 24 ++++++++++++------------
 2 files changed, 15 insertions(+), 15 deletions(-)

--
2.27.0
parents e5abaf91 3b619e3e
...@@ -407,7 +407,7 @@ static int rpm_reg_set_load(struct regulator_dev *rdev, int load_uA) ...@@ -407,7 +407,7 @@ static int rpm_reg_set_load(struct regulator_dev *rdev, int load_uA)
return ret; return ret;
} }
static struct regulator_ops uV_ops = { static const struct regulator_ops uV_ops = {
.list_voltage = regulator_list_voltage_linear_range, .list_voltage = regulator_list_voltage_linear_range,
.set_voltage_sel = rpm_reg_set_uV_sel, .set_voltage_sel = rpm_reg_set_uV_sel,
...@@ -420,7 +420,7 @@ static struct regulator_ops uV_ops = { ...@@ -420,7 +420,7 @@ static struct regulator_ops uV_ops = {
.set_load = rpm_reg_set_load, .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, .list_voltage = regulator_list_voltage_linear_range,
.set_voltage_sel = rpm_reg_set_mV_sel, .set_voltage_sel = rpm_reg_set_mV_sel,
...@@ -433,7 +433,7 @@ static struct regulator_ops mV_ops = { ...@@ -433,7 +433,7 @@ static struct regulator_ops mV_ops = {
.set_load = rpm_reg_set_load, .set_load = rpm_reg_set_load,
}; };
static struct regulator_ops switch_ops = { static const struct regulator_ops switch_ops = {
.enable = rpm_reg_switch_enable, .enable = rpm_reg_switch_enable,
.disable = rpm_reg_switch_disable, .disable = rpm_reg_switch_disable,
.is_enabled = rpm_reg_is_enabled, .is_enabled = rpm_reg_is_enabled,
......
...@@ -380,7 +380,7 @@ struct spmi_regulator_mapping { ...@@ -380,7 +380,7 @@ struct spmi_regulator_mapping {
enum spmi_regulator_logical_type logical_type; enum spmi_regulator_logical_type logical_type;
u32 revision_min; u32 revision_min;
u32 revision_max; u32 revision_max;
struct regulator_ops *ops; const struct regulator_ops *ops;
struct spmi_voltage_set_points *set_points; struct spmi_voltage_set_points *set_points;
int hpm_min_load; int hpm_min_load;
}; };
...@@ -1261,7 +1261,7 @@ spmi_regulator_saw_set_voltage(struct regulator_dev *rdev, unsigned selector) ...@@ -1261,7 +1261,7 @@ spmi_regulator_saw_set_voltage(struct regulator_dev *rdev, unsigned selector)
static struct regulator_ops spmi_saw_ops = {}; static struct regulator_ops spmi_saw_ops = {};
static struct regulator_ops spmi_smps_ops = { static const struct regulator_ops spmi_smps_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,
...@@ -1276,7 +1276,7 @@ static struct regulator_ops spmi_smps_ops = { ...@@ -1276,7 +1276,7 @@ static struct regulator_ops spmi_smps_ops = {
.set_pull_down = spmi_regulator_common_set_pull_down, .set_pull_down = spmi_regulator_common_set_pull_down,
}; };
static struct regulator_ops spmi_ldo_ops = { static const struct regulator_ops spmi_ldo_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,
...@@ -1293,7 +1293,7 @@ static struct regulator_ops spmi_ldo_ops = { ...@@ -1293,7 +1293,7 @@ static struct regulator_ops spmi_ldo_ops = {
.set_soft_start = spmi_regulator_common_set_soft_start, .set_soft_start = spmi_regulator_common_set_soft_start,
}; };
static struct regulator_ops spmi_ln_ldo_ops = { static const struct regulator_ops spmi_ln_ldo_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,
...@@ -1305,7 +1305,7 @@ static struct regulator_ops spmi_ln_ldo_ops = { ...@@ -1305,7 +1305,7 @@ static struct regulator_ops spmi_ln_ldo_ops = {
.get_bypass = spmi_regulator_common_get_bypass, .get_bypass = spmi_regulator_common_get_bypass,
}; };
static struct regulator_ops spmi_vs_ops = { static const struct regulator_ops spmi_vs_ops = {
.enable = spmi_regulator_vs_enable, .enable = spmi_regulator_vs_enable,
.disable = regulator_disable_regmap, .disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap, .is_enabled = regulator_is_enabled_regmap,
...@@ -1316,7 +1316,7 @@ static struct regulator_ops spmi_vs_ops = { ...@@ -1316,7 +1316,7 @@ static struct regulator_ops spmi_vs_ops = {
.get_mode = spmi_regulator_common_get_mode, .get_mode = spmi_regulator_common_get_mode,
}; };
static struct regulator_ops spmi_boost_ops = { static const struct regulator_ops spmi_boost_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,
...@@ -1327,7 +1327,7 @@ static struct regulator_ops spmi_boost_ops = { ...@@ -1327,7 +1327,7 @@ static struct regulator_ops spmi_boost_ops = {
.set_input_current_limit = spmi_regulator_set_ilim, .set_input_current_limit = spmi_regulator_set_ilim,
}; };
static struct regulator_ops spmi_ftsmps_ops = { static const struct regulator_ops spmi_ftsmps_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,
...@@ -1342,7 +1342,7 @@ static struct regulator_ops spmi_ftsmps_ops = { ...@@ -1342,7 +1342,7 @@ static struct regulator_ops spmi_ftsmps_ops = {
.set_pull_down = spmi_regulator_common_set_pull_down, .set_pull_down = spmi_regulator_common_set_pull_down,
}; };
static struct regulator_ops spmi_ult_lo_smps_ops = { static const struct regulator_ops spmi_ult_lo_smps_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,
...@@ -1356,7 +1356,7 @@ static struct regulator_ops spmi_ult_lo_smps_ops = { ...@@ -1356,7 +1356,7 @@ static struct regulator_ops spmi_ult_lo_smps_ops = {
.set_pull_down = spmi_regulator_common_set_pull_down, .set_pull_down = spmi_regulator_common_set_pull_down,
}; };
static struct regulator_ops spmi_ult_ho_smps_ops = { static const struct regulator_ops spmi_ult_ho_smps_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,
...@@ -1371,7 +1371,7 @@ static struct regulator_ops spmi_ult_ho_smps_ops = { ...@@ -1371,7 +1371,7 @@ static struct regulator_ops spmi_ult_ho_smps_ops = {
.set_pull_down = spmi_regulator_common_set_pull_down, .set_pull_down = spmi_regulator_common_set_pull_down,
}; };
static struct regulator_ops spmi_ult_ldo_ops = { static const struct regulator_ops spmi_ult_ldo_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,
...@@ -1388,7 +1388,7 @@ static struct regulator_ops spmi_ult_ldo_ops = { ...@@ -1388,7 +1388,7 @@ static struct regulator_ops spmi_ult_ldo_ops = {
.set_soft_start = spmi_regulator_common_set_soft_start, .set_soft_start = spmi_regulator_common_set_soft_start,
}; };
static struct regulator_ops spmi_ftsmps426_ops = { static const struct regulator_ops spmi_ftsmps426_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,
...@@ -1403,7 +1403,7 @@ static struct regulator_ops spmi_ftsmps426_ops = { ...@@ -1403,7 +1403,7 @@ static struct regulator_ops spmi_ftsmps426_ops = {
.set_pull_down = spmi_regulator_common_set_pull_down, .set_pull_down = spmi_regulator_common_set_pull_down,
}; };
static struct regulator_ops spmi_hfs430_ops = { static const struct regulator_ops spmi_hfs430_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,
......
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