diff options
| author | Mark Brown <broonie@linaro.org> | 2013-08-31 06:58:26 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@linaro.org> | 2013-09-16 19:27:53 -0400 |
| commit | b33e46bcdc4e598d738ed12a5a7906be4e11d786 (patch) | |
| tree | 11028144c3d74bc409f014660fe86aaac9600a21 /include/linux/regulator | |
| parent | 41c7a879d1d637c0c9731682a822b1c3162b0764 (diff) | |
regulator: core: Provide managed regulator registration
Many regulator drivers have a remove function that consists solely of
calling regulator_unregister() so provide a devm_regulator_register()
in order to allow this repeated code to be removed and help eliminate
error handling code.
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/linux/regulator')
| -rw-r--r-- | include/linux/regulator/driver.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 67e13aa5a478..8474c7f88745 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
| @@ -334,7 +334,12 @@ struct regulator_dev { | |||
| 334 | struct regulator_dev * | 334 | struct regulator_dev * |
| 335 | regulator_register(const struct regulator_desc *regulator_desc, | 335 | regulator_register(const struct regulator_desc *regulator_desc, |
| 336 | const struct regulator_config *config); | 336 | const struct regulator_config *config); |
| 337 | struct regulator_dev * | ||
| 338 | devm_regulator_register(struct device *dev, | ||
| 339 | const struct regulator_desc *regulator_desc, | ||
| 340 | const struct regulator_config *config); | ||
| 337 | void regulator_unregister(struct regulator_dev *rdev); | 341 | void regulator_unregister(struct regulator_dev *rdev); |
| 342 | void devm_regulator_unregister(struct device *dev, struct regulator_dev *rdev); | ||
| 338 | 343 | ||
| 339 | int regulator_notifier_call_chain(struct regulator_dev *rdev, | 344 | int regulator_notifier_call_chain(struct regulator_dev *rdev, |
| 340 | unsigned long event, void *data); | 345 | unsigned long event, void *data); |
