aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2015-07-30 09:06:43 -0400
committerMark Brown <broonie@kernel.org>2015-08-03 12:22:37 -0400
commit08b472f7b602c60c69f278ba1e15535f5c86ee24 (patch)
tree5536bd93028056e8c4437204890e84134316887f
parent53e381627d34c4c7a3ea00c041c38f447828f755 (diff)
regulator: mt6311: Trivial clean up
Make mt6311_buck_ops, mt6311_ldo_ops and mt6311_regulators const and remove unneeded error variable in mt6311_i2c_probe(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/regulator/mt6311-regulator.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/regulator/mt6311-regulator.c b/drivers/regulator/mt6311-regulator.c
index b140da04a657..2c2c85bf08c5 100644
--- a/drivers/regulator/mt6311-regulator.c
+++ b/drivers/regulator/mt6311-regulator.c
@@ -41,7 +41,7 @@ static const struct regulator_linear_range buck_volt_range[] = {
41 REGULATOR_LINEAR_RANGE(MT6311_MIN_UV, 0, 0x7f, MT6311_STEP_UV), 41 REGULATOR_LINEAR_RANGE(MT6311_MIN_UV, 0, 0x7f, MT6311_STEP_UV),
42}; 42};
43 43
44static struct regulator_ops mt6311_buck_ops = { 44static const struct regulator_ops mt6311_buck_ops = {
45 .list_voltage = regulator_list_voltage_linear_range, 45 .list_voltage = regulator_list_voltage_linear_range,
46 .map_voltage = regulator_map_voltage_linear_range, 46 .map_voltage = regulator_map_voltage_linear_range,
47 .set_voltage_sel = regulator_set_voltage_sel_regmap, 47 .set_voltage_sel = regulator_set_voltage_sel_regmap,
@@ -52,7 +52,7 @@ static struct regulator_ops mt6311_buck_ops = {
52 .is_enabled = regulator_is_enabled_regmap, 52 .is_enabled = regulator_is_enabled_regmap,
53}; 53};
54 54
55static struct regulator_ops mt6311_ldo_ops = { 55static const struct regulator_ops mt6311_ldo_ops = {
56 .enable = regulator_enable_regmap, 56 .enable = regulator_enable_regmap,
57 .disable = regulator_disable_regmap, 57 .disable = regulator_disable_regmap,
58 .is_enabled = regulator_is_enabled_regmap, 58 .is_enabled = regulator_is_enabled_regmap,
@@ -91,7 +91,7 @@ static struct regulator_ops mt6311_ldo_ops = {
91 .enable_mask = MT6311_PMIC_RG_VBIASN_EN_MASK,\ 91 .enable_mask = MT6311_PMIC_RG_VBIASN_EN_MASK,\
92} 92}
93 93
94static struct regulator_desc mt6311_regulators[] = { 94static const struct regulator_desc mt6311_regulators[] = {
95 MT6311_BUCK(VDVFS), 95 MT6311_BUCK(VDVFS),
96 MT6311_LDO(VBIASN), 96 MT6311_LDO(VBIASN),
97}; 97};
@@ -105,15 +105,15 @@ static int mt6311_i2c_probe(struct i2c_client *i2c,
105 struct regulator_config config = { }; 105 struct regulator_config config = { };
106 struct regulator_dev *rdev; 106 struct regulator_dev *rdev;
107 struct regmap *regmap; 107 struct regmap *regmap;
108 int error, i, ret; 108 int i, ret;
109 unsigned int data; 109 unsigned int data;
110 110
111 regmap = devm_regmap_init_i2c(i2c, &mt6311_regmap_config); 111 regmap = devm_regmap_init_i2c(i2c, &mt6311_regmap_config);
112 if (IS_ERR(regmap)) { 112 if (IS_ERR(regmap)) {
113 error = PTR_ERR(regmap); 113 ret = PTR_ERR(regmap);
114 dev_err(&i2c->dev, "Failed to allocate register map: %d\n", 114 dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
115 error); 115 ret);
116 return error; 116 return ret;
117 } 117 }
118 118
119 ret = regmap_read(regmap, MT6311_SWCID, &data); 119 ret = regmap_read(regmap, MT6311_SWCID, &data);