Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 968c2c17 authored by Mark Brown's avatar Mark Brown
Browse files

regulator: Actually free the regulator in devm_regulator_put()



It turns out that (quite surprisingly) devres_destroy() only undoes the
devres mapping, it doesn't destroy the underlying resource, meaning that
anything using devm_regulator_put() would leak. While we wait for the new
devres_release() which does what we want to get merged open code it in
devm_regulator_put().

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
parent f55205f4
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1431,6 +1431,9 @@ void devm_regulator_put(struct regulator *regulator)

	rc = devres_destroy(regulator->dev, devm_regulator_release,
			    devm_regulator_match, regulator);
	if (rc == 0)
		regulator_put(regulator);
	else
		WARN_ON(rc);
}
EXPORT_SYMBOL_GPL(devm_regulator_put);