aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/s5m8767.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-01-31 02:13:31 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-02-02 08:50:27 -0500
commit20a14b84f8d62ba9ad7acad1d67a2ffa3c06468b (patch)
tree4509afd7364d94c9ede52f624dcdc179f179af66 /drivers/regulator/s5m8767.c
parent34ce8d07e63baa37d21aeca87f3248b008114899 (diff)
regulator: Kill s5m8767_get_reg_id function
Calling s5m8767_get_reg_id() is exactly the same as calling rdev_get_id(). It is pointless to add s5m8767_get_reg_id() function. Use rdev_get_id() directly and remove s5m8767_get_reg_id() function. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/s5m8767.c')
-rw-r--r--drivers/regulator/s5m8767.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index a5b9d83913f4..5b00e5ac70cd 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -120,16 +120,11 @@ static const struct s5m_voltage_desc *reg_voltage_map[] = {
120 [S5M8767_BUCK9] = &buck_voltage_val3, 120 [S5M8767_BUCK9] = &buck_voltage_val3,
121}; 121};
122 122
123static inline int s5m8767_get_reg_id(struct regulator_dev *rdev)
124{
125 return rdev_get_id(rdev);
126}
127
128static int s5m8767_list_voltage(struct regulator_dev *rdev, 123static int s5m8767_list_voltage(struct regulator_dev *rdev,
129 unsigned int selector) 124 unsigned int selector)
130{ 125{
131 const struct s5m_voltage_desc *desc; 126 const struct s5m_voltage_desc *desc;
132 int reg_id = s5m8767_get_reg_id(rdev); 127 int reg_id = rdev_get_id(rdev);
133 int val; 128 int val;
134 129
135 if (reg_id >= ARRAY_SIZE(reg_voltage_map) || reg_id < 0) 130 if (reg_id >= ARRAY_SIZE(reg_voltage_map) || reg_id < 0)
@@ -148,7 +143,7 @@ static int s5m8767_list_voltage(struct regulator_dev *rdev,
148 143
149static int s5m8767_get_register(struct regulator_dev *rdev, int *reg) 144static int s5m8767_get_register(struct regulator_dev *rdev, int *reg)
150{ 145{
151 int reg_id = s5m8767_get_reg_id(rdev); 146 int reg_id = rdev_get_id(rdev);
152 147
153 switch (reg_id) { 148 switch (reg_id) {
154 case S5M8767_LDO1 ... S5M8767_LDO2: 149 case S5M8767_LDO1 ... S5M8767_LDO2:
@@ -224,7 +219,7 @@ static int s5m8767_reg_disable(struct regulator_dev *rdev)
224 219
225static int s5m8767_get_voltage_register(struct regulator_dev *rdev, int *_reg) 220static int s5m8767_get_voltage_register(struct regulator_dev *rdev, int *_reg)
226{ 221{
227 int reg_id = s5m8767_get_reg_id(rdev); 222 int reg_id = rdev_get_id(rdev);
228 int reg; 223 int reg;
229 224
230 switch (reg_id) { 225 switch (reg_id) {
@@ -265,7 +260,7 @@ static int s5m8767_get_voltage_sel(struct regulator_dev *rdev)
265{ 260{
266 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); 261 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
267 int reg, mask = 0xff, ret; 262 int reg, mask = 0xff, ret;
268 int reg_id = s5m8767_get_reg_id(rdev); 263 int reg_id = rdev_get_id(rdev);
269 u8 val; 264 u8 val;
270 265
271 ret = s5m8767_get_voltage_register(rdev, &reg); 266 ret = s5m8767_get_voltage_register(rdev, &reg);
@@ -325,7 +320,7 @@ static int s5m8767_set_voltage(struct regulator_dev *rdev,
325 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); 320 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
326 int min_vol = min_uV, max_vol = max_uV; 321 int min_vol = min_uV, max_vol = max_uV;
327 const struct s5m_voltage_desc *desc; 322 const struct s5m_voltage_desc *desc;
328 int reg_id = s5m8767_get_reg_id(rdev); 323 int reg_id = rdev_get_id(rdev);
329 int reg, mask, ret; 324 int reg, mask, ret;
330 int i; 325 int i;
331 u8 val; 326 u8 val;
@@ -387,7 +382,7 @@ static int s5m8767_set_voltage_buck(struct regulator_dev *rdev,
387 int min_uV, int max_uV, unsigned *selector) 382 int min_uV, int max_uV, unsigned *selector)
388{ 383{
389 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); 384 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
390 int reg_id = s5m8767_get_reg_id(rdev); 385 int reg_id = rdev_get_id(rdev);
391 const struct s5m_voltage_desc *desc; 386 const struct s5m_voltage_desc *desc;
392 int new_val, old_val, i = 0; 387 int new_val, old_val, i = 0;
393 int min_vol = min_uV, max_vol = max_uV; 388 int min_vol = min_uV, max_vol = max_uV;
@@ -456,7 +451,7 @@ static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev,
456{ 451{
457 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); 452 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
458 const struct s5m_voltage_desc *desc; 453 const struct s5m_voltage_desc *desc;
459 int reg_id = s5m8767_get_reg_id(rdev); 454 int reg_id = rdev_get_id(rdev);
460 int mask; 455 int mask;
461 int new_val, old_val; 456 int new_val, old_val;
462 457