power: device: adapt to new behavior for devices with nop pm ctrl

For backwards compatibility ignore not-supported errors for devices
that don't support power management.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2020-05-20 10:19:17 -05:00 committed by Carles Cufí
commit d99aa367f6

View file

@ -95,7 +95,7 @@ static int _sys_pm_devices(u32_t state)
* and set the device states accordingly.
*/
rc = device_set_power_state(dev, state, NULL, NULL);
if (rc != 0) {
if ((rc != -ENOTSUP) && (rc != 0)) {
LOG_DBG("%s did not enter %s state: %d",
dev->name, device_pm_state_str(state), rc);
return rc;