mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 14:41:31 +00:00
dm: serial: ns16550: Correct logic for checking for character
There is a bug in the logic which checks for an available character. This can cause invalid characters to be received - this was noticed on beaglebone. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
This commit is contained in:
parent
c487fd476c
commit
aea2be2012
1 changed files with 1 additions and 1 deletions
|
@ -253,7 +253,7 @@ static int ns16550_serial_getc(struct udevice *dev)
|
|||
{
|
||||
struct NS16550 *const com_port = dev_get_priv(dev);
|
||||
|
||||
if (!serial_in(&com_port->lsr) & UART_LSR_DR)
|
||||
if (!(serial_in(&com_port->lsr) & UART_LSR_DR))
|
||||
return -EAGAIN;
|
||||
|
||||
return serial_in(&com_port->rbr);
|
||||
|
|
Loading…
Add table
Reference in a new issue