regulator: mc13xxx: Constify regulator_ops variables

These regulator_ops variables should never change, make them const.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Axel Lin 2019-03-01 22:20:53 +08:00 committed by Mark Brown
parent ad542a527c
commit e5680c4de3
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
4 changed files with 10 additions and 10 deletions

View File

@ -226,7 +226,7 @@ static const unsigned int mc13783_pwgtdrv_val[] = {
5500000, 5500000,
}; };
static struct regulator_ops mc13783_gpo_regulator_ops; static const struct regulator_ops mc13783_gpo_regulator_ops;
#define MC13783_DEFINE(prefix, name, node, reg, vsel_reg, voltages) \ #define MC13783_DEFINE(prefix, name, node, reg, vsel_reg, voltages) \
MC13xxx_DEFINE(MC13783_REG_, name, node, reg, vsel_reg, voltages, \ MC13xxx_DEFINE(MC13783_REG_, name, node, reg, vsel_reg, voltages, \
@ -380,7 +380,7 @@ static int mc13783_gpo_regulator_is_enabled(struct regulator_dev *rdev)
return (val & mc13xxx_regulators[id].enable_bit) != 0; return (val & mc13xxx_regulators[id].enable_bit) != 0;
} }
static struct regulator_ops mc13783_gpo_regulator_ops = { static const struct regulator_ops mc13783_gpo_regulator_ops = {
.enable = mc13783_gpo_regulator_enable, .enable = mc13783_gpo_regulator_enable,
.disable = mc13783_gpo_regulator_disable, .disable = mc13783_gpo_regulator_disable,
.is_enabled = mc13783_gpo_regulator_is_enabled, .is_enabled = mc13783_gpo_regulator_is_enabled,

View File

@ -242,8 +242,8 @@ static const unsigned int mc13892_pwgtdrv[] = {
5000000, 5000000,
}; };
static struct regulator_ops mc13892_gpo_regulator_ops; static const struct regulator_ops mc13892_gpo_regulator_ops;
static struct regulator_ops mc13892_sw_regulator_ops; static const struct regulator_ops mc13892_sw_regulator_ops;
#define MC13892_FIXED_DEFINE(name, node, reg, voltages) \ #define MC13892_FIXED_DEFINE(name, node, reg, voltages) \
@ -387,7 +387,7 @@ static int mc13892_gpo_regulator_is_enabled(struct regulator_dev *rdev)
} }
static struct regulator_ops mc13892_gpo_regulator_ops = { static const struct regulator_ops mc13892_gpo_regulator_ops = {
.enable = mc13892_gpo_regulator_enable, .enable = mc13892_gpo_regulator_enable,
.disable = mc13892_gpo_regulator_disable, .disable = mc13892_gpo_regulator_disable,
.is_enabled = mc13892_gpo_regulator_is_enabled, .is_enabled = mc13892_gpo_regulator_is_enabled,
@ -479,7 +479,7 @@ static int mc13892_sw_regulator_set_voltage_sel(struct regulator_dev *rdev,
return ret; return ret;
} }
static struct regulator_ops mc13892_sw_regulator_ops = { static const struct regulator_ops mc13892_sw_regulator_ops = {
.list_voltage = regulator_list_voltage_table, .list_voltage = regulator_list_voltage_table,
.map_voltage = regulator_map_voltage_ascend, .map_voltage = regulator_map_voltage_ascend,
.set_voltage_sel = mc13892_sw_regulator_set_voltage_sel, .set_voltage_sel = mc13892_sw_regulator_set_voltage_sel,

View File

@ -99,7 +99,7 @@ static int mc13xxx_regulator_get_voltage(struct regulator_dev *rdev)
return rdev->desc->volt_table[val]; return rdev->desc->volt_table[val];
} }
struct regulator_ops mc13xxx_regulator_ops = { const struct regulator_ops mc13xxx_regulator_ops = {
.enable = mc13xxx_regulator_enable, .enable = mc13xxx_regulator_enable,
.disable = mc13xxx_regulator_disable, .disable = mc13xxx_regulator_disable,
.is_enabled = mc13xxx_regulator_is_enabled, .is_enabled = mc13xxx_regulator_is_enabled,
@ -127,7 +127,7 @@ int mc13xxx_fixed_regulator_set_voltage(struct regulator_dev *rdev, int min_uV,
} }
EXPORT_SYMBOL_GPL(mc13xxx_fixed_regulator_set_voltage); EXPORT_SYMBOL_GPL(mc13xxx_fixed_regulator_set_voltage);
struct regulator_ops mc13xxx_fixed_regulator_ops = { const struct regulator_ops mc13xxx_fixed_regulator_ops = {
.enable = mc13xxx_regulator_enable, .enable = mc13xxx_regulator_enable,
.disable = mc13xxx_regulator_disable, .disable = mc13xxx_regulator_disable,
.is_enabled = mc13xxx_regulator_is_enabled, .is_enabled = mc13xxx_regulator_is_enabled,

View File

@ -53,8 +53,8 @@ static inline struct mc13xxx_regulator_init_data *mc13xxx_parse_regulators_dt(
} }
#endif #endif
extern struct regulator_ops mc13xxx_regulator_ops; extern const struct regulator_ops mc13xxx_regulator_ops;
extern struct regulator_ops mc13xxx_fixed_regulator_ops; extern const struct regulator_ops mc13xxx_fixed_regulator_ops;
#define MC13xxx_DEFINE(prefix, _name, _node, _reg, _vsel_reg, _voltages, _ops) \ #define MC13xxx_DEFINE(prefix, _name, _node, _reg, _vsel_reg, _voltages, _ops) \
[prefix ## _name] = { \ [prefix ## _name] = { \