regulator: Factor out references to rdev in regulator_force_disable()
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 9 May 2011 09:41:02 +0000 (11:41 +0200)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Fri, 27 May 2011 09:34:37 +0000 (10:34 +0100)
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>
drivers/regulator/core.c

index a2728a498c3f4a31bceb99c390498daf5c173879..98d25fcb393071a1a1a48ff7502a94431ff30272 100644 (file)
@@ -1504,13 +1504,14 @@ static int _regulator_force_disable(struct regulator_dev *rdev,
  */
 int regulator_force_disable(struct regulator *regulator)
 {
+       struct regulator_dev *rdev = regulator->rdev;
        struct regulator_dev *supply_rdev = NULL;
        int ret;
 
-       mutex_lock(&regulator->rdev->mutex);
+       mutex_lock(&rdev->mutex);
        regulator->uA_load = 0;
-       ret = _regulator_force_disable(regulator->rdev, &supply_rdev);
-       mutex_unlock(&regulator->rdev->mutex);
+       ret = _regulator_force_disable(rdev, &supply_rdev);
+       mutex_unlock(&rdev->mutex);
 
        if (supply_rdev)
                regulator_disable(get_device_regulator(rdev_get_dev(supply_rdev)));