pm: device: Remove PM_DEVICE_STATE_FORCE_SUSPEND

This is not a state but an action. Just remove it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2021-08-26 21:42:51 -07:00 committed by Anas Nashif
commit 2549160d69
3 changed files with 2 additions and 23 deletions

View file

@ -42,13 +42,6 @@ enum pm_device_state {
* Device context may be lost.
*/
PM_DEVICE_STATE_SUSPENDED,
/**
* Device is suspended (forced).
*
* @note
* Device context may be lost.
*/
PM_DEVICE_STATE_FORCE_SUSPEND,
/**
* Device is turned off (power removed).
*

View file

@ -64,11 +64,6 @@ int pm_low_power_devices(void)
return _pm_devices(PM_DEVICE_STATE_LOW_POWER);
}
int pm_force_suspend_devices(void)
{
return _pm_devices(PM_DEVICE_STATE_FORCE_SUSPEND);
}
void pm_resume_devices(void)
{
size_t i;
@ -91,8 +86,6 @@ const char *pm_device_state_str(enum pm_device_state state)
return "low power";
case PM_DEVICE_STATE_SUSPENDED:
return "suspended";
case PM_DEVICE_STATE_FORCE_SUSPEND:
return "force suspend";
case PM_DEVICE_STATE_OFF:
return "off";
default:
@ -129,13 +122,6 @@ int pm_device_state_set(const struct device *dev,
action = PM_DEVICE_ACTION_RESUME;
break;
case PM_DEVICE_STATE_FORCE_SUSPEND:
if (dev->pm->state == state) {
return -EALREADY;
}
action = PM_DEVICE_ACTION_FORCE_SUSPEND;
break;
case PM_DEVICE_STATE_LOW_POWER:
if (dev->pm->state == state) {
return -EALREADY;

View file

@ -335,8 +335,8 @@ void test_dummy_device_pm(void)
zassert_true((device_power_state == PM_DEVICE_STATE_ACTIVE),
"Error power status");
/* Set device state to PM_DEVICE_STATE_FORCE_SUSPEND */
ret = pm_device_state_set(dev, PM_DEVICE_STATE_FORCE_SUSPEND);
/* Set device state to PM_DEVICE_STATE_SUSPENDED */
ret = pm_device_state_set(dev, PM_DEVICE_STATE_SUSPENDED);
zassert_true((ret == 0), "Unable to force suspend device");