Commit 9e7c9a19 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

s390 tty: Prepare for put_char to return success/fail

Put the changes into the drivers first.  This will still compile/work but
produce a warning if bisected so can still be debugged
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 978e595f
...@@ -982,15 +982,16 @@ tty3215_write(struct tty_struct * tty, ...@@ -982,15 +982,16 @@ tty3215_write(struct tty_struct * tty,
/* /*
* Put character routine for 3215 ttys * Put character routine for 3215 ttys
*/ */
static void static int
tty3215_put_char(struct tty_struct *tty, unsigned char ch) tty3215_put_char(struct tty_struct *tty, unsigned char ch)
{ {
struct raw3215_info *raw; struct raw3215_info *raw;
if (!tty) if (!tty)
return; return 0;
raw = (struct raw3215_info *) tty->driver_data; raw = (struct raw3215_info *) tty->driver_data;
raw3215_putchar(raw, ch); raw3215_putchar(raw, ch);
return 1;
} }
static void static void
......
...@@ -412,14 +412,14 @@ sclp_tty_write(struct tty_struct *tty, const unsigned char *buf, int count) ...@@ -412,14 +412,14 @@ sclp_tty_write(struct tty_struct *tty, const unsigned char *buf, int count)
* - including previous characters from sclp_tty_put_char() and strings from * - including previous characters from sclp_tty_put_char() and strings from
* sclp_write() without final '\n' - will be written. * sclp_write() without final '\n' - will be written.
*/ */
static void static int
sclp_tty_put_char(struct tty_struct *tty, unsigned char ch) sclp_tty_put_char(struct tty_struct *tty, unsigned char ch)
{ {
sclp_tty_chars[sclp_tty_chars_count++] = ch; sclp_tty_chars[sclp_tty_chars_count++] = ch;
if (ch == '\n' || sclp_tty_chars_count >= SCLP_TTY_BUF_SIZE) { if (ch == '\n' || sclp_tty_chars_count >= SCLP_TTY_BUF_SIZE) {
sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count); sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count);
sclp_tty_chars_count = 0; sclp_tty_chars_count = 0;
} } return 1;
} }
/* /*
......
...@@ -524,11 +524,15 @@ sclp_vt220_close(struct tty_struct *tty, struct file *filp) ...@@ -524,11 +524,15 @@ sclp_vt220_close(struct tty_struct *tty, struct file *filp)
* NOTE: include/linux/tty_driver.h specifies that a character should be * NOTE: include/linux/tty_driver.h specifies that a character should be
* ignored if there is no room in the queue. This driver implements a different * ignored if there is no room in the queue. This driver implements a different
* semantic in that it will block when there is no more room left. * semantic in that it will block when there is no more room left.
*
* FIXME: putchar can currently be called from BH and other non blocking
* handlers so this semantic isn't a good idea.
*/ */
static void static int
sclp_vt220_put_char(struct tty_struct *tty, unsigned char ch) sclp_vt220_put_char(struct tty_struct *tty, unsigned char ch)
{ {
__sclp_vt220_write(&ch, 1, 0, 0, 1); __sclp_vt220_write(&ch, 1, 0, 0, 1);
return 1;
} }
/* /*
......
...@@ -965,7 +965,7 @@ tty3270_write_room(struct tty_struct *tty) ...@@ -965,7 +965,7 @@ tty3270_write_room(struct tty_struct *tty)
* Insert character into the screen at the current position with the * Insert character into the screen at the current position with the
* current color and highlight. This function does NOT do cursor movement. * current color and highlight. This function does NOT do cursor movement.
*/ */
static void static int
tty3270_put_character(struct tty3270 *tp, char ch) tty3270_put_character(struct tty3270 *tp, char ch)
{ {
struct tty3270_line *line; struct tty3270_line *line;
...@@ -986,6 +986,7 @@ tty3270_put_character(struct tty3270 *tp, char ch) ...@@ -986,6 +986,7 @@ tty3270_put_character(struct tty3270 *tp, char ch)
cell->character = tp->view.ascebc[(unsigned int) ch]; cell->character = tp->view.ascebc[(unsigned int) ch];
cell->highlight = tp->highlight; cell->highlight = tp->highlight;
cell->f_color = tp->f_color; cell->f_color = tp->f_color;
return 1;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment