Skip to content

Commit

Permalink
Bluetooth: btusb: also be quiet when suspending
Browse files Browse the repository at this point in the history
usb_submit_urb() returns -ENODEV when a usb device is disconnected. In
commit 4935f1c ("Bluetooth: btusb: be
quiet on device disconnect") I stopped treating that return as an error
in the three btusb_*_complete() functions.

It turns out btusb_send_frame() generates a similar error if the system
is suspended while the bluetooth usb device is enabled. The sensible
thing to do here seems to be to treat -ENODEV (and -EPERM) just like the
btusb_*_complete() functions now do.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
  • Loading branch information
Paul Bolle authored and Gustavo F. Padovan committed Oct 10, 2011
1 parent 3e90dc8 commit 5a9b80e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,9 @@ static int btusb_send_frame(struct sk_buff *skb)

err = usb_submit_urb(urb, GFP_ATOMIC);
if (err < 0) {
BT_ERR("%s urb %p submission failed", hdev->name, urb);
if (err != -EPERM && err != -ENODEV)
BT_ERR("%s urb %p submission failed (%d)",
hdev->name, urb, -err);
kfree(urb->setup_packet);
usb_unanchor_urb(urb);
} else {
Expand Down

0 comments on commit 5a9b80e

Please sign in to comment.