Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

amiserial: Switch put char to return success/fail

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>

authored by

Alan Cox and committed by
Linus Torvalds
257afa3c 4cd55ab1

+6 -5
+6 -5
drivers/char/amiserial.c
··· 832 832 local_irq_restore(flags); 833 833 } 834 834 835 - static void rs_put_char(struct tty_struct *tty, unsigned char ch) 835 + static int rs_put_char(struct tty_struct *tty, unsigned char ch) 836 836 { 837 837 struct async_struct *info; 838 838 unsigned long flags; 839 839 840 840 if (!tty) 841 - return; 841 + return 0; 842 842 843 843 info = tty->driver_data; 844 844 845 845 if (serial_paranoia_check(info, tty->name, "rs_put_char")) 846 - return; 846 + return 0; 847 847 848 848 if (!info->xmit.buf) 849 - return; 849 + return 0; 850 850 851 851 local_irq_save(flags); 852 852 if (CIRC_SPACE(info->xmit.head, 853 853 info->xmit.tail, 854 854 SERIAL_XMIT_SIZE) == 0) { 855 855 local_irq_restore(flags); 856 - return; 856 + return 0; 857 857 } 858 858 859 859 info->xmit.buf[info->xmit.head++] = ch; 860 860 info->xmit.head &= SERIAL_XMIT_SIZE-1; 861 861 local_irq_restore(flags); 862 + return 1; 862 863 } 863 864 864 865 static void rs_flush_chars(struct tty_struct *tty)