Commit 2da050e4 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'usb-serial-4.16-rc1' of...

Merge tag 'usb-serial-4.16-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next

Johan writes:

USB-serial updates for v4.16-rc1

Here are the USB-serial updates for 4.16-rc1, including:

 - a fix for a potential sleep-while-atomic (warning) in an io_edgeport
   error path
 - removal of a dummy TIOCSSERIAL implementation in ark3116
 - new features for Fintek F81532/534 devices:
   - support for higher baud rates (up to 1.5 Mbps)
   - support for auto-RTS (for RS-485)
   - support for transceiver configuration
   - support for detecting disabled ports

Included are also various clean ups.

All have been (at least compile tested) in linux-next without any
reported issues.
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parents 0dbbad99 d1c48227
......@@ -83,7 +83,10 @@ static int ark3116_write_reg(struct usb_serial *serial,
usb_sndctrlpipe(serial->dev, 0),
0xfe, 0x40, val, reg,
NULL, 0, ARK_TIMEOUT);
return result;
if (result)
return result;
return 0;
}
static int ark3116_read_reg(struct usb_serial *serial,
......@@ -105,7 +108,7 @@ static int ark3116_read_reg(struct usb_serial *serial,
return result;
}
return buf[0];
return 0;
}
static inline int calc_divisor(int bps)
......@@ -355,13 +358,13 @@ static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port)
/* read modem status */
result = ark3116_read_reg(serial, UART_MSR, buf);
if (result < 0)
if (result)
goto err_close;
priv->msr = *buf;
/* read line status */
result = ark3116_read_reg(serial, UART_LSR, buf);
if (result < 0)
if (result)
goto err_close;
priv->lsr = *buf;
......@@ -394,31 +397,35 @@ static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port)
return result;
}
static int ark3116_get_serial_info(struct usb_serial_port *port,
struct serial_struct __user *retinfo)
{
struct serial_struct tmp;
memset(&tmp, 0, sizeof(tmp));
tmp.type = PORT_16654;
tmp.line = port->minor;
tmp.port = port->port_number;
tmp.baud_base = 460800;
if (copy_to_user(retinfo, &tmp, sizeof(tmp)))
return -EFAULT;
return 0;
}
static int ark3116_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
{
struct usb_serial_port *port = tty->driver_data;
struct serial_struct serstruct;
void __user *user_arg = (void __user *)arg;
switch (cmd) {
case TIOCGSERIAL:
/* XXX: Some of these values are probably wrong. */
memset(&serstruct, 0, sizeof(serstruct));
serstruct.type = PORT_16654;
serstruct.line = port->minor;
serstruct.port = port->port_number;
serstruct.custom_divisor = 0;
serstruct.baud_base = 460800;
if (copy_to_user(user_arg, &serstruct, sizeof(serstruct)))
return -EFAULT;
return 0;
case TIOCSSERIAL:
if (copy_from_user(&serstruct, user_arg, sizeof(serstruct)))
return -EFAULT;
return 0;
return ark3116_get_serial_info(port, user_arg);
default:
break;
}
return -ENOIOCTLCMD;
......
This diff is collapsed.
......@@ -2282,7 +2282,6 @@ static int write_cmd_usb(struct edgeport_port *edge_port,
/* something went wrong */
dev_err(dev, "%s - usb_submit_urb(write command) failed, status = %d\n",
__func__, status);
usb_kill_urb(urb);
usb_free_urb(urb);
atomic_dec(&CmdUrbs);
return status;
......
......@@ -472,7 +472,6 @@ static int iuu_clk(struct usb_serial_port *port, int dwFrq)
}
}
P2 = ((P - PO) / 2) - 4;
DIV = DIV;
PUMP = 0x04;
PBmsb = (P2 >> 8 & 0x03);
PBlsb = P2 & 0xFF;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment