Skip to content

Commit f72035f

Browse files
committed
Merge tag 'usb-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/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
2 parents 6c84239 + 0bf048a commit f72035f

File tree

7 files changed

+293
-300
lines changed

7 files changed

+293
-300
lines changed

drivers/staging/emxx_udc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
config USB_EMXX
2-
bool "EMXX USB Function Device Controller"
2+
tristate "EMXX USB Function Device Controller"
33
depends on USB_GADGET && (ARCH_SHMOBILE || (ARM && COMPILE_TEST))
44
help
55
The Emma Mobile series of SoCs from Renesas Electronics and

drivers/staging/emxx_udc/emxx_udc.c

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#include <linux/kernel.h>
18-
#include <linux/init.h>
18+
#include <linux/module.h>
1919
#include <linux/platform_device.h>
2020
#include <linux/delay.h>
2121
#include <linux/ioport.h>
@@ -39,9 +39,11 @@
3939

4040
#include "emxx_udc.h"
4141

42+
#define DRIVER_DESC "EMXX UDC driver"
4243
#define DMA_ADDR_INVALID (~(dma_addr_t)0)
4344

4445
static const char driver_name[] = "emxx_udc";
46+
static const char driver_desc[] = DRIVER_DESC;
4547

4648
/*===========================================================================*/
4749
/* Prototype */
@@ -3295,6 +3297,28 @@ static void nbu2ss_drv_shutdown(struct platform_device *pdev)
32953297
_nbu2ss_disable_controller(udc);
32963298
}
32973299

3300+
/*-------------------------------------------------------------------------*/
3301+
static int nbu2ss_drv_remove(struct platform_device *pdev)
3302+
{
3303+
struct nbu2ss_udc *udc;
3304+
struct nbu2ss_ep *ep;
3305+
int i;
3306+
3307+
udc = &udc_controller;
3308+
3309+
for (i = 0; i < NUM_ENDPOINTS; i++) {
3310+
ep = &udc->ep[i];
3311+
if (ep->virt_buf)
3312+
dma_free_coherent(NULL, PAGE_SIZE,
3313+
(void *)ep->virt_buf, ep->phys_buf);
3314+
}
3315+
3316+
/* Interrupt Handler - Release */
3317+
free_irq(INT_VBUS, udc);
3318+
3319+
return 0;
3320+
}
3321+
32983322
/*-------------------------------------------------------------------------*/
32993323
static int nbu2ss_drv_suspend(struct platform_device *pdev, pm_message_t state)
33003324
{
@@ -3347,12 +3371,16 @@ static int nbu2ss_drv_resume(struct platform_device *pdev)
33473371
static struct platform_driver udc_driver = {
33483372
.probe = nbu2ss_drv_probe,
33493373
.shutdown = nbu2ss_drv_shutdown,
3374+
.remove = nbu2ss_drv_remove,
33503375
.suspend = nbu2ss_drv_suspend,
33513376
.resume = nbu2ss_drv_resume,
33523377
.driver = {
3353-
.name = driver_name,
3354-
.suppress_bind_attrs = true,
3378+
.name = driver_name,
33553379
},
33563380
};
33573381

3358-
builtin_platform_driver(udc_driver);
3382+
module_platform_driver(udc_driver);
3383+
3384+
MODULE_DESCRIPTION(DRIVER_DESC);
3385+
MODULE_AUTHOR("Renesas Electronics Corporation");
3386+
MODULE_LICENSE("GPL");

drivers/usb/serial/cp210x.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,10 @@ static int cp210x_write_reg_block(struct usb_serial_port *port, u8 req,
496496
void *dmabuf;
497497
int result;
498498

499-
dmabuf = kmalloc(bufsize, GFP_KERNEL);
499+
dmabuf = kmemdup(buf, bufsize, GFP_KERNEL);
500500
if (!dmabuf)
501501
return -ENOMEM;
502502

503-
memcpy(dmabuf, buf, bufsize);
504-
505503
result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
506504
req, REQTYPE_HOST_TO_INTERFACE, 0,
507505
port_priv->bInterfaceNumber, dmabuf, bufsize,

drivers/usb/serial/generic.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb)
350350
struct usb_serial_port *port = urb->context;
351351
unsigned char *data = urb->transfer_buffer;
352352
unsigned long flags;
353+
int status = urb->status;
353354
int i;
354355

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

361362
dev_dbg(&port->dev, "%s - urb %d, len %d\n", __func__, i,
362363
urb->actual_length);
363-
switch (urb->status) {
364+
switch (status) {
364365
case 0:
365366
break;
366367
case -ENOENT:
367368
case -ECONNRESET:
368369
case -ESHUTDOWN:
369370
dev_dbg(&port->dev, "%s - urb stopped: %d\n",
370-
__func__, urb->status);
371+
__func__, status);
371372
return;
372373
case -EPIPE:
373374
dev_err(&port->dev, "%s - urb stopped: %d\n",
374-
__func__, urb->status);
375+
__func__, status);
375376
return;
376377
default:
377378
dev_dbg(&port->dev, "%s - nonzero urb status: %d\n",
378-
__func__, urb->status);
379+
__func__, status);
379380
goto resubmit;
380381
}
381382

@@ -399,6 +400,7 @@ void usb_serial_generic_write_bulk_callback(struct urb *urb)
399400
{
400401
unsigned long flags;
401402
struct usb_serial_port *port = urb->context;
403+
int status = urb->status;
402404
int i;
403405

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

413-
switch (urb->status) {
415+
switch (status) {
414416
case 0:
415417
break;
416418
case -ENOENT:
417419
case -ECONNRESET:
418420
case -ESHUTDOWN:
419421
dev_dbg(&port->dev, "%s - urb stopped: %d\n",
420-
__func__, urb->status);
422+
__func__, status);
421423
return;
422424
case -EPIPE:
423425
dev_err_console(port, "%s - urb stopped: %d\n",
424-
__func__, urb->status);
426+
__func__, status);
425427
return;
426428
default:
427429
dev_err_console(port, "%s - nonzero urb status: %d\n",
428-
__func__, urb->status);
430+
__func__, status);
429431
goto resubmit;
430432
}
431433

drivers/usb/serial/option.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ static void option_instat_callback(struct urb *urb);
273273
#define TELIT_PRODUCT_LE922_USBCFG5 0x1045
274274
#define TELIT_PRODUCT_LE920 0x1200
275275
#define TELIT_PRODUCT_LE910 0x1201
276+
#define TELIT_PRODUCT_LE910_USBCFG4 0x1206
276277

277278
/* ZTE PRODUCTS */
278279
#define ZTE_VENDOR_ID 0x19d2
@@ -1198,6 +1199,8 @@ static const struct usb_device_id option_ids[] = {
11981199
.driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 },
11991200
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910),
12001201
.driver_info = (kernel_ulong_t)&telit_le910_blacklist },
1202+
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
1203+
.driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 },
12011204
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920),
12021205
.driver_info = (kernel_ulong_t)&telit_le920_blacklist },
12031206
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */

0 commit comments

Comments
 (0)