Re: [PATCH] regulator: Fix recursive mutex lockdep warning

From: Stephen Boyd
Date: Tue Jul 03 2012 - 18:47:52 EST


On 07/03/12 15:43, Mark Brown wrote:
>
>> What do you think about removing the locking in get_voltage? Is that better?
> There's already an unlocked version of get_voltage()?

Yes, I'm suggesting we just use that unlocked version for all of the
code that gets the input voltage.

index ef07b62..4c63336 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -628,7 +628,7 @@ static void drms_uA_update(struct regulator_dev *rdev)
/* get input voltage */
input_uV = 0;
if (rdev->supply)
- input_uV = regulator_get_voltage(rdev->supply);
+ input_uV = _regulator_get_voltage(rdev->supply->rdev);
if (input_uV <= 0)
input_uV = rdev->constraints->input_uV;
if (input_uV <= 0)
@@ -2582,7 +2582,7 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load)
/* get input voltage */
input_uV = 0;
if (rdev->supply)
- input_uV = regulator_get_voltage(rdev->supply);
+ input_uV = _regulator_get_voltage(rdev->supply->rdev);
if (input_uV <= 0)
input_uV = rdev->constraints->input_uV;
if (input_uV <= 0) {


--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/