Skip to content

Commit

Permalink
Merge tag 'usb-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/gregkh/usb

Pull more USB updates from Greg KH:
 "Here are a few more straggler patches for USB for 4.8-rc1.

  Most of these are for the usb-serial driver tree.  All of those have
  been in linux-next for a long time, but missed my previous pull
  request to you.

  The remaining change is to fix up a staging tree build error, due to
  some USB gadget driver changes that went in.  I put it in this tree as
  it was for a USB driver and people are reporting the build error on
  your tree.

  All of these have been in linux-next for this week, and longer for the
  usb-serial changes"

* tag 'usb-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  staging: emxx_udc: allow modular build
  USB: serial: use variable for status
  USB: serial: option: add support for Telit LE910 PID 0x1206
  USB: serial: cp210x: use kmemdup
  USB: serial: ti_usb_3410_5052: use functions rather than macros
  USB: serial: ti_usb_3410_5052: remove ti_usb_3410_5052.h
  USB: serial: ti_usb_3410_5052: use __packed
  USB: serial: ti_usb_3410_5052: remove useless comments
  • Loading branch information
torvalds committed Aug 6, 2016
2 parents 6c84239 + 0bf048a commit f72035f
Show file tree
Hide file tree
Showing 7 changed files with 293 additions and 300 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/emxx_udc/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
config USB_EMXX
bool "EMXX USB Function Device Controller"
tristate "EMXX USB Function Device Controller"
depends on USB_GADGET && (ARCH_SHMOBILE || (ARM && COMPILE_TEST))
help
The Emma Mobile series of SoCs from Renesas Electronics and
Expand Down
36 changes: 32 additions & 4 deletions drivers/staging/emxx_udc/emxx_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/ioport.h>
Expand All @@ -39,9 +39,11 @@

#include "emxx_udc.h"

#define DRIVER_DESC "EMXX UDC driver"
#define DMA_ADDR_INVALID (~(dma_addr_t)0)

static const char driver_name[] = "emxx_udc";
static const char driver_desc[] = DRIVER_DESC;

/*===========================================================================*/
/* Prototype */
Expand Down Expand Up @@ -3295,6 +3297,28 @@ static void nbu2ss_drv_shutdown(struct platform_device *pdev)
_nbu2ss_disable_controller(udc);
}

/*-------------------------------------------------------------------------*/
static int nbu2ss_drv_remove(struct platform_device *pdev)
{
struct nbu2ss_udc *udc;
struct nbu2ss_ep *ep;
int i;

udc = &udc_controller;

for (i = 0; i < NUM_ENDPOINTS; i++) {
ep = &udc->ep[i];
if (ep->virt_buf)
dma_free_coherent(NULL, PAGE_SIZE,
(void *)ep->virt_buf, ep->phys_buf);
}

/* Interrupt Handler - Release */
free_irq(INT_VBUS, udc);

return 0;
}

/*-------------------------------------------------------------------------*/
static int nbu2ss_drv_suspend(struct platform_device *pdev, pm_message_t state)
{
Expand Down Expand Up @@ -3347,12 +3371,16 @@ static int nbu2ss_drv_resume(struct platform_device *pdev)
static struct platform_driver udc_driver = {
.probe = nbu2ss_drv_probe,
.shutdown = nbu2ss_drv_shutdown,
.remove = nbu2ss_drv_remove,
.suspend = nbu2ss_drv_suspend,
.resume = nbu2ss_drv_resume,
.driver = {
.name = driver_name,
.suppress_bind_attrs = true,
.name = driver_name,
},
};

builtin_platform_driver(udc_driver);
module_platform_driver(udc_driver);

MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_AUTHOR("Renesas Electronics Corporation");
MODULE_LICENSE("GPL");
4 changes: 1 addition & 3 deletions drivers/usb/serial/cp210x.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,12 +496,10 @@ static int cp210x_write_reg_block(struct usb_serial_port *port, u8 req,
void *dmabuf;
int result;

dmabuf = kmalloc(bufsize, GFP_KERNEL);
dmabuf = kmemdup(buf, bufsize, GFP_KERNEL);
if (!dmabuf)
return -ENOMEM;

memcpy(dmabuf, buf, bufsize);

result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
req, REQTYPE_HOST_TO_INTERFACE, 0,
port_priv->bInterfaceNumber, dmabuf, bufsize,
Expand Down
18 changes: 10 additions & 8 deletions drivers/usb/serial/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb)
struct usb_serial_port *port = urb->context;
unsigned char *data = urb->transfer_buffer;
unsigned long flags;
int status = urb->status;
int i;

for (i = 0; i < ARRAY_SIZE(port->read_urbs); ++i) {
Expand All @@ -360,22 +361,22 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb)

dev_dbg(&port->dev, "%s - urb %d, len %d\n", __func__, i,
urb->actual_length);
switch (urb->status) {
switch (status) {
case 0:
break;
case -ENOENT:
case -ECONNRESET:
case -ESHUTDOWN:
dev_dbg(&port->dev, "%s - urb stopped: %d\n",
__func__, urb->status);
__func__, status);
return;
case -EPIPE:
dev_err(&port->dev, "%s - urb stopped: %d\n",
__func__, urb->status);
__func__, status);
return;
default:
dev_dbg(&port->dev, "%s - nonzero urb status: %d\n",
__func__, urb->status);
__func__, status);
goto resubmit;
}

Expand All @@ -399,6 +400,7 @@ void usb_serial_generic_write_bulk_callback(struct urb *urb)
{
unsigned long flags;
struct usb_serial_port *port = urb->context;
int status = urb->status;
int i;

for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i) {
Expand All @@ -410,22 +412,22 @@ void usb_serial_generic_write_bulk_callback(struct urb *urb)
set_bit(i, &port->write_urbs_free);
spin_unlock_irqrestore(&port->lock, flags);

switch (urb->status) {
switch (status) {
case 0:
break;
case -ENOENT:
case -ECONNRESET:
case -ESHUTDOWN:
dev_dbg(&port->dev, "%s - urb stopped: %d\n",
__func__, urb->status);
__func__, status);
return;
case -EPIPE:
dev_err_console(port, "%s - urb stopped: %d\n",
__func__, urb->status);
__func__, status);
return;
default:
dev_err_console(port, "%s - nonzero urb status: %d\n",
__func__, urb->status);
__func__, status);
goto resubmit;
}

Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/serial/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ static void option_instat_callback(struct urb *urb);
#define TELIT_PRODUCT_LE922_USBCFG5 0x1045
#define TELIT_PRODUCT_LE920 0x1200
#define TELIT_PRODUCT_LE910 0x1201
#define TELIT_PRODUCT_LE910_USBCFG4 0x1206

/* ZTE PRODUCTS */
#define ZTE_VENDOR_ID 0x19d2
Expand Down Expand Up @@ -1198,6 +1199,8 @@ static const struct usb_device_id option_ids[] = {
.driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910),
.driver_info = (kernel_ulong_t)&telit_le910_blacklist },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
.driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920),
.driver_info = (kernel_ulong_t)&telit_le920_blacklist },
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */
Expand Down
Loading

0 comments on commit f72035f

Please sign in to comment.