boards: enter/leave critical section should in pairs
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
52235b468b
commit
624d69ee05
@ -306,6 +306,7 @@ int gd32_gpio_config(uint32_t cfgset)
|
||||
port = (cfgset & GPIO_CFG_PORT_MASK) >> GPIO_CFG_PORT_SHIFT;
|
||||
if (port >= GD32_NGPIO_PORTS)
|
||||
{
|
||||
leave_critical_section(flags);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -357,8 +358,8 @@ int gd32_gpio_config(uint32_t cfgset)
|
||||
break;
|
||||
|
||||
default:
|
||||
return -EINVAL;
|
||||
break;
|
||||
leave_critical_section(flags);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
regval = getreg32(GD32_GPIO_CTL(port_base));
|
||||
|
@ -2737,6 +2737,7 @@ static void stm32serial_txint(struct uart_dev_s *dev, bool enable)
|
||||
# ifdef CONFIG_STM32U5_SERIALBRK_BSDCOMPAT
|
||||
if (priv->ie & USART_CR1_IE_BREAK_INPROGRESS)
|
||||
{
|
||||
leave_critical_section(flags);
|
||||
return;
|
||||
}
|
||||
# endif
|
||||
|
@ -2492,6 +2492,7 @@ static void stm32wl5serial_txint(struct uart_dev_s *dev, bool enable)
|
||||
# ifdef CONFIG_STM32WL5_SERIALBRK_BSDCOMPAT
|
||||
if (priv->ie & USART_CR1_IE_BREAK_INPROGRESS)
|
||||
{
|
||||
leave_critical_section(flags);
|
||||
return;
|
||||
}
|
||||
# endif
|
||||
|
@ -149,6 +149,7 @@ int board_button_irq(int id, xcpt_t irqhandler, void *arg)
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
leave_critical_section(flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -161,6 +162,7 @@ int board_button_irq(int id, xcpt_t irqhandler, void *arg)
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
leave_critical_section(flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -256,6 +256,7 @@ static int gpint_attach(struct gpio_dev_s *dev, pin_interrupt_t callback)
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
leave_critical_section(flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -291,6 +292,7 @@ static int gpint_enable(struct gpio_dev_s *dev, bool enable)
|
||||
&gpio_irqnum);
|
||||
if (ret < 0)
|
||||
{
|
||||
leave_critical_section(flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -219,6 +219,7 @@ static ssize_t smbus_sbd_read(struct file *filep, char *buffer,
|
||||
* nothing was read.
|
||||
*/
|
||||
|
||||
leave_critical_section(flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -316,6 +317,7 @@ static ssize_t smbus_sbd_write(struct file *filep, const char *buffer,
|
||||
* nothing was written.
|
||||
*/
|
||||
|
||||
leave_critical_section(flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -117,6 +117,7 @@ static int apds9960_irq_attach(struct apds9960_config_s *state,
|
||||
ret = irq_attach(irq, isr, arg);
|
||||
if (ret < 0)
|
||||
{
|
||||
leave_critical_section(flags);
|
||||
syslog(LOG_ERR, "ERROR: apds9960_irq_attach() failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
@ -208,6 +208,7 @@ static void djoy_enable(const struct djoy_lowerhalf_s *lower,
|
||||
ret = irq_attach(irq, djoy_interrupt, arg);
|
||||
if (ret < 0)
|
||||
{
|
||||
leave_critical_section(flags);
|
||||
syslog(LOG_ERR, "ERROR: irq_attach() failed: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user