use small lock in following files

arch/xtensa/src/esp32s3/esp32s3_rtc_lowerhalf.c
arch/z16/src/z16f/z16f_serial.c
arch/z80/src/z8/z8_serial.c
boards/arm/max326xx/max32660-evsys/src/max326_button.c
boards/arm/stm32/stm32f4discovery/src/stm32_gs2200m.c
drivers/i2c/i2c_bitbang.c
drivers/power/supply/act8945a.c
drivers/serial/uart_pci_16550.c
drivers/serial/uart_pl011.c
drivers/wireless/bluetooth/bt_uart_shim.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5
2024-12-20 19:07:08 +08:00
committed by Xiang Xiao
parent e55966d3dc
commit 8411a97b85
11 changed files with 138 additions and 67 deletions

View File

@@ -59,6 +59,7 @@ struct hciuart_state_s
struct file f; /* File structure */
struct pollfd p; /* Poll structure */
spinlock_t lock; /* Spinlock */
};
struct hciuart_config_s
@@ -120,7 +121,7 @@ hciuart_rxattach(FAR const struct btuart_lowerhalf_s *lower,
/* If the callback is NULL, then we are detaching */
flags = spin_lock_irqsave(NULL);
flags = spin_lock_irqsave(&state->lock);
if (callback == NULL)
{
/* Disable Rx callbacks and detach the Rx callback */
@@ -137,7 +138,7 @@ hciuart_rxattach(FAR const struct btuart_lowerhalf_s *lower,
state->callback = callback;
}
spin_unlock_irqrestore(NULL, flags);
spin_unlock_irqrestore(&state->lock, flags);
}
/****************************************************************************
@@ -373,6 +374,7 @@ FAR struct btuart_lowerhalf_s *btuart_shim_getdevice(FAR const char *path)
s->p.events = POLLIN;
s->p.arg = n;
s->p.cb = hciuart_rxpollcb;
spin_lock_init(&s->lock);
/* Hook the routines in */