diff --git a/arch/arm/src/stm32/stm32_exti_pwr.c b/arch/arm/src/stm32/stm32_exti_pwr.c index 0fcb2f78038..5ab6138ac4b 100644 --- a/arch/arm/src/stm32/stm32_exti_pwr.c +++ b/arch/arm/src/stm32/stm32_exti_pwr.c @@ -158,7 +158,5 @@ int stm32_exti_pvd(bool risingedge, bool fallingedge, bool event, func ? 0 : EXTI_PVD_LINE, func ? EXTI_PVD_LINE : 0); - /* Return the old IRQ handler */ - return OK; } diff --git a/arch/arm/src/stm32f7/stm32_exti_pwr.c b/arch/arm/src/stm32f7/stm32_exti_pwr.c index e3418e00694..09d064e930e 100644 --- a/arch/arm/src/stm32f7/stm32_exti_pwr.c +++ b/arch/arm/src/stm32f7/stm32_exti_pwr.c @@ -166,7 +166,5 @@ int stm32_exti_pvd(bool risingedge, bool fallingedge, bool event, func ? 0 : EXTI_PVD_LINE, func ? EXTI_PVD_LINE : 0); - /* Return the old IRQ handler */ - return OK; } diff --git a/arch/arm/src/stm32l4/stm32l4_exti.h b/arch/arm/src/stm32l4/stm32l4_exti.h index d090ea7d483..e69ba9a51af 100644 --- a/arch/arm/src/stm32l4/stm32l4_exti.h +++ b/arch/arm/src/stm32l4/stm32l4_exti.h @@ -127,15 +127,14 @@ xcpt_t stm32l4_exti_alarm(bool risingedge, bool fallingedge, bool event, * - arg: Argument passed to the interrupt callback * * Returns: - * The previous value of the interrupt handler function pointer. This - * value may, for example, be used to restore the previous handler when - * multiple handlers are used. + * Zero (OK) returned on success; a negated errno value is returned on + * failure. * ****************************************************************************/ #ifdef CONFIG_STM32L4_COMP -xcpt_t stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge, - bool event, xcpt_t func, void *arg); +int stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge, + bool event, xcpt_t func, void *arg); #endif #undef EXTERN diff --git a/arch/arm/src/stm32l4/stm32l4_exti_comp.c b/arch/arm/src/stm32l4/stm32l4_exti_comp.c index 7c508a11668..a1295b6970b 100644 --- a/arch/arm/src/stm32l4/stm32l4_exti_comp.c +++ b/arch/arm/src/stm32l4/stm32l4_exti_comp.c @@ -129,16 +129,14 @@ static int stm32l4_exti_comp_isr(int irq, void *context) * - arg: Argument passed to the interrupt callback * * Returns: - * The previous value of the interrupt handler function pointer. This - * value may, for example, be used to restore the previous handler when - * multiple handlers are used. + * Zero (OK) returned on success; a negated errno value is returned on + * failure. * ****************************************************************************/ -xcpt_t stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge, - bool event, xcpt_t func, void *arg) +int stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge, + bool event, xcpt_t func, void *arg) { - xcpt_t oldhandler; irqstate_t flags; uint32_t ln = g_comp_lines[cmp]; @@ -152,7 +150,7 @@ xcpt_t stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge, if (func != NULL) { - irq_attach(STM32L4_IRQ_COMP, stm32l4_exti_comp_isr); + irq_attach(STM32L4_IRQ_COMP, stm32l4_exti_comp_isr, NULL); up_enable_irq(STM32L4_IRQ_COMP); } else @@ -172,15 +170,11 @@ xcpt_t stm32l4_exti_comp(int cmp, bool risingedge, bool fallingedge, /* Get the previous IRQ handler and save the new IRQ handler. */ - oldhandler = g_comp_handlers[cmp].callback; g_comp_handlers[cmp].callback = func; g_comp_handlers[cmp].arg = arg; /* Leave the critical section */ leave_critical_section(flags); - - /* Return the old IRQ handler */ - - return oldhandler; + return OK; } diff --git a/arch/arm/src/stm32l4/stm32l4_exti_pwr.c b/arch/arm/src/stm32l4/stm32l4_exti_pwr.c index 144e08a3f7e..ab19f6f3cb9 100644 --- a/arch/arm/src/stm32l4/stm32l4_exti_pwr.c +++ b/arch/arm/src/stm32l4/stm32l4_exti_pwr.c @@ -157,7 +157,5 @@ int stm32l4_exti_pvd(bool risingedge, bool fallingedge, bool event, func ? 0 : EXTI1_PVD_LINE, func ? EXTI1_PVD_LINE : 0); - /* Return the old IRQ handler */ - return OK; }