From a69428fcb62f02e041e632dd54a04c40b2749913 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 16 Jul 2004 16:59:11 +0200 Subject: [PATCH] [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: Alan Stern Signed-off-by: Marcel Holtmann --- drivers/bluetooth/hci_usb.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c index 4070d744e654c..e12d4c85eae44 100644 --- a/drivers/bluetooth/hci_usb.c +++ b/drivers/bluetooth/hci_usb.c @@ -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); } -- 2.53.0