Commit 4ef146d1 authored by Krzysztof Chruściński's avatar Krzysztof Chruściński Committed by Anas Nashif
Browse files

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: default avatarKrzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
(cherry picked from commit 581c5549)
parent afdd87e5
Loading
Loading
Loading
Loading
+2 −2
Changes for subsys/pm/device_runtime.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ static int get_sync_locked(const struct device *dev)
		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 @@ static int put_sync_locked(const struct device *dev)
		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;