pm: device_runtime: Reset usage count on enable
Since enabling runtime pm on a device sets the device state to suspended. The usage count has to be zeroed otherwise we may have an inconsistency. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
a6d34becb5
commit
4184678613
1 changed files with 1 additions and 0 deletions
|
@ -186,6 +186,7 @@ void pm_device_runtime_enable(const struct device *dev)
|
|||
k_work_init_delayable(&pm->work, runtime_suspend_work);
|
||||
}
|
||||
pm->state = PM_DEVICE_STATE_SUSPENDED;
|
||||
pm->usage = 0U;
|
||||
|
||||
atomic_set_bit(&pm->flags, PM_DEVICE_FLAG_RUNTIME_ENABLED);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue