Skip to content

Commit 4ef146d

Browse files
nordic-krchnashif
authored andcommitted
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 <[email protected]> (cherry picked from commit 581c554)
1 parent afdd87e commit 4ef146d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/pm/device_runtime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static int get_sync_locked(const struct device *dev)
139139
if (flags & BIT(PM_DEVICE_FLAG_PD_CLAIMED)) {
140140
const struct device *domain = PM_DOMAIN(&pm->base);
141141

142-
if (domain->pm_base->flags & PM_DEVICE_FLAG_ISR_SAFE) {
142+
if (domain->pm_base->flags & BIT(PM_DEVICE_FLAG_ISR_SAFE)) {
143143
ret = pm_device_runtime_get(domain);
144144
if (ret < 0) {
145145
return ret;
@@ -300,7 +300,7 @@ static int put_sync_locked(const struct device *dev)
300300
if (flags & BIT(PM_DEVICE_FLAG_PD_CLAIMED)) {
301301
const struct device *domain = PM_DOMAIN(&pm->base);
302302

303-
if (domain->pm_base->flags & PM_DEVICE_FLAG_ISR_SAFE) {
303+
if (domain->pm_base->flags & BIT(PM_DEVICE_FLAG_ISR_SAFE)) {
304304
ret = put_sync_locked(domain);
305305
} else {
306306
ret = -EWOULDBLOCK;

0 commit comments

Comments
 (0)