summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-10-22 21:37:03 -0600
committerSimon Glass <sjg@chromium.org>2014-10-23 19:29:07 -0600
commitaea2be2012f474ddc9f372547e487ee74d4eb67a (patch)
tree948ef04a8c5185c57554d14dc076856e001b9b14
parentc487fd476c8779dbd6ee1427489f1312b34bfc5e (diff)
downloadu-boot-imx-aea2be2012f474ddc9f372547e487ee74d4eb67a.zip
u-boot-imx-aea2be2012f474ddc9f372547e487ee74d4eb67a.tar.gz
u-boot-imx-aea2be2012f474ddc9f372547e487ee74d4eb67a.tar.bz2
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>
-rw-r--r--drivers/serial/ns16550.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 63a9ef6..fe6cc26 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -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);