diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2008-04-30 03:54:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:45 -0400 |
commit | 76b25a5509bbafdbfc7d7d6b41a3c64947d59360 (patch) | |
tree | 244786bdb849657dc9ab885c7ac2abb3eb4185d7 /drivers/char/esp.c | |
parent | 257afa3cb6beaad60849655cb272d4b9de74cf63 (diff) |
char: switch gs, cyclades and esp to return int for put_char
Signed-off-by: Alan Cox <alan@redhat.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>
Diffstat (limited to 'drivers/char/esp.c')
-rw-r--r-- | drivers/char/esp.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/char/esp.c b/drivers/char/esp.c index b1f92db31331..996d3230c929 100644 --- a/drivers/char/esp.c +++ b/drivers/char/esp.c | |||
@@ -1156,24 +1156,27 @@ static void change_speed(struct esp_struct *info) | |||
1156 | spin_unlock_irqrestore(&info->lock, flags); | 1156 | spin_unlock_irqrestore(&info->lock, flags); |
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | static void rs_put_char(struct tty_struct *tty, unsigned char ch) | 1159 | static int rs_put_char(struct tty_struct *tty, unsigned char ch) |
1160 | { | 1160 | { |
1161 | struct esp_struct *info = (struct esp_struct *)tty->driver_data; | 1161 | struct esp_struct *info = (struct esp_struct *)tty->driver_data; |
1162 | unsigned long flags; | 1162 | unsigned long flags; |
1163 | int ret = 0; | ||
1163 | 1164 | ||
1164 | if (serial_paranoia_check(info, tty->name, "rs_put_char")) | 1165 | if (serial_paranoia_check(info, tty->name, "rs_put_char")) |
1165 | return; | 1166 | return 0; |
1166 | 1167 | ||
1167 | if (!info->xmit_buf) | 1168 | if (!info->xmit_buf) |
1168 | return; | 1169 | return 0; |
1169 | 1170 | ||
1170 | spin_lock_irqsave(&info->lock, flags); | 1171 | spin_lock_irqsave(&info->lock, flags); |
1171 | if (info->xmit_cnt < ESP_XMIT_SIZE - 1) { | 1172 | if (info->xmit_cnt < ESP_XMIT_SIZE - 1) { |
1172 | info->xmit_buf[info->xmit_head++] = ch; | 1173 | info->xmit_buf[info->xmit_head++] = ch; |
1173 | info->xmit_head &= ESP_XMIT_SIZE-1; | 1174 | info->xmit_head &= ESP_XMIT_SIZE-1; |
1174 | info->xmit_cnt++; | 1175 | info->xmit_cnt++; |
1176 | ret = 1; | ||
1175 | } | 1177 | } |
1176 | spin_unlock_irqrestore(&info->lock, flags); | 1178 | spin_unlock_irqrestore(&info->lock, flags); |
1179 | return ret; | ||
1177 | } | 1180 | } |
1178 | 1181 | ||
1179 | static void rs_flush_chars(struct tty_struct *tty) | 1182 | static void rs_flush_chars(struct tty_struct *tty) |