summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/cpm_uart
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-30 08:11:09 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-30 08:11:09 -0700
commit669c5d8d5f2be781d411ad8d52274038c795f257 (patch)
tree86cc56ec1cb077b49e58f88c1427991e2b8fbcbc /drivers/tty/serial/cpm_uart
parentc1a02c216044784f9871a5066fd22de7d0414d0d (diff)
parent17b57b1883c1285f3d0dc2266e8f79286a7bef38 (diff)
downloadlinux-669c5d8d5f2be781d411ad8d52274038c795f257.tar.bz2
Merge 4.19-rc6 into tty-next
We want the tty/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/cpm_uart')
-rw-r--r--drivers/tty/serial/cpm_uart/cpm_uart_core.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
index ea7204d75022..79ad30d34949 100644
--- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
@@ -1054,8 +1054,8 @@ static int poll_wait_key(char *obuf, struct uart_cpm_port *pinfo)
/* Get the address of the host memory buffer.
*/
bdp = pinfo->rx_cur;
- while (bdp->cbd_sc & BD_SC_EMPTY)
- ;
+ if (bdp->cbd_sc & BD_SC_EMPTY)
+ return NO_POLL_CHAR;
/* If the buffer address is in the CPM DPRAM, don't
* convert it.
@@ -1090,7 +1090,11 @@ static int cpm_get_poll_char(struct uart_port *port)
poll_chars = 0;
}
if (poll_chars <= 0) {
- poll_chars = poll_wait_key(poll_buf, pinfo);
+ int ret = poll_wait_key(poll_buf, pinfo);
+
+ if (ret == NO_POLL_CHAR)
+ return ret;
+ poll_chars = ret;
pollp = poll_buf;
}
poll_chars--;