diff options
Diffstat (limited to 'drivers/usb/class')
-rw-r--r-- | drivers/usb/class/usbtmc.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 65965587c812..619cc9975209 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c | |||
@@ -562,10 +562,16 @@ static ssize_t usbtmc_write(struct file *filp, const char __user *buf, | |||
562 | n_bytes = roundup(12 + this_part, 4); | 562 | n_bytes = roundup(12 + this_part, 4); |
563 | memset(buffer + 12 + this_part, 0, n_bytes - (12 + this_part)); | 563 | memset(buffer + 12 + this_part, 0, n_bytes - (12 + this_part)); |
564 | 564 | ||
565 | retval = usb_bulk_msg(data->usb_dev, | 565 | do { |
566 | usb_sndbulkpipe(data->usb_dev, | 566 | retval = usb_bulk_msg(data->usb_dev, |
567 | data->bulk_out), | 567 | usb_sndbulkpipe(data->usb_dev, |
568 | buffer, n_bytes, &actual, USBTMC_TIMEOUT); | 568 | data->bulk_out), |
569 | buffer, n_bytes, | ||
570 | &actual, USBTMC_TIMEOUT); | ||
571 | if (retval != 0) | ||
572 | break; | ||
573 | n_bytes -= actual; | ||
574 | } while (n_bytes); | ||
569 | 575 | ||
570 | data->bTag_last_write = data->bTag; | 576 | data->bTag_last_write = data->bTag; |
571 | data->bTag++; | 577 | data->bTag++; |