Commit 08b472f7 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

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: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 53e38162
...@@ -41,7 +41,7 @@ static const struct regulator_linear_range buck_volt_range[] = { ...@@ -41,7 +41,7 @@ static const struct regulator_linear_range buck_volt_range[] = {
REGULATOR_LINEAR_RANGE(MT6311_MIN_UV, 0, 0x7f, MT6311_STEP_UV), REGULATOR_LINEAR_RANGE(MT6311_MIN_UV, 0, 0x7f, MT6311_STEP_UV),
}; };
static struct regulator_ops mt6311_buck_ops = { static const struct regulator_ops mt6311_buck_ops = {
.list_voltage = regulator_list_voltage_linear_range, .list_voltage = regulator_list_voltage_linear_range,
.map_voltage = regulator_map_voltage_linear_range, .map_voltage = regulator_map_voltage_linear_range,
.set_voltage_sel = regulator_set_voltage_sel_regmap, .set_voltage_sel = regulator_set_voltage_sel_regmap,
...@@ -52,7 +52,7 @@ static struct regulator_ops mt6311_buck_ops = { ...@@ -52,7 +52,7 @@ static struct regulator_ops mt6311_buck_ops = {
.is_enabled = regulator_is_enabled_regmap, .is_enabled = regulator_is_enabled_regmap,
}; };
static struct regulator_ops mt6311_ldo_ops = { static const struct regulator_ops mt6311_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,
...@@ -91,7 +91,7 @@ static struct regulator_ops mt6311_ldo_ops = { ...@@ -91,7 +91,7 @@ static struct regulator_ops mt6311_ldo_ops = {
.enable_mask = MT6311_PMIC_RG_VBIASN_EN_MASK,\ .enable_mask = MT6311_PMIC_RG_VBIASN_EN_MASK,\
} }
static struct regulator_desc mt6311_regulators[] = { static const struct regulator_desc mt6311_regulators[] = {
MT6311_BUCK(VDVFS), MT6311_BUCK(VDVFS),
MT6311_LDO(VBIASN), MT6311_LDO(VBIASN),
}; };
...@@ -105,15 +105,15 @@ static int mt6311_i2c_probe(struct i2c_client *i2c, ...@@ -105,15 +105,15 @@ static int mt6311_i2c_probe(struct i2c_client *i2c,
struct regulator_config config = { }; struct regulator_config config = { };
struct regulator_dev *rdev; struct regulator_dev *rdev;
struct regmap *regmap; struct regmap *regmap;
int error, i, ret; int i, ret;
unsigned int data; unsigned int data;
regmap = devm_regmap_init_i2c(i2c, &mt6311_regmap_config); regmap = devm_regmap_init_i2c(i2c, &mt6311_regmap_config);
if (IS_ERR(regmap)) { if (IS_ERR(regmap)) {
error = PTR_ERR(regmap); ret = PTR_ERR(regmap);
dev_err(&i2c->dev, "Failed to allocate register map: %d\n", dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
error); ret);
return error; return ret;
} }
ret = regmap_read(regmap, MT6311_SWCID, &data); ret = regmap_read(regmap, MT6311_SWCID, &data);
......
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