Skip to content

Commit 71da2ba

Browse files
committed
Merge tag 'usb-serial-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-testing
Johan writes: USB-serial updates for v4.8-rc1 Mostly clean ups, including the first few patches of a major overhaul of the ti_usb_3410_5052 driver. Included is also a new option-driver device id. Signed-off-by: Johan Hovold <johan@kernel.org>
2 parents e658052 + 3161da9 commit 71da2ba

File tree

5 files changed

+260
-295
lines changed

5 files changed

+260
-295
lines changed

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)