summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/pmac_zilog.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-08-17 11:12:28 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-08-17 11:12:28 -0700
commit225a389b31b0e3a57dda64055d5e25f93e5c76ac (patch)
tree9ac21d481ac11f29be055a0b5513c525574ef8a5 /drivers/tty/serial/pmac_zilog.c
parent557e2e2eef90d7d3d4ee5396c1ecee873c3dd46e (diff)
parent38f8eefccf3a23c4058a570fa2938a4f553cf8e0 (diff)
Merge tag 'tty-3.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull TTY fixes from Greg Kroah-Hartman: "Here are 4 tiny patches, each fixing a serial driver problem that people have reported. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'tty-3.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: pmac_zilog,kdb: Fix console poll hook to return instead of loop serial: mxs-auart: fix the wrong RTS hardware flow control serial: ifx6x60: fix paging fault on spi_register_driver serial: Change Kconfig entry for CLPS711X-target
Diffstat (limited to 'drivers/tty/serial/pmac_zilog.c')
-rw-r--r--drivers/tty/serial/pmac_zilog.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
index 654755a990df..333c8d012b0e 100644
--- a/drivers/tty/serial/pmac_zilog.c
+++ b/drivers/tty/serial/pmac_zilog.c
@@ -1348,10 +1348,16 @@ static int pmz_verify_port(struct uart_port *port, struct serial_struct *ser)
static int pmz_poll_get_char(struct uart_port *port)
{
struct uart_pmac_port *uap = (struct uart_pmac_port *)port;
+ int tries = 2;
- while ((read_zsreg(uap, R0) & Rx_CH_AV) == 0)
- udelay(5);
- return read_zsdata(uap);
+ while (tries) {
+ if ((read_zsreg(uap, R0) & Rx_CH_AV) != 0)
+ return read_zsdata(uap);
+ if (tries--)
+ udelay(5);
+ }
+
+ return NO_POLL_CHAR;
}
static void pmz_poll_put_char(struct uart_port *port, unsigned char c)