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>
This commit is contained in:
@@ -334,7 +334,12 @@ struct regulator_dev {
|
||||
struct regulator_dev *
|
||||
regulator_register(const struct regulator_desc *regulator_desc,
|
||||
const struct regulator_config *config);
|
||||
struct regulator_dev *
|
||||
devm_regulator_register(struct device *dev,
|
||||
const struct regulator_desc *regulator_desc,
|
||||
const struct regulator_config *config);
|
||||
void regulator_unregister(struct regulator_dev *rdev);
|
||||
void devm_regulator_unregister(struct device *dev, struct regulator_dev *rdev);
|
||||
|
||||
int regulator_notifier_call_chain(struct regulator_dev *rdev,
|
||||
unsigned long event, void *data);
|
||||
|
Reference in New Issue
Block a user