Commit a66c0705 authored by Ioannis Karachalios's avatar Ioannis Karachalios Committed by Mahesh Mahadevan
Browse files

drivers: counter: Fix unbalanced policy state lock

This commit should deal with fixing unbalanced policy state locks.
When PM and PM_DEVICE are declared, default state, policy locks
should be given only when  active.

Signed-off-by: default avatarIoannis Karachalios <ioannis.karachalios.px@renesas.com>
parent 88fb090b
Loading
Loading
Loading
Loading
+2 −0
Changes for drivers/counter/counter_smartbond_timer.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -68,8 +68,10 @@ static void counter_smartbond_pm_policy_state_lock_get(const struct device *dev)
static void counter_smartbond_pm_policy_state_lock_put(const struct device *dev)
{
	pm_device_runtime_put(dev);
	if (pm_policy_state_lock_is_active(PM_STATE_STANDBY, PM_ALL_SUBSTATES)) {
		pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
	}
}

/*
 * Routine to check whether the device is allowed to enter the sleep state or not.