aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-04-30 03:54:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:46 -0400
commit55da77899c1472d83452c914fa179d00ea96df65 (patch)
tree2ae215ad812ceb8f453e49ab708fd232795817ff
parent6ae045767b2adae4e8fc054b980326a971ac4c8e (diff)
synclink series: switch to int put_char method
Signed-off-by: Alan Cox <alan@redhat.com> Cc: Paul Fulghum <paulkf@microgate.com> Cc: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/char/synclink.c11
-rw-r--r--drivers/char/synclink_gt.c14
-rw-r--r--drivers/char/synclinkmp.c11
3 files changed, 22 insertions, 14 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
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index 1a11717b1adc..430f5bc0ae30 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -151,7 +151,7 @@ static void hangup(struct tty_struct *tty);
151static void set_termios(struct tty_struct *tty, struct ktermios *old_termios); 151static void set_termios(struct tty_struct *tty, struct ktermios *old_termios);
152 152
153static int write(struct tty_struct *tty, const unsigned char *buf, int count); 153static int write(struct tty_struct *tty, const unsigned char *buf, int count);
154static void put_char(struct tty_struct *tty, unsigned char ch); 154static int put_char(struct tty_struct *tty, unsigned char ch);
155static void send_xchar(struct tty_struct *tty, char ch); 155static void send_xchar(struct tty_struct *tty, char ch);
156static void wait_until_sent(struct tty_struct *tty, int timeout); 156static void wait_until_sent(struct tty_struct *tty, int timeout);
157static int write_room(struct tty_struct *tty); 157static int write_room(struct tty_struct *tty);
@@ -912,20 +912,24 @@ cleanup:
912 return ret; 912 return ret;
913} 913}
914 914
915static void put_char(struct tty_struct *tty, unsigned char ch) 915static int put_char(struct tty_struct *tty, unsigned char ch)
916{ 916{
917 struct slgt_info *info = tty->driver_data; 917 struct slgt_info *info = tty->driver_data;
918 unsigned long flags; 918 unsigned long flags;
919 int ret;
919 920
920 if (sanity_check(info, tty->name, "put_char")) 921 if (sanity_check(info, tty->name, "put_char"))
921 return; 922 return 0;
922 DBGINFO(("%s put_char(%d)\n", info->device_name, ch)); 923 DBGINFO(("%s put_char(%d)\n", info->device_name, ch));
923 if (!info->tx_buf) 924 if (!info->tx_buf)
924 return; 925 return 0;
925 spin_lock_irqsave(&info->lock,flags); 926 spin_lock_irqsave(&info->lock,flags);
926 if (!info->tx_active && (info->tx_count < info->max_frame_size)) 927 if (!info->tx_active && (info->tx_count < info->max_frame_size)) {
927 info->tx_buf[info->tx_count++] = ch; 928 info->tx_buf[info->tx_count++] = ch;
929 ret = 1;
930 }
928 spin_unlock_irqrestore(&info->lock,flags); 931 spin_unlock_irqrestore(&info->lock,flags);
932 return ret;
929} 933}
930 934
931static void send_xchar(struct tty_struct *tty, char ch) 935static void send_xchar(struct tty_struct *tty, char ch)
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index 2f1988c48ee3..a624ffd7baaa 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -519,7 +519,7 @@ static void hangup(struct tty_struct *tty);
519static void set_termios(struct tty_struct *tty, struct ktermios *old_termios); 519static void set_termios(struct tty_struct *tty, struct ktermios *old_termios);
520 520
521static int write(struct tty_struct *tty, const unsigned char *buf, int count); 521static int write(struct tty_struct *tty, const unsigned char *buf, int count);
522static void put_char(struct tty_struct *tty, unsigned char ch); 522static int put_char(struct tty_struct *tty, unsigned char ch);
523static void send_xchar(struct tty_struct *tty, char ch); 523static void send_xchar(struct tty_struct *tty, char ch);
524static void wait_until_sent(struct tty_struct *tty, int timeout); 524static void wait_until_sent(struct tty_struct *tty, int timeout);
525static int write_room(struct tty_struct *tty); 525static int write_room(struct tty_struct *tty);
@@ -1045,10 +1045,11 @@ cleanup:
1045 1045
1046/* Add a character to the transmit buffer. 1046/* Add a character to the transmit buffer.
1047 */ 1047 */
1048static void put_char(struct tty_struct *tty, unsigned char ch) 1048static int put_char(struct tty_struct *tty, unsigned char ch)
1049{ 1049{
1050 SLMP_INFO *info = (SLMP_INFO *)tty->driver_data; 1050 SLMP_INFO *info = (SLMP_INFO *)tty->driver_data;
1051 unsigned long flags; 1051 unsigned long flags;
1052 int ret = 0;
1052 1053
1053 if ( debug_level >= DEBUG_LEVEL_INFO ) { 1054 if ( debug_level >= DEBUG_LEVEL_INFO ) {
1054 printk( "%s(%d):%s put_char(%d)\n", 1055 printk( "%s(%d):%s put_char(%d)\n",
@@ -1056,10 +1057,10 @@ static void put_char(struct tty_struct *tty, unsigned char ch)
1056 } 1057 }
1057 1058
1058 if (sanity_check(info, tty->name, "put_char")) 1059 if (sanity_check(info, tty->name, "put_char"))
1059 return; 1060 return 0;
1060 1061
1061 if (!info->tx_buf) 1062 if (!info->tx_buf)
1062 return; 1063 return 0;
1063 1064
1064 spin_lock_irqsave(&info->lock,flags); 1065 spin_lock_irqsave(&info->lock,flags);
1065 1066
@@ -1071,10 +1072,12 @@ static void put_char(struct tty_struct *tty, unsigned char ch)
1071 if (info->tx_put >= info->max_frame_size) 1072 if (info->tx_put >= info->max_frame_size)
1072 info->tx_put -= info->max_frame_size; 1073 info->tx_put -= info->max_frame_size;
1073 info->tx_count++; 1074 info->tx_count++;
1075 ret = 1;
1074 } 1076 }
1075 } 1077 }
1076 1078
1077 spin_unlock_irqrestore(&info->lock,flags); 1079 spin_unlock_irqrestore(&info->lock,flags);
1080 return ret;
1078} 1081}
1079 1082
1080/* Send a high-priority XON/XOFF character 1083/* Send a high-priority XON/XOFF character