aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-10-15 11:31:19 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-10-16 02:14:35 -0400
commit3f5306927d800306ebba542438cfdf1a1c418376 (patch)
treebf63518ddbb9c9c07c7d4703017baa4bb56384f1 /drivers/bluetooth
parent74da626a1098640ddc40c0e3481c0cd41e8ec1e9 (diff)
[Bluetooth] Use work queue to trigger URB submission
The bcm203x firmware loading driver uses a timer to trigger the URB submission. It is better to use a work queue instead. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/bcm203x.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c
index 67cdda43f229..516751754aa9 100644
--- a/drivers/bluetooth/bcm203x.c
+++ b/drivers/bluetooth/bcm203x.c
@@ -29,7 +29,6 @@
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/types.h> 30#include <linux/types.h>
31#include <linux/errno.h> 31#include <linux/errno.h>
32#include <linux/timer.h>
33 32
34#include <linux/device.h> 33#include <linux/device.h>
35#include <linux/firmware.h> 34#include <linux/firmware.h>
@@ -43,7 +42,7 @@
43#define BT_DBG(D...) 42#define BT_DBG(D...)
44#endif 43#endif
45 44
46#define VERSION "1.0" 45#define VERSION "1.1"
47 46
48static int ignore = 0; 47static int ignore = 0;
49 48
@@ -72,7 +71,7 @@ struct bcm203x_data {
72 71
73 unsigned long state; 72 unsigned long state;
74 73
75 struct timer_list timer; 74 struct work_struct work;
76 75
77 struct urb *urb; 76 struct urb *urb;
78 unsigned char *buffer; 77 unsigned char *buffer;
@@ -105,7 +104,7 @@ static void bcm203x_complete(struct urb *urb)
105 104
106 data->state = BCM203X_SELECT_MEMORY; 105 data->state = BCM203X_SELECT_MEMORY;
107 106
108 mod_timer(&data->timer, jiffies + (HZ / 10)); 107 schedule_work(&data->work);
109 break; 108 break;
110 109
111 case BCM203X_SELECT_MEMORY: 110 case BCM203X_SELECT_MEMORY:
@@ -158,9 +157,9 @@ static void bcm203x_complete(struct urb *urb)
158 } 157 }
159} 158}
160 159
161static void bcm203x_timer(unsigned long user_data) 160static void bcm203x_work(void *user_data)
162{ 161{
163 struct bcm203x_data *data = (struct bcm203x_data *) user_data; 162 struct bcm203x_data *data = user_data;
164 163
165 if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0) 164 if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0)
166 BT_ERR("Can't submit URB"); 165 BT_ERR("Can't submit URB");
@@ -247,13 +246,11 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
247 246
248 release_firmware(firmware); 247 release_firmware(firmware);
249 248
250 init_timer(&data->timer); 249 INIT_WORK(&data->work, bcm203x_work, (void *) data);
251 data->timer.function = bcm203x_timer;
252 data->timer.data = (unsigned long) data;
253 250
254 usb_set_intfdata(intf, data); 251 usb_set_intfdata(intf, data);
255 252
256 mod_timer(&data->timer, jiffies + HZ); 253 schedule_work(&data->work);
257 254
258 return 0; 255 return 0;
259} 256}