mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-18 10:13:57 +08:00
io_edgeport: switch to ->get_serial()
Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
3ae36bed3a
commit
e27235eda5
@ -1637,24 +1637,20 @@ static int edge_tiocmget(struct tty_struct *tty)
|
||||
return result;
|
||||
}
|
||||
|
||||
static int get_serial_info(struct edgeport_port *edge_port,
|
||||
struct serial_struct __user *retinfo)
|
||||
static int get_serial_info(struct tty_struct *tty,
|
||||
struct serial_struct *ss)
|
||||
{
|
||||
struct serial_struct tmp;
|
||||
struct usb_serial_port *port = tty->driver_data;
|
||||
struct edgeport_port *edge_port = usb_get_serial_port_data(port);
|
||||
|
||||
memset(&tmp, 0, sizeof(tmp));
|
||||
|
||||
tmp.type = PORT_16550A;
|
||||
tmp.line = edge_port->port->minor;
|
||||
tmp.port = edge_port->port->port_number;
|
||||
tmp.irq = 0;
|
||||
tmp.xmit_fifo_size = edge_port->maxTxCredits;
|
||||
tmp.baud_base = 9600;
|
||||
tmp.close_delay = 5*HZ;
|
||||
tmp.closing_wait = 30*HZ;
|
||||
|
||||
if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
|
||||
return -EFAULT;
|
||||
ss->type = PORT_16550A;
|
||||
ss->line = edge_port->port->minor;
|
||||
ss->port = edge_port->port->port_number;
|
||||
ss->irq = 0;
|
||||
ss->xmit_fifo_size = edge_port->maxTxCredits;
|
||||
ss->baud_base = 9600;
|
||||
ss->close_delay = 5*HZ;
|
||||
ss->closing_wait = 30*HZ;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1667,17 +1663,12 @@ static int edge_ioctl(struct tty_struct *tty,
|
||||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct usb_serial_port *port = tty->driver_data;
|
||||
DEFINE_WAIT(wait);
|
||||
struct edgeport_port *edge_port = usb_get_serial_port_data(port);
|
||||
|
||||
switch (cmd) {
|
||||
case TIOCSERGETLSR:
|
||||
dev_dbg(&port->dev, "%s TIOCSERGETLSR\n", __func__);
|
||||
return get_lsr_info(edge_port, (unsigned int __user *) arg);
|
||||
|
||||
case TIOCGSERIAL:
|
||||
dev_dbg(&port->dev, "%s TIOCGSERIAL\n", __func__);
|
||||
return get_serial_info(edge_port, (struct serial_struct __user *) arg);
|
||||
}
|
||||
return -ENOIOCTLCMD;
|
||||
}
|
||||
@ -3126,6 +3117,7 @@ static struct usb_serial_driver edgeport_2port_device = {
|
||||
.set_termios = edge_set_termios,
|
||||
.tiocmget = edge_tiocmget,
|
||||
.tiocmset = edge_tiocmset,
|
||||
.get_serial = get_serial_info,
|
||||
.tiocmiwait = usb_serial_generic_tiocmiwait,
|
||||
.get_icount = usb_serial_generic_get_icount,
|
||||
.write = edge_write,
|
||||
@ -3161,6 +3153,7 @@ static struct usb_serial_driver edgeport_4port_device = {
|
||||
.set_termios = edge_set_termios,
|
||||
.tiocmget = edge_tiocmget,
|
||||
.tiocmset = edge_tiocmset,
|
||||
.get_serial = get_serial_info,
|
||||
.tiocmiwait = usb_serial_generic_tiocmiwait,
|
||||
.get_icount = usb_serial_generic_get_icount,
|
||||
.write = edge_write,
|
||||
@ -3196,6 +3189,7 @@ static struct usb_serial_driver edgeport_8port_device = {
|
||||
.set_termios = edge_set_termios,
|
||||
.tiocmget = edge_tiocmget,
|
||||
.tiocmset = edge_tiocmset,
|
||||
.get_serial = get_serial_info,
|
||||
.tiocmiwait = usb_serial_generic_tiocmiwait,
|
||||
.get_icount = usb_serial_generic_get_icount,
|
||||
.write = edge_write,
|
||||
@ -3231,6 +3225,7 @@ static struct usb_serial_driver epic_device = {
|
||||
.set_termios = edge_set_termios,
|
||||
.tiocmget = edge_tiocmget,
|
||||
.tiocmset = edge_tiocmset,
|
||||
.get_serial = get_serial_info,
|
||||
.tiocmiwait = usb_serial_generic_tiocmiwait,
|
||||
.get_icount = usb_serial_generic_get_icount,
|
||||
.write = edge_write,
|
||||
|
Loading…
Reference in New Issue
Block a user