git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[Bluetooth] Use work queue to trigger URB submission
[pandora-kernel.git]
/
drivers
/
bluetooth
/
bcm203x.c
diff --git
a/drivers/bluetooth/bcm203x.c
b/drivers/bluetooth/bcm203x.c
index
6f67141
..
5167517
100644
(file)
--- a/
drivers/bluetooth/bcm203x.c
+++ b/
drivers/bluetooth/bcm203x.c
@@
-29,7
+29,6
@@
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/errno.h>
-#include <linux/timer.h>
#include <linux/device.h>
#include <linux/firmware.h>
#include <linux/device.h>
#include <linux/firmware.h>
@@
-43,7
+42,7
@@
#define BT_DBG(D...)
#endif
#define BT_DBG(D...)
#endif
-#define VERSION "1.
0
"
+#define VERSION "1.
1
"
static int ignore = 0;
static int ignore = 0;
@@
-72,7
+71,7
@@
struct bcm203x_data {
unsigned long state;
unsigned long state;
- struct
timer_list timer
;
+ struct
work_struct work
;
struct urb *urb;
unsigned char *buffer;
struct urb *urb;
unsigned char *buffer;
@@
-82,7
+81,7
@@
struct bcm203x_data {
unsigned int fw_sent;
};
unsigned int fw_sent;
};
-static void bcm203x_complete(struct urb *urb
, struct pt_regs *regs
)
+static void bcm203x_complete(struct urb *urb)
{
struct bcm203x_data *data = urb->context;
struct usb_device *udev = urb->dev;
{
struct bcm203x_data *data = urb->context;
struct usb_device *udev = urb->dev;
@@
-105,7
+104,7
@@
static void bcm203x_complete(struct urb *urb, struct pt_regs *regs)
data->state = BCM203X_SELECT_MEMORY;
data->state = BCM203X_SELECT_MEMORY;
-
mod_timer(&data->timer, jiffies + (HZ / 10)
);
+
schedule_work(&data->work
);
break;
case BCM203X_SELECT_MEMORY:
break;
case BCM203X_SELECT_MEMORY:
@@
-158,9
+157,9
@@
static void bcm203x_complete(struct urb *urb, struct pt_regs *regs)
}
}
}
}
-static void bcm203x_
timer(unsigned long
user_data)
+static void bcm203x_
work(void *
user_data)
{
{
- struct bcm203x_data *data =
(struct bcm203x_data *)
user_data;
+ struct bcm203x_data *data = user_data;
if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0)
BT_ERR("Can't submit URB");
if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0)
BT_ERR("Can't submit URB");
@@
-234,6
+233,7
@@
static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
data->fw_data = kmalloc(firmware->size, GFP_KERNEL);
if (!data->fw_data) {
BT_ERR("Can't allocate memory for firmware image");
data->fw_data = kmalloc(firmware->size, GFP_KERNEL);
if (!data->fw_data) {
BT_ERR("Can't allocate memory for firmware image");
+ release_firmware(firmware);
usb_free_urb(data->urb);
kfree(data->buffer);
kfree(data);
usb_free_urb(data->urb);
kfree(data->buffer);
kfree(data);
@@
-246,13
+246,11
@@
static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
release_firmware(firmware);
release_firmware(firmware);
- init_timer(&data->timer);
- data->timer.function = bcm203x_timer;
- data->timer.data = (unsigned long) data;
+ INIT_WORK(&data->work, bcm203x_work, (void *) data);
usb_set_intfdata(intf, data);
usb_set_intfdata(intf, data);
-
mod_timer(&data->timer, jiffies + HZ
);
+
schedule_work(&data->work
);
return 0;
}
return 0;
}