diff options
author | Maciej Purski <m.purski@samsung.com> | 2018-01-22 17:30:07 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-01-26 18:48:08 +0300 |
commit | 3d67fe950707a930664c5673ecc026f1bb497136 (patch) | |
tree | bbcb529d0a79b103db98750aea5be63da8ebc8b9 /drivers | |
parent | 148096af0bf381c78afe253c07ef1c77778f0e68 (diff) | |
download | linux-3d67fe950707a930664c5673ecc026f1bb497136.tar.xz |
regulator: core: Refactor regulator_list_voltage()
Change _regulator_list_voltage() argument from regulator to
regulator_dev in order to provide better separation of core layers.
Allow calling _regulator_list_voltage() from functions, with
regulator_dev argument. This refactoring is needed in order to
implement setting voltage of coupled regulators.
Signed-off-by: Maciej Purski <m.purski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/core.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 5f7678292cef..fd8eacfea422 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2447,10 +2447,9 @@ static int _regulator_is_enabled(struct regulator_dev *rdev) return rdev->desc->ops->is_enabled(rdev); } -static int _regulator_list_voltage(struct regulator *regulator, - unsigned selector, int lock) +static int _regulator_list_voltage(struct regulator_dev *rdev, + unsigned selector, int lock) { - struct regulator_dev *rdev = regulator->rdev; const struct regulator_ops *ops = rdev->desc->ops; int ret; @@ -2466,7 +2465,8 @@ static int _regulator_list_voltage(struct regulator *regulator, if (lock) mutex_unlock(&rdev->mutex); } else if (rdev->is_switch && rdev->supply) { - ret = _regulator_list_voltage(rdev->supply, selector, lock); + ret = _regulator_list_voltage(rdev->supply->rdev, + selector, lock); } else { return -EINVAL; } @@ -2542,7 +2542,7 @@ EXPORT_SYMBOL_GPL(regulator_count_voltages); */ int regulator_list_voltage(struct regulator *regulator, unsigned selector) { - return _regulator_list_voltage(regulator, selector, 1); + return _regulator_list_voltage(regulator->rdev, selector, 1); } EXPORT_SYMBOL_GPL(regulator_list_voltage); |