From: "Dr. David Alan Gilbert" <linux@xxxxxxxxxxx> regulator_set_suspend_voltage() was added as part of 2018's commit f7efad10b5c4 ("regulator: add PM suspend and resume hooks") but is unused. Remove it, and the helpers it's the only user of. Signed-off-by: Dr. David Alan Gilbert <linux@xxxxxxxxxxx> --- drivers/regulator/core.c | 46 ------------------------------ include/linux/regulator/consumer.h | 11 ------- 2 files changed, 57 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 90449f387b98..a0d740a565a6 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -446,12 +446,6 @@ int regulator_check_voltage(struct regulator_dev *rdev, return 0; } -/* return 0 if the state is valid */ -static int regulator_check_states(suspend_state_t state) -{ - return (state > PM_SUSPEND_MAX || state == PM_SUSPEND_TO_IDLE); -} - /* Make sure we select a voltage that suits the needs of all * regulator consumers */ @@ -4244,46 +4238,6 @@ int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV) } EXPORT_SYMBOL_GPL(regulator_set_voltage); -static int _regulator_set_suspend_voltage(struct regulator *regulator, - int min_uV, int max_uV, - suspend_state_t state) -{ - struct regulator_dev *rdev = regulator->rdev; - struct regulator_state *rstate; - - rstate = regulator_get_suspend_state(rdev, state); - if (rstate == NULL) - return -EINVAL; - - if (rstate->min_uV == rstate->max_uV) { - rdev_err(rdev, "The suspend voltage can't be changed!\n"); - return -EPERM; - } - - return regulator_set_voltage_unlocked(regulator, min_uV, max_uV, state); -} - -int regulator_set_suspend_voltage(struct regulator *regulator, int min_uV, - int max_uV, suspend_state_t state) -{ - struct ww_acquire_ctx ww_ctx; - int ret; - - /* PM_SUSPEND_ON is handled by regulator_set_voltage() */ - if (regulator_check_states(state) || state == PM_SUSPEND_ON) - return -EINVAL; - - regulator_lock_dependent(regulator->rdev, &ww_ctx); - - ret = _regulator_set_suspend_voltage(regulator, min_uV, - max_uV, state); - - regulator_unlock_dependent(regulator->rdev, &ww_ctx); - - return ret; -} -EXPORT_SYMBOL_GPL(regulator_set_suspend_voltage); - /** * regulator_set_voltage_time - get raise/fall time * @regulator: regulator source diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index a5479de53906..3383a6de58d1 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -257,10 +257,6 @@ int regulator_unregister_notifier(struct regulator *regulator, void devm_regulator_unregister_notifier(struct regulator *regulator, struct notifier_block *nb); -/* regulator suspend */ -int regulator_set_suspend_voltage(struct regulator *regulator, int min_uV, - int max_uV, suspend_state_t state); - /* driver data - core doesn't touch */ void *regulator_get_drvdata(struct regulator *regulator); @@ -604,13 +600,6 @@ static inline int devm_regulator_unregister_notifier(struct regulator *regulator return 0; } -static inline int regulator_set_suspend_voltage(struct regulator *regulator, - int min_uV, int max_uV, - suspend_state_t state) -{ - return -EINVAL; -} - static inline void *regulator_get_drvdata(struct regulator *regulator) { return NULL; -- 2.49.0