]> git.neil.brown.name Git - history.git/commitdiff
[Bluetooth] Make use of usb_kill_urb()
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 16 Jul 2004 14:59:11 +0000 (16:59 +0200)
committerMarcel Holtmann <holtmann@holtmann.org>
Fri, 16 Jul 2004 14:59:11 +0000 (16:59 +0200)
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: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/hci_usb.c

index 4070d744e654c63f64305619e74cb66a2eb4983d..e12d4c85eae4401a456222094071ce6953bf89d7 100644 (file)
@@ -339,26 +339,18 @@ static int hci_usb_flush(struct hci_dev *hdev)
 
        BT_DBG("%s", hdev->name);
 
-       for (i=0; i < 4; i++)
+       for (i = 0; i < 4; i++)
                skb_queue_purge(&husb->transmit_q[i]);
        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)
 {
        int i;
 
        BT_DBG("%s", husb->hdev->name);
 
-       for (i=0; i < 4; i++) {
+       for (i = 0; i < 4; i++) {
                struct _urb *_urb;
                struct urb *urb;
 
@@ -367,8 +359,7 @@ static void hci_usb_unlink_urbs(struct hci_usb *husb)
                        urb = &_urb->urb;
                        BT_DBG("%s unlinking _urb %p type %d urb %p", 
                                        husb->hdev->name, _urb, _urb->type, urb);
-                       usb_unlink_urb(urb);
-                       hci_usb_wait_for_urb(urb);
+                       usb_kill_urb(urb);
                        _urb_queue_tail(__completed_q(husb, _urb->type), _urb);
                }