diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-02-29 20:27:29 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-03-11 16:48:47 -0400 |
commit | 7b94791be6fb1c52c5ccb2cfde793da6c6b541b0 (patch) | |
tree | 0de4e357f76a21131674cf341cc379a7e255272e /drivers | |
parent | b3e1348e2753a8c8d17e620ae79ce0c9fa43f40c (diff) |
regulator: Kill max8998_get_ldo function
Use rdev_get_id() directly.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/max8998.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/regulator/max8998.c b/drivers/regulator/max8998.c index 2d38c2493a07..634f2575b93f 100644 --- a/drivers/regulator/max8998.c +++ b/drivers/regulator/max8998.c | |||
@@ -112,16 +112,11 @@ static const struct voltage_map_desc *ldo_voltage_map[] = { | |||
112 | &buck4_voltage_map_desc, /* BUCK4 */ | 112 | &buck4_voltage_map_desc, /* BUCK4 */ |
113 | }; | 113 | }; |
114 | 114 | ||
115 | static inline int max8998_get_ldo(struct regulator_dev *rdev) | ||
116 | { | ||
117 | return rdev_get_id(rdev); | ||
118 | } | ||
119 | |||
120 | static int max8998_list_voltage(struct regulator_dev *rdev, | 115 | static int max8998_list_voltage(struct regulator_dev *rdev, |
121 | unsigned int selector) | 116 | unsigned int selector) |
122 | { | 117 | { |
123 | const struct voltage_map_desc *desc; | 118 | const struct voltage_map_desc *desc; |
124 | int ldo = max8998_get_ldo(rdev); | 119 | int ldo = rdev_get_id(rdev); |
125 | int val; | 120 | int val; |
126 | 121 | ||
127 | if (ldo >= ARRAY_SIZE(ldo_voltage_map)) | 122 | if (ldo >= ARRAY_SIZE(ldo_voltage_map)) |
@@ -141,7 +136,7 @@ static int max8998_list_voltage(struct regulator_dev *rdev, | |||
141 | static int max8998_get_enable_register(struct regulator_dev *rdev, | 136 | static int max8998_get_enable_register(struct regulator_dev *rdev, |
142 | int *reg, int *shift) | 137 | int *reg, int *shift) |
143 | { | 138 | { |
144 | int ldo = max8998_get_ldo(rdev); | 139 | int ldo = rdev_get_id(rdev); |
145 | 140 | ||
146 | switch (ldo) { | 141 | switch (ldo) { |
147 | case MAX8998_LDO2 ... MAX8998_LDO5: | 142 | case MAX8998_LDO2 ... MAX8998_LDO5: |
@@ -222,7 +217,7 @@ static int max8998_ldo_disable(struct regulator_dev *rdev) | |||
222 | static int max8998_get_voltage_register(struct regulator_dev *rdev, | 217 | static int max8998_get_voltage_register(struct regulator_dev *rdev, |
223 | int *_reg, int *_shift, int *_mask) | 218 | int *_reg, int *_shift, int *_mask) |
224 | { | 219 | { |
225 | int ldo = max8998_get_ldo(rdev); | 220 | int ldo = rdev_get_id(rdev); |
226 | struct max8998_data *max8998 = rdev_get_drvdata(rdev); | 221 | struct max8998_data *max8998 = rdev_get_drvdata(rdev); |
227 | int reg, shift = 0, mask = 0xff; | 222 | int reg, shift = 0, mask = 0xff; |
228 | 223 | ||
@@ -310,7 +305,7 @@ static int max8998_set_voltage_ldo(struct regulator_dev *rdev, | |||
310 | struct i2c_client *i2c = max8998->iodev->i2c; | 305 | struct i2c_client *i2c = max8998->iodev->i2c; |
311 | int min_vol = min_uV / 1000, max_vol = max_uV / 1000; | 306 | int min_vol = min_uV / 1000, max_vol = max_uV / 1000; |
312 | const struct voltage_map_desc *desc; | 307 | const struct voltage_map_desc *desc; |
313 | int ldo = max8998_get_ldo(rdev); | 308 | int ldo = rdev_get_id(rdev); |
314 | int reg, shift = 0, mask, ret; | 309 | int reg, shift = 0, mask, ret; |
315 | int i = 0; | 310 | int i = 0; |
316 | 311 | ||
@@ -362,7 +357,7 @@ static int max8998_set_voltage_buck(struct regulator_dev *rdev, | |||
362 | struct i2c_client *i2c = max8998->iodev->i2c; | 357 | struct i2c_client *i2c = max8998->iodev->i2c; |
363 | int min_vol = min_uV / 1000, max_vol = max_uV / 1000; | 358 | int min_vol = min_uV / 1000, max_vol = max_uV / 1000; |
364 | const struct voltage_map_desc *desc; | 359 | const struct voltage_map_desc *desc; |
365 | int buck = max8998_get_ldo(rdev); | 360 | int buck = rdev_get_id(rdev); |
366 | int reg, shift = 0, mask, ret; | 361 | int reg, shift = 0, mask, ret; |
367 | int difference = 0, i = 0, j = 0, previous_vol = 0; | 362 | int difference = 0, i = 0, j = 0, previous_vol = 0; |
368 | u8 val = 0; | 363 | u8 val = 0; |