Skip to content

Commit

Permalink
serial/uart_16550: remove up_putc spinlock
Browse files Browse the repository at this point in the history
putc atomicity should be guaranteed by common code rather than add similar hack to lower half driver

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao committed Sep 12, 2024
1 parent 75ed9a4 commit a483191
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/serial/uart_16550.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include <nuttx/serial/serial.h>
#include <nuttx/fs/ioctl.h>
#include <nuttx/serial/uart_16550.h>
#include <nuttx/spinlock.h>

#include <arch/board/board.h>

Expand Down Expand Up @@ -1696,12 +1695,8 @@ static bool u16550_txempty(struct uart_dev_s *dev)
#ifdef HAVE_16550_CONSOLE
static void u16550_putc(FAR struct u16550_s *priv, int ch)
{
irqstate_t flags;

flags = spin_lock_irqsave(NULL);
while ((u16550_serialin(priv, UART_LSR_OFFSET) & UART_LSR_THRE) == 0);
u16550_serialout(priv, UART_THR_OFFSET, (uart_datawidth_t)ch);
spin_unlock_irqrestore(NULL, flags);
}
#endif

Expand Down

0 comments on commit a483191

Please sign in to comment.