STM32/F7/L4: EXOT PVD function no longer returns the xcpt_t oldhandler. There value is useless and dangerous after the recent changes to interrupt argument passing.

This commit is contained in:
Gregory Nutt 2017-03-02 08:56:31 -06:00
parent f5f9d82d5a
commit 89058172f1
6 changed files with 27 additions and 42 deletions

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/arm/src/stm32/stm32_exti_pwr.c * arch/arm/src/stm32/stm32_exti_pwr.c
* *
* Copyright (C) 2009, 2011-2012, 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2009, 2011-2012, 2015, 2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2015 Haltian Ltd. All rights reserved. * Copyright (C) 2015 Haltian Ltd. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org> * Authors: Gregory Nutt <gnutt@nuttx.org>
* Dmitry Nikolaev <dmitry.nikolaev@haltian.com> * Dmitry Nikolaev <dmitry.nikolaev@haltian.com>
@ -115,20 +115,16 @@ static int stm32_exti_pvd_isr(int irq, void *context, FAR void *arg)
* - arg: Argument passed to the interrupt callback * - arg: Argument passed to the interrupt callback
* *
* Returns: * Returns:
* The previous value of the interrupt handler function pointer. This * Zero (OK) returned on success; a negated errno value is returned on
* value may, for example, be used to restore the previous handler when * failure.
* multiple handlers are used.
* *
****************************************************************************/ ****************************************************************************/
xcpt_t stm32_exti_pvd(bool risingedge, bool fallingedge, bool event, int stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg) xcpt_t func, void *arg)
{ {
xcpt_t oldhandler;
/* Get the previous GPIO IRQ handler; Save the new IRQ handler. */ /* Get the previous GPIO IRQ handler; Save the new IRQ handler. */
oldhandler = g_pvd_callback;
g_pvd_callback = func; g_pvd_callback = func;
g_callback_arg = arg; g_callback_arg = arg;
@ -164,5 +160,5 @@ xcpt_t stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
/* Return the old IRQ handler */ /* Return the old IRQ handler */
return oldhandler; return OK;
} }

View File

@ -60,13 +60,12 @@
* - arg: Argument passed to the interrupt callback * - arg: Argument passed to the interrupt callback
* *
* Returns: * Returns:
* The previous value of the interrupt handler function pointer. This * Zero (OK) returned on success; a negated errno value is returned on
* value may, for example, be used to restore the previous handler when * failure.
* multiple handlers are used.
* *
****************************************************************************/ ****************************************************************************/
xcpt_t stm32_exti_pvd(bool risingedge, bool fallingedge, bool event, int stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg); xcpt_t func, void *arg);
#endif /* STM32_EXTI_PWR_H_ */ #endif /* STM32_EXTI_PWR_H_ */

View File

@ -123,20 +123,16 @@ static int stm32_exti_pvd_isr(int irq, void *context, void *arg)
* - func: when non-NULL, generate interrupt * - func: when non-NULL, generate interrupt
* *
* Returns: * Returns:
* The previous value of the interrupt handler function pointer. This * Zero (OK) returned on success; a negated errno value is returned on
* value may, for example, be used to restore the previous handler when * failure.
* multiple handlers are used.
* *
****************************************************************************/ ****************************************************************************/
xcpt_t stm32_exti_pvd(bool risingedge, bool fallingedge, bool event, int stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg) xcpt_t func, void *arg);
{ {
xcpt_t oldhandler;
/* Get the previous GPIO IRQ handler; Save the new IRQ handler. */ /* Get the previous GPIO IRQ handler; Save the new IRQ handler. */
oldhandler = g_pvd_callback;
g_pvd_callback = func; g_pvd_callback = func;
g_callback_arg = arg; g_callback_arg = arg;
@ -172,5 +168,5 @@ xcpt_t stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
/* Return the old IRQ handler */ /* Return the old IRQ handler */
return oldhandler; return OK;
} }

View File

@ -61,13 +61,12 @@
* - arg: Argument passed to the interrupt callback * - arg: Argument passed to the interrupt callback
* *
* Returns: * Returns:
* The previous value of the interrupt handler function pointer. This * Zero (OK) returned on success; a negated errno value is returned on
* value may, for example, be used to restore the previous handler when * failure.
* multiple handlers are used.
* *
****************************************************************************/ ****************************************************************************/
xcpt_t stm32_exti_pvd(bool risingedge, bool fallingedge, bool event, int stm32_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg); xcpt_t func, void *arg);
#endif /* __ARCH_ARM_SRC_STM32F7_STM32_EXTI_PWR_H */ #endif /* __ARCH_ARM_SRC_STM32F7_STM32_EXTI_PWR_H */

View File

@ -114,20 +114,16 @@ static int stm32l4_exti_pvd_isr(int irq, void *context, FAR void *arg)
* - func: when non-NULL, generate interrupt * - func: when non-NULL, generate interrupt
* *
* Returns: * Returns:
* The previous value of the interrupt handler function pointer. This * Zero (OK) returned on success; a negated errno value is returned on
* value may, for example, be used to restore the previous handler when * failure.
* multiple handlers are used.
* *
****************************************************************************/ ****************************************************************************/
xcpt_t stm32l4_exti_pvd(bool risingedge, bool fallingedge, bool event, int stm32l4_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg) xcpt_t func, void *arg)
{ {
xcpt_t oldhandler;
/* Get the previous GPIO IRQ handler; Save the new IRQ handler. */ /* Get the previous GPIO IRQ handler; Save the new IRQ handler. */
oldhandler = g_pvd_callback;
g_pvd_callback = func; g_pvd_callback = func;
g_callback_arg = arg; g_callback_arg = arg;
@ -163,5 +159,5 @@ xcpt_t stm32l4_exti_pvd(bool risingedge, bool fallingedge, bool event,
/* Return the old IRQ handler */ /* Return the old IRQ handler */
return oldhandler; return OK;
} }

View File

@ -60,13 +60,12 @@
* - arg: Argument passed to the interrupt callback * - arg: Argument passed to the interrupt callback
* *
* Returns: * Returns:
* The previous value of the interrupt handler function pointer. This * Zero (OK) returned on success; a negated errno value is returned on
* value may, for example, be used to restore the previous handler when * failure.
* multiple handlers are used.
* *
****************************************************************************/ ****************************************************************************/
xcpt_t stm32l4_exti_pvd(bool risingedge, bool fallingedge, bool event, int stm32l4_exti_pvd(bool risingedge, bool fallingedge, bool event,
xcpt_t func, void *arg); xcpt_t func, void *arg);
#endif /* STM32L4_EXTI_PWR_H_ */ #endif /* STM32L4_EXTI_PWR_H_ */