aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/adutux.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-10-25 06:23:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-25 06:23:15 -0400
commit1be025d3cb40cd295123af2c394f7229ef9b30ca (patch)
tree5dc14e1ea412cc7fdc3e563ad23187059fe8bfb5 /drivers/usb/misc/adutux.c
parent2d03423b2319cc854adeb28a03f65de5b5e0ab63 (diff)
parenta2c76b83fdd763c826f38a55127ccf25708099ce (diff)
Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
* 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (260 commits) usb: renesas_usbhs: fixup inconsistent return from usbhs_pkt_push() usb/isp1760: Allow to optionally trigger low-level chip reset via GPIOLIB. USB: gadget: midi: memory leak in f_midi_bind_config() USB: gadget: midi: fix range check in f_midi_out_open() QE/FHCI: fixed the CONTROL bug usb: renesas_usbhs: tidyup for smatch warnings USB: Fix USB Kconfig dependency problem on 85xx/QoirQ platforms EHCI: workaround for MosChip controller bug usb: gadget: file_storage: fix race on unloading USB: ftdi_sio.c: Use ftdi async_icount structure for TIOCMIWAIT, as in other drivers USB: ftdi_sio.c:Fill MSR fields of the ftdi async_icount structure USB: ftdi_sio.c: Fill LSR fields of the ftdi async_icount structure USB: ftdi_sio.c:Fill TX field of the ftdi async_icount structure USB: ftdi_sio.c: Fill the RX field of the ftdi async_icount structure USB: ftdi_sio.c: Basic icount infrastructure for ftdi_sio usb/isp1760: Let OF bindings depend on general CONFIG_OF instead of PPC_OF . USB: ftdi_sio: Support TI/Luminary Micro Stellaris BD-ICDI Board USB: Fix runtime wakeup on OHCI xHCI/USB: Make xHCI driver have a BOS descriptor. usb: gadget: add new usb gadget for ACM and mass storage ...
Diffstat (limited to 'drivers/usb/misc/adutux.c')
-rw-r--r--drivers/usb/misc/adutux.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c
index a6afd15f6a46..fe858711651c 100644
--- a/drivers/usb/misc/adutux.c
+++ b/drivers/usb/misc/adutux.c
@@ -213,7 +213,7 @@ static void adu_interrupt_in_callback(struct urb *urb)
213 213
214 if (urb->actual_length > 0 && dev->interrupt_in_buffer[0] != 0x00) { 214 if (urb->actual_length > 0 && dev->interrupt_in_buffer[0] != 0x00) {
215 if (dev->read_buffer_length < 215 if (dev->read_buffer_length <
216 (4 * le16_to_cpu(dev->interrupt_in_endpoint->wMaxPacketSize)) - 216 (4 * usb_endpoint_maxp(dev->interrupt_in_endpoint)) -
217 (urb->actual_length)) { 217 (urb->actual_length)) {
218 memcpy (dev->read_buffer_primary + 218 memcpy (dev->read_buffer_primary +
219 dev->read_buffer_length, 219 dev->read_buffer_length,
@@ -315,7 +315,7 @@ static int adu_open(struct inode *inode, struct file *file)
315 usb_rcvintpipe(dev->udev, 315 usb_rcvintpipe(dev->udev,
316 dev->interrupt_in_endpoint->bEndpointAddress), 316 dev->interrupt_in_endpoint->bEndpointAddress),
317 dev->interrupt_in_buffer, 317 dev->interrupt_in_buffer,
318 le16_to_cpu(dev->interrupt_in_endpoint->wMaxPacketSize), 318 usb_endpoint_maxp(dev->interrupt_in_endpoint),
319 adu_interrupt_in_callback, dev, 319 adu_interrupt_in_callback, dev,
320 dev->interrupt_in_endpoint->bInterval); 320 dev->interrupt_in_endpoint->bInterval);
321 dev->read_urb_finished = 0; 321 dev->read_urb_finished = 0;
@@ -483,7 +483,7 @@ static ssize_t adu_read(struct file *file, __user char *buffer, size_t count,
483 usb_rcvintpipe(dev->udev, 483 usb_rcvintpipe(dev->udev,
484 dev->interrupt_in_endpoint->bEndpointAddress), 484 dev->interrupt_in_endpoint->bEndpointAddress),
485 dev->interrupt_in_buffer, 485 dev->interrupt_in_buffer,
486 le16_to_cpu(dev->interrupt_in_endpoint->wMaxPacketSize), 486 usb_endpoint_maxp(dev->interrupt_in_endpoint),
487 adu_interrupt_in_callback, 487 adu_interrupt_in_callback,
488 dev, 488 dev,
489 dev->interrupt_in_endpoint->bInterval); 489 dev->interrupt_in_endpoint->bInterval);
@@ -536,7 +536,7 @@ static ssize_t adu_read(struct file *file, __user char *buffer, size_t count,
536 usb_rcvintpipe(dev->udev, 536 usb_rcvintpipe(dev->udev,
537 dev->interrupt_in_endpoint->bEndpointAddress), 537 dev->interrupt_in_endpoint->bEndpointAddress),
538 dev->interrupt_in_buffer, 538 dev->interrupt_in_buffer,
539 le16_to_cpu(dev->interrupt_in_endpoint->wMaxPacketSize), 539 usb_endpoint_maxp(dev->interrupt_in_endpoint),
540 adu_interrupt_in_callback, 540 adu_interrupt_in_callback,
541 dev, 541 dev,
542 dev->interrupt_in_endpoint->bInterval); 542 dev->interrupt_in_endpoint->bInterval);
@@ -622,7 +622,7 @@ static ssize_t adu_write(struct file *file, const __user char *buffer,
622 dbg(4," %s : sending, count = %Zd", __func__, count); 622 dbg(4," %s : sending, count = %Zd", __func__, count);
623 623
624 /* write the data into interrupt_out_buffer from userspace */ 624 /* write the data into interrupt_out_buffer from userspace */
625 buffer_size = le16_to_cpu(dev->interrupt_out_endpoint->wMaxPacketSize); 625 buffer_size = usb_endpoint_maxp(dev->interrupt_out_endpoint);
626 bytes_to_write = count > buffer_size ? buffer_size : count; 626 bytes_to_write = count > buffer_size ? buffer_size : count;
627 dbg(4," %s : buffer_size = %Zd, count = %Zd, bytes_to_write = %Zd", 627 dbg(4," %s : buffer_size = %Zd, count = %Zd, bytes_to_write = %Zd",
628 __func__, buffer_size, count, bytes_to_write); 628 __func__, buffer_size, count, bytes_to_write);
@@ -752,8 +752,8 @@ static int adu_probe(struct usb_interface *interface,
752 goto error; 752 goto error;
753 } 753 }
754 754
755 in_end_size = le16_to_cpu(dev->interrupt_in_endpoint->wMaxPacketSize); 755 in_end_size = usb_endpoint_maxp(dev->interrupt_in_endpoint);
756 out_end_size = le16_to_cpu(dev->interrupt_out_endpoint->wMaxPacketSize); 756 out_end_size = usb_endpoint_maxp(dev->interrupt_out_endpoint);
757 757
758 dev->read_buffer_primary = kmalloc((4 * in_end_size), GFP_KERNEL); 758 dev->read_buffer_primary = kmalloc((4 * in_end_size), GFP_KERNEL);
759 if (!dev->read_buffer_primary) { 759 if (!dev->read_buffer_primary) {