tty: xtensa/iss: drop unneeded tty_operations hooks
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Thu, 10 Aug 2023 09:14:35 +0000 (11:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2023 19:12:44 +0000 (21:12 +0200)
All ::flush_chars(), ::hangup(), and ::wait_until_sent() from struct
tty_operations are optional. There is no need to provide them with
empty bodies.

tty_operations::put_char() needs not be provided if it is the same as
tty_operations::write(tty, &ch, 1).

So drop all of them.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Link: https://lore.kernel.org/r/20230810091510.13006-2-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/xtensa/platforms/iss/console.c

index 10b79d3..b40b738 100644 (file)
@@ -82,32 +82,12 @@ static void rs_poll(struct timer_list *unused)
                mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE);
 }
 
-
-static int rs_put_char(struct tty_struct *tty, unsigned char ch)
-{
-       return rs_write(tty, &ch, 1);
-}
-
-static void rs_flush_chars(struct tty_struct *tty)
-{
-}
-
 static unsigned int rs_write_room(struct tty_struct *tty)
 {
        /* Let's say iss can always accept 2K characters.. */
        return 2 * 1024;
 }
 
-static void rs_hangup(struct tty_struct *tty)
-{
-       /* Stub, once again.. */
-}
-
-static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
-{
-       /* Stub, once again.. */
-}
-
 static int rs_proc_show(struct seq_file *m, void *v)
 {
        seq_printf(m, "serinfo:1.0 driver:0.1\n");
@@ -118,11 +98,7 @@ static const struct tty_operations serial_ops = {
        .open = rs_open,
        .close = rs_close,
        .write = rs_write,
-       .put_char = rs_put_char,
-       .flush_chars = rs_flush_chars,
        .write_room = rs_write_room,
-       .hangup = rs_hangup,
-       .wait_until_sent = rs_wait_until_sent,
        .proc_show = rs_proc_show,
 };