pm: device_runtime: Fix bitfields misuse
PM_DEVICE_FLAG_ISR_SAFE is an enum and it must be converted to
a bit mask before masking with flags.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
(cherry picked from commit 581c55496df13214ce08c9acb396bf52ebeab418)
diff --git a/subsys/pm/device_runtime.c b/subsys/pm/device_runtime.c
index c0c2ba7..f719b47 100644
--- a/subsys/pm/device_runtime.c
+++ b/subsys/pm/device_runtime.c
@@ -139,7 +139,7 @@
if (flags & BIT(PM_DEVICE_FLAG_PD_CLAIMED)) {
const struct device *domain = PM_DOMAIN(&pm->base);
- if (domain->pm_base->flags & PM_DEVICE_FLAG_ISR_SAFE) {
+ if (domain->pm_base->flags & BIT(PM_DEVICE_FLAG_ISR_SAFE)) {
ret = pm_device_runtime_get(domain);
if (ret < 0) {
return ret;
@@ -300,7 +300,7 @@
if (flags & BIT(PM_DEVICE_FLAG_PD_CLAIMED)) {
const struct device *domain = PM_DOMAIN(&pm->base);
- if (domain->pm_base->flags & PM_DEVICE_FLAG_ISR_SAFE) {
+ if (domain->pm_base->flags & BIT(PM_DEVICE_FLAG_ISR_SAFE)) {
ret = put_sync_locked(domain);
} else {
ret = -EWOULDBLOCK;