Commit a69428fc authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Marcel Holtmann

[Bluetooth] Make use of usb_kill_urb()

Now that usb_kill_urb() is in the main kernel tree it should
be used. This patch makes the needed modifications to the USB
Bluetooth driver.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent c96ea67e
...@@ -339,26 +339,18 @@ static int hci_usb_flush(struct hci_dev *hdev) ...@@ -339,26 +339,18 @@ static int hci_usb_flush(struct hci_dev *hdev)
BT_DBG("%s", hdev->name); BT_DBG("%s", hdev->name);
for (i=0; i < 4; i++) for (i = 0; i < 4; i++)
skb_queue_purge(&husb->transmit_q[i]); skb_queue_purge(&husb->transmit_q[i]);
return 0; return 0;
} }
static inline void hci_usb_wait_for_urb(struct urb *urb)
{
while (atomic_read(&urb->kref.refcount) > 1) {
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout((5 * HZ + 999) / 1000);
}
}
static void hci_usb_unlink_urbs(struct hci_usb *husb) static void hci_usb_unlink_urbs(struct hci_usb *husb)
{ {
int i; int i;
BT_DBG("%s", husb->hdev->name); BT_DBG("%s", husb->hdev->name);
for (i=0; i < 4; i++) { for (i = 0; i < 4; i++) {
struct _urb *_urb; struct _urb *_urb;
struct urb *urb; struct urb *urb;
...@@ -367,8 +359,7 @@ static void hci_usb_unlink_urbs(struct hci_usb *husb) ...@@ -367,8 +359,7 @@ static void hci_usb_unlink_urbs(struct hci_usb *husb)
urb = &_urb->urb; urb = &_urb->urb;
BT_DBG("%s unlinking _urb %p type %d urb %p", BT_DBG("%s unlinking _urb %p type %d urb %p",
husb->hdev->name, _urb, _urb->type, urb); husb->hdev->name, _urb, _urb->type, urb);
usb_unlink_urb(urb); usb_kill_urb(urb);
hci_usb_wait_for_urb(urb);
_urb_queue_tail(__completed_q(husb, _urb->type), _urb); _urb_queue_tail(__completed_q(husb, _urb->type), _urb);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment