]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
regulator: anatop: Remove checking control_reg in [set|get]_voltage_sel
authorAxel Lin <axel.lin@ingics.com>
Sat, 22 Feb 2014 04:53:18 +0000 (12:53 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:16:28 +0000 (21:16 -0600)
Remove checking control_reg in [set|get]_voltage_sel and then convert to use
regulator_[set|get]_voltage_sel_regmap for [set|get]_voltage_sel callbacks.

The anatop-reg-offset property is a required property rather than optional
property. So the question is what is the meaning of setting anatop-reg-offset
to 0? If 0 is a valid setting for anatop-reg-offset and it has special meaning,
we had better document it in the binding document. Otherwise, remove the testing
for control_reg in the driver.

No anatop voltage regulator node in the dts files set anatop-reg-offset to 0.
So I think it's safe to remove testing if control_reg is 0.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
[shawn.guo: cherry-pick commit 114c5748d540 from upstream]
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
drivers/regulator/anatop-regulator.c

index 38e8122c4b09d351cab212e0011eaaed095a5a01..7c397bb81e01eb3f8cba61472e4d15b47e16ddc8 100644 (file)
@@ -55,17 +55,6 @@ struct anatop_regulator {
        int sel;
 };
 
-static int anatop_regmap_set_voltage_sel(struct regulator_dev *reg,
-                                       unsigned selector)
-{
-       struct anatop_regulator *anatop_reg = rdev_get_drvdata(reg);
-
-       if (!anatop_reg->control_reg)
-               return -ENOTSUPP;
-
-       return regulator_set_voltage_sel_regmap(reg, selector);
-}
-
 static int anatop_regmap_set_voltage_time_sel(struct regulator_dev *reg,
        unsigned int old_sel,
        unsigned int new_sel)
@@ -92,16 +81,6 @@ static int anatop_regmap_set_voltage_time_sel(struct regulator_dev *reg,
        return ret;
 }
 
-static int anatop_regmap_get_voltage_sel(struct regulator_dev *reg)
-{
-       struct anatop_regulator *anatop_reg = rdev_get_drvdata(reg);
-
-       if (!anatop_reg->control_reg)
-               return -ENOTSUPP;
-
-       return regulator_get_voltage_sel_regmap(reg);
-}
-
 static int anatop_regmap_enable(struct regulator_dev *reg)
 {
        struct anatop_regulator *anatop_reg = rdev_get_drvdata(reg);
@@ -178,8 +157,8 @@ static int anatop_regmap_set_bypass(struct regulator_dev *reg, bool enable)
 }
 
 static struct regulator_ops anatop_rops = {
-       .set_voltage_sel = anatop_regmap_set_voltage_sel,
-       .get_voltage_sel = anatop_regmap_get_voltage_sel,
+       .set_voltage_sel = regulator_set_voltage_sel_regmap,
+       .get_voltage_sel = regulator_get_voltage_sel_regmap,
        .list_voltage = regulator_list_voltage_linear,
        .map_voltage = regulator_map_voltage_linear,
 };