diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-05-16 06:20:34 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-05-27 05:49:10 -0400 |
commit | ecb9c4f5956afa2ca0a20a1f99932b9ff81de854 (patch) | |
tree | 185fd3b201008a711a99d7b0712e96e6639bed18 /drivers | |
parent | 0514e9acd7655c708fbf12a659ea43d835bc688a (diff) |
regulator: Remove MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros
In current implementation, the original macro implementation assumes the caller
pass the parameter starting from 1 (to match the register names in datasheet).
Thus we have unneeded plus one then minus one operations
when using MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros.
This patch removes these macros to avoid unneeded plus one then minus one operations
without reducing readability.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/max8997.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index b1c1444864b3..10d5a1d9768e 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c | |||
@@ -1032,11 +1032,11 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) | |||
1032 | 1032 | ||
1033 | /* For the safety, set max voltage before setting up */ | 1033 | /* For the safety, set max voltage before setting up */ |
1034 | for (i = 0; i < 8; i++) { | 1034 | for (i = 0; i < 8; i++) { |
1035 | max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS(i + 1), | 1035 | max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS1 + i, |
1036 | max_buck1, 0x3f); | 1036 | max_buck1, 0x3f); |
1037 | max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS(i + 1), | 1037 | max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS1 + i, |
1038 | max_buck2, 0x3f); | 1038 | max_buck2, 0x3f); |
1039 | max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS(i + 1), | 1039 | max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS1 + i, |
1040 | max_buck5, 0x3f); | 1040 | max_buck5, 0x3f); |
1041 | } | 1041 | } |
1042 | 1042 | ||
@@ -1113,13 +1113,13 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev) | |||
1113 | 1113 | ||
1114 | /* Initialize all the DVS related BUCK registers */ | 1114 | /* Initialize all the DVS related BUCK registers */ |
1115 | for (i = 0; i < 8; i++) { | 1115 | for (i = 0; i < 8; i++) { |
1116 | max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS(i + 1), | 1116 | max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS1 + i, |
1117 | max8997->buck1_vol[i], | 1117 | max8997->buck1_vol[i], |
1118 | 0x3f); | 1118 | 0x3f); |
1119 | max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS(i + 1), | 1119 | max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS1 + i, |
1120 | max8997->buck2_vol[i], | 1120 | max8997->buck2_vol[i], |
1121 | 0x3f); | 1121 | 0x3f); |
1122 | max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS(i + 1), | 1122 | max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS1 + i, |
1123 | max8997->buck5_vol[i], | 1123 | max8997->buck5_vol[i], |
1124 | 0x3f); | 1124 | 0x3f); |
1125 | } | 1125 | } |