Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277717
b: refs/heads/master
c: 844e4b7
h: refs/heads/master
i:
  277715: 4214dec
v: v3
  • Loading branch information
David Herrmann authored and Gustavo F. Padovan committed Nov 7, 2011
1 parent 1e3146c commit 8889df2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 52a1020e80beece986002f673eca24dae6255b55
refs/heads/master: 844e4b76cc4806827024cccf35a9beaf13d27f3d
10 changes: 10 additions & 0 deletions trunk/drivers/bluetooth/bcm203x.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <linux/module.h>

#include <linux/atomic.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -65,6 +66,7 @@ struct bcm203x_data {
unsigned long state;

struct work_struct work;
atomic_t shutdown;

struct urb *urb;
unsigned char *buffer;
Expand Down Expand Up @@ -97,6 +99,7 @@ static void bcm203x_complete(struct urb *urb)

data->state = BCM203X_SELECT_MEMORY;

/* use workqueue to have a small delay */
schedule_work(&data->work);
break;

Expand Down Expand Up @@ -155,6 +158,9 @@ static void bcm203x_work(struct work_struct *work)
struct bcm203x_data *data =
container_of(work, struct bcm203x_data, work);

if (atomic_read(&data->shutdown))
return;

if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0)
BT_ERR("Can't submit URB");
}
Expand Down Expand Up @@ -243,6 +249,7 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id

usb_set_intfdata(intf, data);

/* use workqueue to have a small delay */
schedule_work(&data->work);

return 0;
Expand All @@ -254,6 +261,9 @@ static void bcm203x_disconnect(struct usb_interface *intf)

BT_DBG("intf %p", intf);

atomic_inc(&data->shutdown);
cancel_work_sync(&data->work);

usb_kill_urb(data->urb);

usb_set_intfdata(intf, NULL);
Expand Down

0 comments on commit 8889df2

Please sign in to comment.