Skip to contentSkip to conversation

regulator: core: Drop lockdep annotation in drms_uA_update()

PATCH New Niklas Cassel 1 participant 1 message Feb 18, 2019 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: core: Drop lockdep annotation in drms_uA_update()

commit e5e21f70bfd3 ("regulator: core: Take lock before applying system load") took the regulator lock before calling drms_uA_update() in order to silence a lockdep warning during regulator_register().

However, we are not supposed to need locks at this point as the regulator is in the process of being registered, so there should be no possibility of concurrent access.

Instead, remove the unnecessary locking and simply drop the lockdep annotation, since it is no longer valid.

Fixes e5e21f70bfd3 ("regulator: core: Take lock before applying system load")
---
 drivers/regulator/core.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/regulator/core.c +0 -4
index 7ed134afb316..c6c280163c05 100644
@@ -922,8 +922,6 @@ static int drms_uA_update(struct regulator_dev *rdev)
 	int current_uA = 0, output_uV, input_uV, err;
 	unsigned int mode;
 
-	lockdep_assert_held_once(&rdev->mutex.base);
-
 	/*
 	 * first check to see if we can set modes at all, otherwise just
 	 * tell the consumer everything is OK.
@@ -1347,9 +1345,7 @@ static int set_machine_constraints(struct regulator_dev *rdev,
 		 * We'll only apply the initial system load if an
 		 * initial mode wasn't specified.
 		 */
-		regulator_lock(rdev);
 		drms_uA_update(rdev);
-		regulator_unlock(rdev);
 	}
 
 	if ((rdev->constraints->ramp_delay || rdev->constraints->ramp_disable)
Signature · 1 line
2.20.1