pm: device: check for ENOSYS
If feature is not available -ENOSYS is used instead of -ENOTSUP.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
diff --git a/subsys/pm/device.c b/subsys/pm/device.c
index 324d5bc..34e66dbf 100644
--- a/subsys/pm/device.c
+++ b/subsys/pm/device.c
@@ -70,7 +70,7 @@
}
rc = pm_device_state_get(dev, ¤t_state);
- if ((rc != -ENOTSUP) && (rc != 0)) {
+ if ((rc != -ENOSYS) && (rc != 0)) {
LOG_DBG("Was not possible to get device %s state: %d",
dev->name, rc);
return true;
@@ -105,7 +105,7 @@
* in the right state.
*/
rc = pm_device_state_set(dev, state, NULL, NULL);
- if ((rc != -ENOTSUP) && (rc != 0)) {
+ if ((rc != -ENOSYS) && (rc != 0)) {
LOG_DBG("%s did not enter %s state: %d",
dev->name, pm_device_state_str(state),
rc);