Commit b6de1f90 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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

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

Johan writes:

USB-serial updates for 5.20-rc1

Here are the USB-serial updates for 5.20-rc1, including

 - a fix up of some tty-port initialized comments that had got
   truncated and obfuscated

Included are also various clean ups.

All but the final commit have been in linux-next and with no reported
issues.

* tag 'usb-serial-5.20-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial:
  USB: serial: fix tty-port initialized comments
  USB: serial: fix repeated word "the" in comments
  USB: serial: io_edgeport: fix spelling mistakes
  USB: serial: use kmemdup instead of kmalloc + memcpy
parents d5e22360 688ee1d1
...@@ -256,7 +256,7 @@ static int analyze_baud_rate(struct usb_serial_port *port, speed_t new_rate) ...@@ -256,7 +256,7 @@ static int analyze_baud_rate(struct usb_serial_port *port, speed_t new_rate)
/* /*
* Mike Isely <isely@pobox.com> 2-Feb-2008: The * Mike Isely <isely@pobox.com> 2-Feb-2008: The
* Cypress app note that describes this mechanism * Cypress app note that describes this mechanism
* states the the low-speed part can't handle more * states that the low-speed part can't handle more
* than 800 bytes/sec, in which case 4800 baud is the * than 800 bytes/sec, in which case 4800 baud is the
* safest speed for a part like that. * safest speed for a part like that.
*/ */
......
...@@ -988,7 +988,7 @@ static int garmin_write_bulk(struct usb_serial_port *port, ...@@ -988,7 +988,7 @@ static int garmin_write_bulk(struct usb_serial_port *port,
garmin_data_p->flags &= ~FLAGS_DROP_DATA; garmin_data_p->flags &= ~FLAGS_DROP_DATA;
spin_unlock_irqrestore(&garmin_data_p->lock, flags); spin_unlock_irqrestore(&garmin_data_p->lock, flags);
buffer = kmalloc(count, GFP_ATOMIC); buffer = kmemdup(buf, count, GFP_ATOMIC);
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
...@@ -998,8 +998,6 @@ static int garmin_write_bulk(struct usb_serial_port *port, ...@@ -998,8 +998,6 @@ static int garmin_write_bulk(struct usb_serial_port *port,
return -ENOMEM; return -ENOMEM;
} }
memcpy(buffer, buf, count);
usb_serial_debug_data(&port->dev, __func__, count, buffer); usb_serial_debug_data(&port->dev, __func__, count, buffer);
usb_fill_bulk_urb(urb, serial->dev, usb_fill_bulk_urb(urb, serial->dev,
......
...@@ -220,7 +220,7 @@ struct edgeport_serial { ...@@ -220,7 +220,7 @@ struct edgeport_serial {
__u8 rxHeader3; /* receive header byte 3 */ __u8 rxHeader3; /* receive header byte 3 */
__u8 rxPort; /* the port that we are currently receiving data for */ __u8 rxPort; /* the port that we are currently receiving data for */
__u8 rxStatusCode; /* the receive status code */ __u8 rxStatusCode; /* the receive status code */
__u8 rxStatusParam; /* the receive status paramater */ __u8 rxStatusParam; /* the receive status parameter */
__s16 rxBytesRemaining; /* the number of port bytes left to read */ __s16 rxBytesRemaining; /* the number of port bytes left to read */
struct usb_serial *serial; /* loop back to the owner of this object */ struct usb_serial *serial; /* loop back to the owner of this object */
}; };
...@@ -901,7 +901,7 @@ static int edge_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -901,7 +901,7 @@ static int edge_open(struct tty_struct *tty, struct usb_serial_port *port)
if (!edge_port->open) { if (!edge_port->open) {
/* open timed out */ /* open timed out */
dev_dbg(dev, "%s - open timedout\n", __func__); dev_dbg(dev, "%s - open timeout\n", __func__);
edge_port->openPending = false; edge_port->openPending = false;
return -ENODEV; return -ENODEV;
} }
......
...@@ -826,7 +826,7 @@ static int mos77xx_calc_num_ports(struct usb_serial *serial, ...@@ -826,7 +826,7 @@ static int mos77xx_calc_num_ports(struct usb_serial *serial,
/* /*
* The 7715 uses the first bulk in/out endpoint pair for the * The 7715 uses the first bulk in/out endpoint pair for the
* parallel port, and the second for the serial port. We swap * parallel port, and the second for the serial port. We swap
* the endpoint descriptors here so that the the first and * the endpoint descriptors here so that the first and
* only registered port structure uses the serial-port * only registered port structure uses the serial-port
* endpoints. * endpoints.
*/ */
......
...@@ -208,7 +208,7 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port, ...@@ -208,7 +208,7 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port,
priv->outstanding_bytes += count; priv->outstanding_bytes += count;
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
buffer = kmalloc(count, GFP_ATOMIC); buffer = kmemdup(buf, count, GFP_ATOMIC);
if (!buffer) if (!buffer)
goto error_no_buffer; goto error_no_buffer;
...@@ -216,8 +216,6 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port, ...@@ -216,8 +216,6 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port,
if (!urb) if (!urb)
goto error_no_urb; goto error_no_urb;
memcpy(buffer, buf, count);
usb_serial_debug_data(&port->dev, __func__, count, buffer); usb_serial_debug_data(&port->dev, __func__, count, buffer);
/* The connected devices do not have a bulk write endpoint, /* The connected devices do not have a bulk write endpoint,
......
...@@ -453,7 +453,7 @@ static int sierra_write(struct tty_struct *tty, struct usb_serial_port *port, ...@@ -453,7 +453,7 @@ static int sierra_write(struct tty_struct *tty, struct usb_serial_port *port,
goto error_simple; goto error_simple;
} }
buffer = kmalloc(writesize, GFP_ATOMIC); buffer = kmemdup(buf, writesize, GFP_ATOMIC);
if (!buffer) { if (!buffer) {
retval = -ENOMEM; retval = -ENOMEM;
goto error_no_buffer; goto error_no_buffer;
...@@ -465,8 +465,6 @@ static int sierra_write(struct tty_struct *tty, struct usb_serial_port *port, ...@@ -465,8 +465,6 @@ static int sierra_write(struct tty_struct *tty, struct usb_serial_port *port,
goto error_no_urb; goto error_no_urb;
} }
memcpy(buffer, buf, writesize);
usb_serial_debug_data(&port->dev, __func__, writesize, buffer); usb_serial_debug_data(&port->dev, __func__, writesize, buffer);
usb_fill_bulk_urb(urb, serial->dev, usb_fill_bulk_urb(urb, serial->dev,
...@@ -737,7 +735,8 @@ static void sierra_close(struct usb_serial_port *port) ...@@ -737,7 +735,8 @@ static void sierra_close(struct usb_serial_port *port)
/* /*
* Need to take susp_lock to make sure port is not already being * Need to take susp_lock to make sure port is not already being
* resumed, but no need to hold it due to initialized * resumed, but no need to hold it due to the tty-port initialized
* flag.
*/ */
spin_lock_irq(&intfdata->susp_lock); spin_lock_irq(&intfdata->susp_lock);
if (--intfdata->open_ports == 0) if (--intfdata->open_ports == 0)
......
...@@ -295,7 +295,7 @@ static int serial_open(struct tty_struct *tty, struct file *filp) ...@@ -295,7 +295,7 @@ static int serial_open(struct tty_struct *tty, struct file *filp)
* *
* Shut down a USB serial port. Serialized against activate by the * Shut down a USB serial port. Serialized against activate by the
* tport mutex and kept to matching open/close pairs * tport mutex and kept to matching open/close pairs
* of calls by the initialized flag. * of calls by the tty-port initialized flag.
* *
* Not called if tty is console. * Not called if tty is console.
*/ */
......
...@@ -390,7 +390,8 @@ void usb_wwan_close(struct usb_serial_port *port) ...@@ -390,7 +390,8 @@ void usb_wwan_close(struct usb_serial_port *port)
/* /*
* Need to take susp_lock to make sure port is not already being * Need to take susp_lock to make sure port is not already being
* resumed, but no need to hold it due to initialized * resumed, but no need to hold it due to the tty-port initialized
* flag.
*/ */
spin_lock_irq(&intfdata->susp_lock); spin_lock_irq(&intfdata->susp_lock);
if (--intfdata->open_ports == 0) if (--intfdata->open_ports == 0)
......
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