[PATCH] regulator: core: Handle PM_SUSPEND_TO_IDLE suspend_state_t

From: Hans de Goede
Date: Sun Feb 18 2018 - 12:04:30 EST


The regulator framework is used on x86 in some cases now and x86 has
a PM_SUSPEND_TO_IDLE suspend_state_t, treat this as PM_SUSPEND_STANDBY,
this fixes these errors on resume:

dpm_run_callback(): regulator_resume_early+0x0/0x60 returns -22
PM: Device regulator.0 failed to resume early: error -22

Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
drivers/regulator/core.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index dd4708c58480..c980703ba705 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -333,6 +333,7 @@ regulator_get_suspend_state(struct regulator_dev *rdev, suspend_state_t state)
return NULL;

switch (state) {
+ case PM_SUSPEND_TO_IDLE:
case PM_SUSPEND_STANDBY:
return &rdev->constraints->state_standby;
case PM_SUSPEND_MEM:
--
2.14.3