From: Mark Brown Date: Mon, 9 May 2011 09:41:02 +0000 (+0200) Subject: regulator: Factor out references to rdev in regulator_force_disable() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=82d158397b6eeb464263a6ef6a739c4118a34720;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Liam Girdwood --- 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, */ int regulator_force_disable(struct regulator *regulator) { + struct regulator_dev *rdev = regulator->rdev; struct regulator_dev *supply_rdev = NULL; int ret; - mutex_lock(®ulator->rdev->mutex); + mutex_lock(&rdev->mutex); regulator->uA_load = 0; - ret = _regulator_force_disable(regulator->rdev, &supply_rdev); - mutex_unlock(®ulator->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)));