Skip to contentSkip to conversation

regulator: core: fix build warning

PATCH In review Sudip Mukherjee 2 participants 2 messages Oct 7, 2015 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: core: fix build warning

We were getting warning about:
warning: 'regulator_lock_supply' defined but not used
warning: 'regulator_unlock_supply' defined but not used

It appears that there is no user of regulator_lock_supply() and regulator_unlock_supply().
Commit 9f01cd4a915e ("regulator: core: introduce function to lock regulators and its supplies") says there will be future users, but as of now there is no user and is creating build warnings.

---
 drivers/regulator/core.c | 39 ---------------------------------------
 1 file changed, 39 deletions(-)
drivers/regulator/core.c +0 -39
index 7896ef5..3ba7131 100644
@@ -133,45 +133,6 @@ static bool have_full_constraints(void)
 }
 
 /**
- * regulator_lock_supply - lock a regulator and its supplies
- * @rdev:         regulator source
- */
-static void regulator_lock_supply(struct regulator_dev *rdev)
-{
-	struct regulator *supply;
-	int i = 0;
-
-	while (1) {
-		mutex_lock_nested(&rdev->mutex, i++);
-		supply = rdev->supply;
-
-		if (!rdev->supply)
-			return;
-
-		rdev = supply->rdev;
-	}
-}
-
-/**
- * regulator_unlock_supply - unlock a regulator and its supplies
- * @rdev:         regulator source
- */
-static void regulator_unlock_supply(struct regulator_dev *rdev)
-{
-	struct regulator *supply;
-
-	while (1) {
-		mutex_unlock(&rdev->mutex);
-		supply = rdev->supply;
-
-		if (!rdev->supply)
-			return;
-
-		rdev = supply->rdev;
-	}
-}
-
-/**
  * of_get_regulator - get a regulator device node based on supply name
  * @dev: Device pointer for the consumer (of regulator) device
  * @supply: regulator supply name
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 9 lines · Sudip Mukherjee

We were getting warning about:
warning: 'regulator_lock_supply' defined but not used
warning: 'regulator_unlock_supply' defined but not used

It appears that there is no user of regulator_lock_supply() and regulator_unlock_supply().
Commit 9f01cd4a915e ("regulator: core: introduce function to lock regulators and its supplies") says there will be future users, but as of now there is no user and is creating build warnings.

No, there are other parts of the series in review - the earlier parts are merged now so that we don't have to constantly re-review them.