aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-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 24a5f05e769b..e5389591bb4f 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)
1054 /* Get the address of the host memory buffer. 1054 /* Get the address of the host memory buffer.
1055 */ 1055 */
1056 bdp = pinfo->rx_cur; 1056 bdp = pinfo->rx_cur;
1057 while (bdp->cbd_sc & BD_SC_EMPTY) 1057 if (bdp->cbd_sc & BD_SC_EMPTY)
1058 ; 1058 return NO_POLL_CHAR;
1059 1059
1060 /* If the buffer address is in the CPM DPRAM, don't 1060 /* If the buffer address is in the CPM DPRAM, don't
1061 * convert it. 1061 * convert it.
@@ -1090,7 +1090,11 @@ static int cpm_get_poll_char(struct uart_port *port)
1090 poll_chars = 0; 1090 poll_chars = 0;
1091 } 1091 }
1092 if (poll_chars <= 0) { 1092 if (poll_chars <= 0) {
1093 poll_chars = poll_wait_key(poll_buf, pinfo); 1093 int ret = poll_wait_key(poll_buf, pinfo);
1094
1095 if (ret == NO_POLL_CHAR)
1096 return ret;
1097 poll_chars = ret;
1094 pollp = poll_buf; 1098 pollp = poll_buf;
1095 } 1099 }
1096 poll_chars--; 1100 poll_chars--;