regulator: Add devm helpers for get and enable
authorMatti Vaittinen <mazziesaccount@gmail.com>
Fri, 12 Aug 2022 10:10:37 +0000 (13:10 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 18 Aug 2022 11:51:48 +0000 (12:51 +0100)
commitda279e6965b3838e99e5c0ab8f76b87bf86b31a5
tree22bfffa0d0e38a97609bf8e3b39a1d5cb22fb550
parent568035b01cfb107af8d2e4bd2fb9aea22cf5b868
regulator: Add devm helpers for get and enable

A few regulator consumer drivers seem to be just getting a regulator,
enabling it and registering a devm-action to disable the regulator at
the driver detach and then forget about it.

We can simplify this a bit by adding a devm-helper for this pattern.
Add devm_regulator_get_enable() and devm_regulator_get_enable_optional()

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/ed7b8841193bb9749d426f3cb3b199c9460794cd.1660292316.git.mazziesaccount@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/devres.c
include/linux/regulator/consumer.h