[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180914133930.GF1362@localhost>
Date: Fri, 14 Sep 2018 15:39:30 +0200
From: Johan Hovold <johan@...nel.org>
To: Al Viro <viro@...IV.linux.org.uk>
Cc: Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 17/50] usb-serial: begin switching to ->[sg]et_serial()
On Thu, Sep 13, 2018 at 03:40:16AM +0100, Al Viro wrote:
> From: Al Viro <viro@...iv.linux.org.uk>
>
> add such methods for usb_serial_driver, provide tty_operations
> ->[sg]et_serial() calling those. For now the lack of methods
> in driver means ENOIOCTLCMD from usb-serial ->[sg]et_serial(),
> making tty_ioctl() fall back to calling ->ioctl(). Once all
> drivers are converted, we'll be returning -ENOTTY instead,
> completing the switchover.
>
> Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
> ---
> drivers/usb/serial/usb-serial.c | 18 ++++++++++++++++++
> include/linux/usb/serial.h | 2 ++
> 2 files changed, 20 insertions(+)
>
> diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
> index f7aaa7f079e1..8bdc48fa5a67 100644
> --- a/drivers/usb/serial/usb-serial.c
> +++ b/drivers/usb/serial/usb-serial.c
> @@ -396,6 +396,22 @@ static void serial_unthrottle(struct tty_struct *tty)
> port->serial->type->unthrottle(tty);
> }
>
> +static int serial_get_serial(struct tty_struct *tty, struct serial_struct *ss)
> +{
> + struct usb_serial_port *port = tty->driver_data;
Pleas add a newline here.
> + if (port->serial->type->get_serial)
> + return port->serial->type->get_serial(tty, ss);
> + return -ENOIOCTLCMD;
> +}
> +
> +static int serial_set_serial(struct tty_struct *tty, struct serial_struct *ss)
> +{
> + struct usb_serial_port *port = tty->driver_data;
And here.
> + if (port->serial->type->set_serial)
> + return port->serial->type->get_serial(tty, ss);
> + return -ENOIOCTLCMD;
> +}
Reviewed-by: Johan Hovold <johan@...nel.org>
Powered by blists - more mailing lists