Commit 7b94791b authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: Kill max8998_get_ldo function

Use rdev_get_id() directly.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent b3e1348e
...@@ -112,16 +112,11 @@ static const struct voltage_map_desc *ldo_voltage_map[] = { ...@@ -112,16 +112,11 @@ static const struct voltage_map_desc *ldo_voltage_map[] = {
&buck4_voltage_map_desc, /* BUCK4 */ &buck4_voltage_map_desc, /* BUCK4 */
}; };
static inline int max8998_get_ldo(struct regulator_dev *rdev)
{
return rdev_get_id(rdev);
}
static int max8998_list_voltage(struct regulator_dev *rdev, static int max8998_list_voltage(struct regulator_dev *rdev,
unsigned int selector) unsigned int selector)
{ {
const struct voltage_map_desc *desc; const struct voltage_map_desc *desc;
int ldo = max8998_get_ldo(rdev); int ldo = rdev_get_id(rdev);
int val; int val;
if (ldo >= ARRAY_SIZE(ldo_voltage_map)) if (ldo >= ARRAY_SIZE(ldo_voltage_map))
...@@ -141,7 +136,7 @@ static int max8998_list_voltage(struct regulator_dev *rdev, ...@@ -141,7 +136,7 @@ static int max8998_list_voltage(struct regulator_dev *rdev,
static int max8998_get_enable_register(struct regulator_dev *rdev, static int max8998_get_enable_register(struct regulator_dev *rdev,
int *reg, int *shift) int *reg, int *shift)
{ {
int ldo = max8998_get_ldo(rdev); int ldo = rdev_get_id(rdev);
switch (ldo) { switch (ldo) {
case MAX8998_LDO2 ... MAX8998_LDO5: case MAX8998_LDO2 ... MAX8998_LDO5:
...@@ -222,7 +217,7 @@ static int max8998_ldo_disable(struct regulator_dev *rdev) ...@@ -222,7 +217,7 @@ static int max8998_ldo_disable(struct regulator_dev *rdev)
static int max8998_get_voltage_register(struct regulator_dev *rdev, static int max8998_get_voltage_register(struct regulator_dev *rdev,
int *_reg, int *_shift, int *_mask) int *_reg, int *_shift, int *_mask)
{ {
int ldo = max8998_get_ldo(rdev); int ldo = rdev_get_id(rdev);
struct max8998_data *max8998 = rdev_get_drvdata(rdev); struct max8998_data *max8998 = rdev_get_drvdata(rdev);
int reg, shift = 0, mask = 0xff; int reg, shift = 0, mask = 0xff;
...@@ -310,7 +305,7 @@ static int max8998_set_voltage_ldo(struct regulator_dev *rdev, ...@@ -310,7 +305,7 @@ static int max8998_set_voltage_ldo(struct regulator_dev *rdev,
struct i2c_client *i2c = max8998->iodev->i2c; struct i2c_client *i2c = max8998->iodev->i2c;
int min_vol = min_uV / 1000, max_vol = max_uV / 1000; int min_vol = min_uV / 1000, max_vol = max_uV / 1000;
const struct voltage_map_desc *desc; const struct voltage_map_desc *desc;
int ldo = max8998_get_ldo(rdev); int ldo = rdev_get_id(rdev);
int reg, shift = 0, mask, ret; int reg, shift = 0, mask, ret;
int i = 0; int i = 0;
...@@ -362,7 +357,7 @@ static int max8998_set_voltage_buck(struct regulator_dev *rdev, ...@@ -362,7 +357,7 @@ static int max8998_set_voltage_buck(struct regulator_dev *rdev,
struct i2c_client *i2c = max8998->iodev->i2c; struct i2c_client *i2c = max8998->iodev->i2c;
int min_vol = min_uV / 1000, max_vol = max_uV / 1000; int min_vol = min_uV / 1000, max_vol = max_uV / 1000;
const struct voltage_map_desc *desc; const struct voltage_map_desc *desc;
int buck = max8998_get_ldo(rdev); int buck = rdev_get_id(rdev);
int reg, shift = 0, mask, ret; int reg, shift = 0, mask, ret;
int difference = 0, i = 0, j = 0, previous_vol = 0; int difference = 0, i = 0, j = 0, previous_vol = 0;
u8 val = 0; u8 val = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment