aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/synclink.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/synclink.c')
-rw-r--r--drivers/char/synclink.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index dbbd998ae103..4fbfff7a442e 100644
--- a/drivers/char/synclink.c
+++ b/drivers/char/synclink.c
@@ -2026,10 +2026,11 @@ static void mgsl_change_params(struct mgsl_struct *info)
2026 * 2026 *
2027 * Return Value: None 2027 * Return Value: None
2028 */ 2028 */
2029static void mgsl_put_char(struct tty_struct *tty, unsigned char ch) 2029static int mgsl_put_char(struct tty_struct *tty, unsigned char ch)
2030{ 2030{
2031 struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data; 2031 struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data;
2032 unsigned long flags; 2032 unsigned long flags;
2033 int ret;
2033 2034
2034 if ( debug_level >= DEBUG_LEVEL_INFO ) { 2035 if ( debug_level >= DEBUG_LEVEL_INFO ) {
2035 printk( "%s(%d):mgsl_put_char(%d) on %s\n", 2036 printk( "%s(%d):mgsl_put_char(%d) on %s\n",
@@ -2037,23 +2038,23 @@ static void mgsl_put_char(struct tty_struct *tty, unsigned char ch)
2037 } 2038 }
2038 2039
2039 if (mgsl_paranoia_check(info, tty->name, "mgsl_put_char")) 2040 if (mgsl_paranoia_check(info, tty->name, "mgsl_put_char"))
2040 return; 2041 return 0;
2041 2042
2042 if (!tty || !info->xmit_buf) 2043 if (!tty || !info->xmit_buf)
2043 return; 2044 return 0;
2044 2045
2045 spin_lock_irqsave(&info->irq_spinlock,flags); 2046 spin_lock_irqsave(&info->irq_spinlock,flags);
2046 2047
2047 if ( (info->params.mode == MGSL_MODE_ASYNC ) || !info->tx_active ) { 2048 if ( (info->params.mode == MGSL_MODE_ASYNC ) || !info->tx_active ) {
2048
2049 if (info->xmit_cnt < SERIAL_XMIT_SIZE - 1) { 2049 if (info->xmit_cnt < SERIAL_XMIT_SIZE - 1) {
2050 info->xmit_buf[info->xmit_head++] = ch; 2050 info->xmit_buf[info->xmit_head++] = ch;
2051 info->xmit_head &= SERIAL_XMIT_SIZE-1; 2051 info->xmit_head &= SERIAL_XMIT_SIZE-1;
2052 info->xmit_cnt++; 2052 info->xmit_cnt++;
2053 ret = 1;
2053 } 2054 }
2054 } 2055 }
2055
2056 spin_unlock_irqrestore(&info->irq_spinlock,flags); 2056 spin_unlock_irqrestore(&info->irq_spinlock,flags);
2057 return ret;
2057 2058
2058} /* end of mgsl_put_char() */ 2059} /* end of mgsl_put_char() */
2059 2060