Bluetooth: ath3k: no need to set same pipe multiple times
authorAdam Lee <adam8157@gmail.com>
Tue, 27 May 2014 05:49:07 +0000 (13:49 +0800)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Tue, 27 May 2014 13:14:45 +0000 (10:14 -0300)
Invoking usb_sndbulkpipe() on same pipe for same purpose only once is
enough.

Signed-off-by: Adam Lee <adam8157@gmail.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
drivers/bluetooth/ath3k.c

index be571fef185da6a597fcdac3d15093ed8e47fb5b..4aef96b0eb637f8136a2262c0a56c8001a7ea106 100644 (file)
@@ -191,9 +191,10 @@ static int ath3k_load_firmware(struct usb_device *udev,
        sent += 20;
        count -= 20;
 
+       pipe = usb_sndbulkpipe(udev, 0x02);
+
        while (count) {
                size = min_t(uint, count, BULK_SIZE);
-               pipe = usb_sndbulkpipe(udev, 0x02);
                memcpy(send_buf, firmware->data + sent, size);
 
                err = usb_bulk_msg(udev, pipe, send_buf, size,