aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/opticon.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-11-18 07:23:31 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-21 16:33:55 -0500
commit56be1a17d76d8517fe56e0e3da63d1d203b45d1e (patch)
treea6bad343b85204648f1e459f2f8242e68a84a398 /drivers/usb/serial/opticon.c
parent70d25eeeba1b7e471fc4e05ad0d8c451aab3cf5e (diff)
USB: opticon: pass port to get_serial_info
Pass port rather then private data to get_serial_info, which only used the private data to access the port. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/opticon.c')
-rw-r--r--drivers/usb/serial/opticon.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index 0178cc748c0a..92f56e476f28 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -425,7 +425,7 @@ static int opticon_tiocmset(struct tty_struct *tty,
425 return ret; 425 return ret;
426} 426}
427 427
428static int get_serial_info(struct opticon_private *priv, 428static int get_serial_info(struct usb_serial_port *port,
429 struct serial_struct __user *serial) 429 struct serial_struct __user *serial)
430{ 430{
431 struct serial_struct tmp; 431 struct serial_struct tmp;
@@ -437,7 +437,7 @@ static int get_serial_info(struct opticon_private *priv,
437 437
438 /* fake emulate a 16550 uart to make userspace code happy */ 438 /* fake emulate a 16550 uart to make userspace code happy */
439 tmp.type = PORT_16550A; 439 tmp.type = PORT_16550A;
440 tmp.line = priv->port->serial->minor; 440 tmp.line = port->serial->minor;
441 tmp.port = 0; 441 tmp.port = 0;
442 tmp.irq = 0; 442 tmp.irq = 0;
443 tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ; 443 tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
@@ -455,13 +455,12 @@ static int opticon_ioctl(struct tty_struct *tty,
455 unsigned int cmd, unsigned long arg) 455 unsigned int cmd, unsigned long arg)
456{ 456{
457 struct usb_serial_port *port = tty->driver_data; 457 struct usb_serial_port *port = tty->driver_data;
458 struct opticon_private *priv = usb_get_serial_port_data(port);
459 458
460 dev_dbg(&port->dev, "%s - port %d, cmd = 0x%x\n", __func__, port->number, cmd); 459 dev_dbg(&port->dev, "%s - port %d, cmd = 0x%x\n", __func__, port->number, cmd);
461 460
462 switch (cmd) { 461 switch (cmd) {
463 case TIOCGSERIAL: 462 case TIOCGSERIAL:
464 return get_serial_info(priv, 463 return get_serial_info(port,
465 (struct serial_struct __user *)arg); 464 (struct serial_struct __user *)arg);
466 } 465 }
467 466