Revert "pm: remove unnecessary depends on OSINIT_OS_READY"
This reverts commit 8785673a70
.
This commit is contained in:
parent
fccdcf7011
commit
6a1a7bf455
|
@ -62,11 +62,19 @@ int pm_register(FAR struct pm_callback_s *callbacks)
|
|||
|
||||
/* Add the new entry to the end of the list of registered callbacks */
|
||||
|
||||
ret = pm_lock();
|
||||
if (ret == OK)
|
||||
if (OSINIT_OS_READY())
|
||||
{
|
||||
ret = pm_lock();
|
||||
if (ret == OK)
|
||||
{
|
||||
dq_addlast(&callbacks->entry, &g_pmglobals.registry);
|
||||
pm_unlock();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dq_addlast(&callbacks->entry, &g_pmglobals.registry);
|
||||
pm_unlock();
|
||||
ret = OK;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue