Commit 88b19060 authored by Ioannis Karachalios's avatar Ioannis Karachalios Committed by Anas Nashif
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>
(cherry picked from commit a66c0705)
parent 8cd40948
Loading
Loading
Loading
Loading
+3 −1
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.