From: "Dr. David Alan Gilbert" <linux@xxxxxxxxxxx> regulator_suspend_disable() and regulator_suspend_enable() were added by 2018's commit f7efad10b5c4 ("regulator: add PM suspend and resume hooks") but have remained unused. Remove them and their helper function regulator_suspend_toggle(). Signed-off-by: Dr. David Alan Gilbert <linux@xxxxxxxxxxx> --- drivers/regulator/core.c | 44 ------------------------------ include/linux/regulator/consumer.h | 16 ----------- 2 files changed, 60 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 60c72d77f77a..90449f387b98 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -4244,50 +4244,6 @@ int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV) } EXPORT_SYMBOL_GPL(regulator_set_voltage); -static inline int regulator_suspend_toggle(struct regulator_dev *rdev, - suspend_state_t state, bool en) -{ - struct regulator_state *rstate; - - rstate = regulator_get_suspend_state(rdev, state); - if (rstate == NULL) - return -EINVAL; - - if (!rstate->changeable) - return -EPERM; - - rstate->enabled = (en) ? ENABLE_IN_SUSPEND : DISABLE_IN_SUSPEND; - - return 0; -} - -int regulator_suspend_enable(struct regulator_dev *rdev, - suspend_state_t state) -{ - return regulator_suspend_toggle(rdev, state, true); -} -EXPORT_SYMBOL_GPL(regulator_suspend_enable); - -int regulator_suspend_disable(struct regulator_dev *rdev, - suspend_state_t state) -{ - struct regulator *regulator; - struct regulator_voltage *voltage; - - /* - * if any consumer wants this regulator device keeping on in - * suspend states, don't set it as disabled. - */ - list_for_each_entry(regulator, &rdev->consumer_list, list) { - voltage = ®ulator->voltage[state]; - if (voltage->min_uV || voltage->max_uV) - return 0; - } - - return regulator_suspend_toggle(rdev, state, false); -} -EXPORT_SYMBOL_GPL(regulator_suspend_disable); - static int _regulator_set_suspend_voltage(struct regulator *regulator, int min_uV, int max_uV, suspend_state_t state) diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 0e9275079e17..a5479de53906 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -258,10 +258,6 @@ void devm_regulator_unregister_notifier(struct regulator *regulator, struct notifier_block *nb); /* regulator suspend */ -int regulator_suspend_enable(struct regulator_dev *rdev, - suspend_state_t state); -int regulator_suspend_disable(struct regulator_dev *rdev, - suspend_state_t state); int regulator_set_suspend_voltage(struct regulator *regulator, int min_uV, int max_uV, suspend_state_t state); @@ -608,18 +604,6 @@ static inline int devm_regulator_unregister_notifier(struct regulator *regulator return 0; } -static inline int regulator_suspend_enable(struct regulator_dev *rdev, - suspend_state_t state) -{ - return -EINVAL; -} - -static inline int regulator_suspend_disable(struct regulator_dev *rdev, - suspend_state_t state) -{ - return -EINVAL; -} - static inline int regulator_set_suspend_voltage(struct regulator *regulator, int min_uV, int max_uV, suspend_state_t state) -- 2.49.0