Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56be1a17 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

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: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 70d25eee
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -425,7 +425,7 @@ static int opticon_tiocmset(struct tty_struct *tty,
	return ret;
	return ret;
}
}


static int get_serial_info(struct opticon_private *priv,
static int get_serial_info(struct usb_serial_port *port,
			   struct serial_struct __user *serial)
			   struct serial_struct __user *serial)
{
{
	struct serial_struct tmp;
	struct serial_struct tmp;
@@ -437,7 +437,7 @@ static int get_serial_info(struct opticon_private *priv,


	/* fake emulate a 16550 uart to make userspace code happy */
	/* fake emulate a 16550 uart to make userspace code happy */
	tmp.type		= PORT_16550A;
	tmp.type		= PORT_16550A;
	tmp.line		= priv->port->serial->minor;
	tmp.line		= port->serial->minor;
	tmp.port		= 0;
	tmp.port		= 0;
	tmp.irq			= 0;
	tmp.irq			= 0;
	tmp.flags		= ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
	tmp.flags		= ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
@@ -455,13 +455,12 @@ static int opticon_ioctl(struct tty_struct *tty,
			 unsigned int cmd, unsigned long arg)
			 unsigned int cmd, unsigned long arg)
{
{
	struct usb_serial_port *port = tty->driver_data;
	struct usb_serial_port *port = tty->driver_data;
	struct opticon_private *priv = usb_get_serial_port_data(port);


	dev_dbg(&port->dev, "%s - port %d, cmd = 0x%x\n", __func__, port->number, cmd);
	dev_dbg(&port->dev, "%s - port %d, cmd = 0x%x\n", __func__, port->number, cmd);


	switch (cmd) {
	switch (cmd) {
	case TIOCGSERIAL:
	case TIOCGSERIAL:
		return get_serial_info(priv,
		return get_serial_info(port,
				       (struct serial_struct __user *)arg);
				       (struct serial_struct __user *)arg);
	}
	}