diff --git a/arch/arm/src/stm32/Make.defs b/arch/arm/src/stm32/Make.defs index 88ac6481224..cae6bfc5777 100644 --- a/arch/arm/src/stm32/Make.defs +++ b/arch/arm/src/stm32/Make.defs @@ -86,8 +86,10 @@ endif CHIP_CSRCS += stm32_pmstop.c stm32_pmstandby.c ifeq ($(CONFIG_PM),y) +ifneq ($(CONFIG_PM_CUSTOMINIT),y) CHIP_CSRCS += stm32_pminitialize.c endif +endif ifeq ($(CONFIG_STM32_ETHMAC),y) CHIP_CSRCS += stm32_eth.c diff --git a/arch/arm/src/stm32/stm32_pm.h b/arch/arm/src/stm32/stm32_pm.h index 25c56ecbb9c..d08458d78b8 100644 --- a/arch/arm/src/stm32/stm32_pm.h +++ b/arch/arm/src/stm32/stm32_pm.h @@ -43,7 +43,6 @@ #include #include -#include #include "chip.h" #include "up_internal.h" @@ -68,15 +67,6 @@ extern "C" { #define EXTERN extern #endif -/* Before any power state transition is made, the caller should hold this - * semaphore to assure that there are no concurrent, contradictory power - * state activities. - */ - -#ifdef CONFIG_PM -EXTERN sem_t g_pmsem; -#endif - /**************************************************************************** * Public Function Prototypes ****************************************************************************/ @@ -98,10 +88,6 @@ EXTERN sem_t g_pmsem; * original state. Otherwise, STOP mode did not occur and a negated * errno value is returned to indicate the cause of the failure. * - * Assumptions: - * The caller holds the PM semaphore (g_pmsem) if this function is used - * as part of the NuttX power management logic. - * ****************************************************************************/ EXTERN int stm32_pmstop(bool lpds); @@ -121,10 +107,6 @@ EXTERN int stm32_pmstop(bool lpds); * and a negated errno value is returned to indicate the cause of the * failure. * - * Assumptions: - * The caller holds the PM semaphore (g_pmsem) if this function is used - * as part of the NuttX power management logic. - * ****************************************************************************/ EXTERN int stm32_pmstandby(void); diff --git a/arch/arm/src/stm32/stm32_pminitialize.c b/arch/arm/src/stm32/stm32_pminitialize.c index f065cdfc8be..a1f44a7f410 100644 --- a/arch/arm/src/stm32/stm32_pminitialize.c +++ b/arch/arm/src/stm32/stm32_pminitialize.c @@ -58,13 +58,6 @@ * Public Data ****************************************************************************/ -/* Before any power state transition is made, the caller should hold this - * semaphore to assure that there are no concurrent, contradictory power - * state activities. - */ - -sem_t g_pmsem; - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -93,12 +86,6 @@ sem_t g_pmsem; void up_pminitialize(void) { - /* Initialize the PM semaphore to assure that no more than one power-related - * action occurs at a time. - */ - - sem_init(&g_pmsem, 0, 1); - /* Then initialize the NuttX power management subsystem proper */ pm_initialize(); diff --git a/arch/arm/src/stm32/stm32_pmstandby.c b/arch/arm/src/stm32/stm32_pmstandby.c index 6846ac1f13c..9aacfaa9a6b 100644 --- a/arch/arm/src/stm32/stm32_pmstandby.c +++ b/arch/arm/src/stm32/stm32_pmstandby.c @@ -77,10 +77,6 @@ * and a negated errno value is returned to indicate the cause of the * failure. * - * Assumptions: - * The caller holds the PM semaphore (g_pmsem) if this function is used - * as part of the NuttX power management logic. - * ****************************************************************************/ int stm32_pmstandby(void) diff --git a/arch/arm/src/stm32/stm32_pmstop.c b/arch/arm/src/stm32/stm32_pmstop.c index 55e8201c6a5..c6888561113 100644 --- a/arch/arm/src/stm32/stm32_pmstop.c +++ b/arch/arm/src/stm32/stm32_pmstop.c @@ -79,10 +79,6 @@ * original state. Otherwise, STOP mode did not occur and a negated * errno value is returned to indicate the cause of the failure. * - * Assumptions: - * The caller holds the PM semaphore (g_pmsem) if this function is used - * as part of the NuttX power management logic. - * ****************************************************************************/ int stm32_pmstop(bool lpds)