From ed49aa1906a1e7b8e197d2add95e8c2cd61c15e1 Mon Sep 17 00:00:00 2001 From: ligd Date: Mon, 21 Feb 2022 18:03:54 +0800 Subject: [PATCH] pm: remove unnecessary depends on OSINIT_OS_READY Signed-off-by: ligd --- drivers/power/pm_register.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/power/pm_register.c b/drivers/power/pm_register.c index 3c68f31b2f..fa95b8efa3 100644 --- a/drivers/power/pm_register.c +++ b/drivers/power/pm_register.c @@ -62,19 +62,11 @@ int pm_register(FAR struct pm_callback_s *callbacks) /* Add the new entry to the end of the list of registered callbacks */ - if (OSINIT_OS_READY()) - { - ret = pm_lock(); - if (ret == OK) - { - dq_addlast(&callbacks->entry, &g_pmglobals.registry); - pm_unlock(); - } - } - else + ret = pm_lock(); + if (ret == OK) { dq_addlast(&callbacks->entry, &g_pmglobals.registry); - ret = OK; + pm_unlock(); } return ret;