diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-09-11 23:38:49 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-10-13 00:50:36 -0400 |
commit | c8f97e77d53ff0717a1175b3cdefa497127347f9 (patch) | |
tree | 88f23743a44890843659ed603558f3e5e7ece4ff | |
parent | 056abede09a779acda8e24b941d62bf0fed33f64 (diff) |
f81534: switch to ->get_serial()
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | drivers/usb/serial/f81534.c | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/drivers/usb/serial/f81534.c b/drivers/usb/serial/f81534.c index 4dfbff20bda4..380933db34dd 100644 --- a/drivers/usb/serial/f81534.c +++ b/drivers/usb/serial/f81534.c | |||
@@ -1139,43 +1139,21 @@ static void f81534_close(struct usb_serial_port *port) | |||
1139 | mutex_unlock(&serial_priv->urb_mutex); | 1139 | mutex_unlock(&serial_priv->urb_mutex); |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | static int f81534_get_serial_info(struct usb_serial_port *port, | 1142 | static int f81534_get_serial_info(struct tty_struct *tty, |
1143 | struct serial_struct __user *retinfo) | 1143 | struct serial_struct *ss) |
1144 | { | 1144 | { |
1145 | struct usb_serial_port *port = tty->driver_data; | ||
1145 | struct f81534_port_private *port_priv; | 1146 | struct f81534_port_private *port_priv; |
1146 | struct serial_struct tmp; | ||
1147 | 1147 | ||
1148 | port_priv = usb_get_serial_port_data(port); | 1148 | port_priv = usb_get_serial_port_data(port); |
1149 | 1149 | ||
1150 | memset(&tmp, 0, sizeof(tmp)); | 1150 | ss->type = PORT_16550A; |
1151 | 1151 | ss->port = port->port_number; | |
1152 | tmp.type = PORT_16550A; | 1152 | ss->line = port->minor; |
1153 | tmp.port = port->port_number; | 1153 | ss->baud_base = port_priv->baud_base; |
1154 | tmp.line = port->minor; | ||
1155 | tmp.baud_base = port_priv->baud_base; | ||
1156 | |||
1157 | if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) | ||
1158 | return -EFAULT; | ||
1159 | |||
1160 | return 0; | 1154 | return 0; |
1161 | } | 1155 | } |
1162 | 1156 | ||
1163 | static int f81534_ioctl(struct tty_struct *tty, unsigned int cmd, | ||
1164 | unsigned long arg) | ||
1165 | { | ||
1166 | struct usb_serial_port *port = tty->driver_data; | ||
1167 | struct serial_struct __user *buf = (struct serial_struct __user *)arg; | ||
1168 | |||
1169 | switch (cmd) { | ||
1170 | case TIOCGSERIAL: | ||
1171 | return f81534_get_serial_info(port, buf); | ||
1172 | default: | ||
1173 | break; | ||
1174 | } | ||
1175 | |||
1176 | return -ENOIOCTLCMD; | ||
1177 | } | ||
1178 | |||
1179 | static void f81534_process_per_serial_block(struct usb_serial_port *port, | 1157 | static void f81534_process_per_serial_block(struct usb_serial_port *port, |
1180 | u8 *data) | 1158 | u8 *data) |
1181 | { | 1159 | { |
@@ -1581,7 +1559,7 @@ static struct usb_serial_driver f81534_device = { | |||
1581 | .break_ctl = f81534_break_ctl, | 1559 | .break_ctl = f81534_break_ctl, |
1582 | .dtr_rts = f81534_dtr_rts, | 1560 | .dtr_rts = f81534_dtr_rts, |
1583 | .process_read_urb = f81534_process_read_urb, | 1561 | .process_read_urb = f81534_process_read_urb, |
1584 | .ioctl = f81534_ioctl, | 1562 | .get_serial = f81534_get_serial_info, |
1585 | .tiocmget = f81534_tiocmget, | 1563 | .tiocmget = f81534_tiocmget, |
1586 | .tiocmset = f81534_tiocmset, | 1564 | .tiocmset = f81534_tiocmset, |
1587 | .write_bulk_callback = f81534_write_usb_callback, | 1565 | .write_bulk_callback = f81534_write_usb_callback, |