diff options
author | Axel Lin <axel.lin@ingics.com> | 2016-06-21 02:59:11 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-06-21 13:43:48 -0400 |
commit | 4335f6537a62df50c049427134fe07d9bc6354ab (patch) | |
tree | de6ccaa84748df6e108ba178f993ef0e0d1739e9 | |
parent | 1a695a905c18548062509178b98bc91e67510864 (diff) |
regulator: lp873x: Drop _nlr parameter from LP873X_REGULATOR()
No need to pass _nlr to LP873X_REGULATOR(), use ARRAY_SIZE to calculate it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/regulator/lp873x-regulator.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/regulator/lp873x-regulator.c b/drivers/regulator/lp873x-regulator.c index b4ffd113ba21..e504b9148226 100644 --- a/drivers/regulator/lp873x-regulator.c +++ b/drivers/regulator/lp873x-regulator.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/mfd/lp873x.h> | 20 | #include <linux/mfd/lp873x.h> |
21 | 21 | ||
22 | #define LP873X_REGULATOR(_name, _id, _of, _ops, _n, _vr, _vm, _er, _em, \ | 22 | #define LP873X_REGULATOR(_name, _id, _of, _ops, _n, _vr, _vm, _er, _em, \ |
23 | _delay, _lr, _nlr, _cr) \ | 23 | _delay, _lr, _cr) \ |
24 | [_id] = { \ | 24 | [_id] = { \ |
25 | .desc = { \ | 25 | .desc = { \ |
26 | .name = _name, \ | 26 | .name = _name, \ |
@@ -37,7 +37,7 @@ | |||
37 | .enable_mask = _em, \ | 37 | .enable_mask = _em, \ |
38 | .ramp_delay = _delay, \ | 38 | .ramp_delay = _delay, \ |
39 | .linear_ranges = _lr, \ | 39 | .linear_ranges = _lr, \ |
40 | .n_linear_ranges = _nlr, \ | 40 | .n_linear_ranges = ARRAY_SIZE(_lr), \ |
41 | }, \ | 41 | }, \ |
42 | .ctrl2_reg = _cr, \ | 42 | .ctrl2_reg = _cr, \ |
43 | } | 43 | } |
@@ -175,22 +175,20 @@ static const struct lp873x_regulator regulators[] = { | |||
175 | 256, LP873X_REG_BUCK0_VOUT, | 175 | 256, LP873X_REG_BUCK0_VOUT, |
176 | LP873X_BUCK0_VOUT_BUCK0_VSET, LP873X_REG_BUCK0_CTRL_1, | 176 | LP873X_BUCK0_VOUT_BUCK0_VSET, LP873X_REG_BUCK0_CTRL_1, |
177 | LP873X_BUCK0_CTRL_1_BUCK0_EN, 10000, | 177 | LP873X_BUCK0_CTRL_1_BUCK0_EN, 10000, |
178 | buck0_buck1_ranges, 4, LP873X_REG_BUCK0_CTRL_2), | 178 | buck0_buck1_ranges, LP873X_REG_BUCK0_CTRL_2), |
179 | LP873X_REGULATOR("BUCK1", LP873X_BUCK_1, "buck1", lp873x_buck01_ops, | 179 | LP873X_REGULATOR("BUCK1", LP873X_BUCK_1, "buck1", lp873x_buck01_ops, |
180 | 256, LP873X_REG_BUCK1_VOUT, | 180 | 256, LP873X_REG_BUCK1_VOUT, |
181 | LP873X_BUCK1_VOUT_BUCK1_VSET, LP873X_REG_BUCK1_CTRL_1, | 181 | LP873X_BUCK1_VOUT_BUCK1_VSET, LP873X_REG_BUCK1_CTRL_1, |
182 | LP873X_BUCK1_CTRL_1_BUCK1_EN, 10000, | 182 | LP873X_BUCK1_CTRL_1_BUCK1_EN, 10000, |
183 | buck0_buck1_ranges, 4, LP873X_REG_BUCK1_CTRL_2), | 183 | buck0_buck1_ranges, LP873X_REG_BUCK1_CTRL_2), |
184 | LP873X_REGULATOR("LDO0", LP873X_LDO_0, "ldo0", lp873x_ldo01_ops, 26, | 184 | LP873X_REGULATOR("LDO0", LP873X_LDO_0, "ldo0", lp873x_ldo01_ops, 26, |
185 | LP873X_REG_LDO0_VOUT, LP873X_LDO0_VOUT_LDO0_VSET, | 185 | LP873X_REG_LDO0_VOUT, LP873X_LDO0_VOUT_LDO0_VSET, |
186 | LP873X_REG_LDO0_CTRL, | 186 | LP873X_REG_LDO0_CTRL, |
187 | LP873X_LDO0_CTRL_LDO0_EN, 0, ldo0_ldo1_ranges, 1, | 187 | LP873X_LDO0_CTRL_LDO0_EN, 0, ldo0_ldo1_ranges, 0xFF), |
188 | 0xFF), | ||
189 | LP873X_REGULATOR("LDO1", LP873X_LDO_1, "ldo1", lp873x_ldo01_ops, 26, | 188 | LP873X_REGULATOR("LDO1", LP873X_LDO_1, "ldo1", lp873x_ldo01_ops, 26, |
190 | LP873X_REG_LDO1_VOUT, LP873X_LDO1_VOUT_LDO1_VSET, | 189 | LP873X_REG_LDO1_VOUT, LP873X_LDO1_VOUT_LDO1_VSET, |
191 | LP873X_REG_LDO1_CTRL, | 190 | LP873X_REG_LDO1_CTRL, |
192 | LP873X_LDO1_CTRL_LDO1_EN, 0, ldo0_ldo1_ranges, 1, | 191 | LP873X_LDO1_CTRL_LDO1_EN, 0, ldo0_ldo1_ranges, 0xFF), |
193 | 0xFF), | ||
194 | }; | 192 | }; |
195 | 193 | ||
196 | static int lp873x_regulator_probe(struct platform_device *pdev) | 194 | static int lp873x_regulator_probe(struct platform_device *pdev) |