Skip to contentSkip to conversation

regulator: Use newly added devres_release() rather than open coding

PATCH New Mark Brown 1 participant 1 message May 7, 2012 Voltage and current regulator framework

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 regulator: Use newly added devres_release() rather than open coding

devres_release() will call the destructor for the resource as well as freeing the devres data.

---
 drivers/regulator/core.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/regulator/core.c +2 -5
index 62a46b2..b2e6043 100644
@@ -1459,12 +1459,9 @@ void devm_regulator_put(struct regulator *regulator)
 {
 	int rc;
 
-	rc = devres_destroy(regulator->dev, devm_regulator_release,
+	rc = devres_release(regulator->dev, devm_regulator_release,
 			    devm_regulator_match, regulator);
-	if (rc == 0)
-		regulator_put(regulator);
-	else
-		WARN_ON(rc);
+	WARN_ON(rc);
 }
 EXPORT_SYMBOL_GPL(devm_regulator_put);
 
Signature · 1 line
1.7.10