tty: xtensa/iss: drop unneeded tty_operations hooks

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>
This commit is contained in:
Jiri Slaby (SUSE) 2023-08-10 11:14:35 +02:00 committed by Greg Kroah-Hartman
parent 9c8441330b
commit ebf9ec7a45
1 changed files with 0 additions and 24 deletions

View 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,
};