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: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
This commit is contained in:
parent
88fb090b7f
commit
a66c070598
1 changed files with 3 additions and 1 deletions
|
|
@ -68,7 +68,9 @@ 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);
|
||||
pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
|
||||
if (pm_policy_state_lock_is_active(PM_STATE_STANDBY, PM_ALL_SUBSTATES)) {
|
||||
pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue