diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-09 05:41:02 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-05-27 05:34:37 -0400 |
commit | 82d158397b6eeb464263a6ef6a739c4118a34720 (patch) | |
tree | 95fb5c55f74900f424a62d20ba68efcbc182fab4 /drivers/regulator | |
parent | 7ce8a2a05f249054e6bce109a15ee188b4124256 (diff) |
regulator: Factor out references to rdev in regulator_force_disable()
Don't go looking up the rdev pointer every time, just use a local variable
like everything else.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/core.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index a2728a498c3f..98d25fcb3930 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -1504,13 +1504,14 @@ static int _regulator_force_disable(struct regulator_dev *rdev, | |||
1504 | */ | 1504 | */ |
1505 | int regulator_force_disable(struct regulator *regulator) | 1505 | int regulator_force_disable(struct regulator *regulator) |
1506 | { | 1506 | { |
1507 | struct regulator_dev *rdev = regulator->rdev; | ||
1507 | struct regulator_dev *supply_rdev = NULL; | 1508 | struct regulator_dev *supply_rdev = NULL; |
1508 | int ret; | 1509 | int ret; |
1509 | 1510 | ||
1510 | mutex_lock(®ulator->rdev->mutex); | 1511 | mutex_lock(&rdev->mutex); |
1511 | regulator->uA_load = 0; | 1512 | regulator->uA_load = 0; |
1512 | ret = _regulator_force_disable(regulator->rdev, &supply_rdev); | 1513 | ret = _regulator_force_disable(rdev, &supply_rdev); |
1513 | mutex_unlock(®ulator->rdev->mutex); | 1514 | mutex_unlock(&rdev->mutex); |
1514 | 1515 | ||
1515 | if (supply_rdev) | 1516 | if (supply_rdev) |
1516 | regulator_disable(get_device_regulator(rdev_get_dev(supply_rdev))); | 1517 | regulator_disable(get_device_regulator(rdev_get_dev(supply_rdev))); |