From: Adam Lee Date: Thu, 5 Jun 2014 13:47:44 +0000 (+0800) Subject: Bluetooth: ath3k: reduce pipe setting times in ath3k_load_fwfile() X-Git-Tag: v3.17-rc1~106^2~73^2~87^2~199 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b0c3e138b467a5cc3b2eb44c6525227f66d1496d;p=karo-tx-linux.git Bluetooth: ath3k: reduce pipe setting times in ath3k_load_fwfile() Invoking usb_sndbulkpipe() on same pipe for same purpose only once is enough. Signed-off-by: Adam Lee Signed-off-by: Gustavo Padovan --- diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index f50dffc0374f..abe6aecbabb2 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c @@ -288,10 +288,10 @@ static int ath3k_load_fwfile(struct usb_device *udev, sent += size; count -= size; + 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,