diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-10-24 14:43:41 +0100 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-10-24 14:43:41 +0100 |
| commit | 44adbac8f7217040be97928cd19998259d9d4418 (patch) | |
| tree | c1c6ac9aa4d47801dc9133d6d641286631a8f4b4 /drivers/usb/serial/ssu100.c | |
| parent | 08ffb584d9eb17940321317ef6c9c7383ad4f149 (diff) | |
| parent | ce5a983191ce466cbe35e240ac09e28cca3e50c9 (diff) | |
| download | linux-44adbac8f7217040be97928cd19998259d9d4418.tar.gz linux-44adbac8f7217040be97928cd19998259d9d4418.tar.bz2 linux-44adbac8f7217040be97928cd19998259d9d4418.zip | |
Merge branch 'work.tty-ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull tty ioctl updates from Al Viro:
"This is the compat_ioctl work related to tty ioctls.
Quite a bit of dead code taken out, all tty-related stuff gone from
fs/compat_ioctl.c. A bunch of compat bugs fixed - some still remain,
but all more or less generic tty-related ioctls should be covered
(remaining issues are in things like driver-private ioctls in a pcmcia
serial card driver not getting properly handled in 32bit processes on
64bit host, etc)"
* 'work.tty-ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (53 commits)
kill TIOCSERGSTRUCT
change semantics of ldisc ->compat_ioctl()
kill TIOCSER[SG]WILD
synclink_gt(): fix compat_ioctl()
pty: fix compat ioctls
compat_ioctl - kill keyboard ioctl handling
gigaset: add ->compat_ioctl()
vt_compat_ioctl(): clean up, use compat_ptr() properly
gigaset: don't try to printk userland buffer contents
dgnc: don't bother with (empty) stub for TCXONC
dgnc: leave TIOC[GS]SOFTCAR to ldisc
remove fallback to drivers for TIOCGICOUNT
dgnc: break-related ioctls won't reach ->ioctl()
kill the rest of tty COMPAT_IOCTL() entries
dgnc: TIOCM... won't reach ->ioctl()
isdn_tty: TCSBRK{,P} won't reach ->ioctl()
kill capinc_tty_ioctl()
take compat TIOC[SG]SERIAL treatment into tty_compat_ioctl()
synclink: reduce pointless checks in ->ioctl()
complete ->[sg]et_serial() switchover
...
Diffstat (limited to 'drivers/usb/serial/ssu100.c')
| -rw-r--r-- | drivers/usb/serial/ssu100.c | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c index 0900b47b5f57..f6aea9f1be1a 100644 --- a/drivers/usb/serial/ssu100.c +++ b/drivers/usb/serial/ssu100.c @@ -331,39 +331,19 @@ static int ssu100_open(struct tty_struct *tty, struct usb_serial_port *port) return usb_serial_generic_open(tty, port); } -static int get_serial_info(struct usb_serial_port *port, - struct serial_struct __user *retinfo) -{ - struct serial_struct tmp; - - memset(&tmp, 0, sizeof(tmp)); - tmp.line = port->minor; - tmp.port = 0; - tmp.irq = 0; - tmp.xmit_fifo_size = port->bulk_out_size; - tmp.baud_base = 9600; - tmp.close_delay = 5*HZ; - tmp.closing_wait = 30*HZ; - - if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) - return -EFAULT; - return 0; -} - -static int ssu100_ioctl(struct tty_struct *tty, - unsigned int cmd, unsigned long arg) +static int get_serial_info(struct tty_struct *tty, + struct serial_struct *ss) { struct usb_serial_port *port = tty->driver_data; - switch (cmd) { - case TIOCGSERIAL: - return get_serial_info(port, - (struct serial_struct __user *) arg); - default: - break; - } - - return -ENOIOCTLCMD; + ss->line = port->minor; + ss->port = 0; + ss->irq = 0; + ss->xmit_fifo_size = port->bulk_out_size; + ss->baud_base = 9600; + ss->close_delay = 5*HZ; + ss->closing_wait = 30*HZ; + return 0; } static int ssu100_attach(struct usb_serial *serial) @@ -566,7 +546,7 @@ static struct usb_serial_driver ssu100_device = { .tiocmset = ssu100_tiocmset, .tiocmiwait = usb_serial_generic_tiocmiwait, .get_icount = usb_serial_generic_get_icount, - .ioctl = ssu100_ioctl, + .get_serial = get_serial_info, .set_termios = ssu100_set_termios, }; |
