mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: Use newly added devres_release() rather than open coding
@ 2012-05-07 14:17 Mark Brown
  0 siblings, 0 replies; only message in thread
From: Mark Brown @ 2012-05-07 14:17 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: linux-kernel, Mark Brown

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

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/regulator/core.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 62a46b2..b2e6043 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -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);
 
-- 
1.7.10


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-07 14:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-07 14:17 [PATCH] regulator: Use newly added devres_release() rather than open coding Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®