X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fbluetooth%2Fbcm203x.c;h=9256985cbe36c727af74aec9333a8c0c5049dc05;hb=refs%2Fheads%2Fvserver;hp=3e7a067cc0871dafce5f0427f2690c383983a2c3;hpb=43bc926fffd92024b46cafaf7350d669ba9ca884;p=linux-2.6.git diff --git a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c index 3e7a067cc..9256985cb 100644 --- a/drivers/bluetooth/bcm203x.c +++ b/drivers/bluetooth/bcm203x.c @@ -22,7 +22,6 @@ * */ -#include #include #include @@ -30,7 +29,6 @@ #include #include #include -#include #include #include @@ -44,7 +42,7 @@ #define BT_DBG(D...) #endif -#define VERSION "1.0" +#define VERSION "1.1" static int ignore = 0; @@ -73,7 +71,7 @@ struct bcm203x_data { unsigned long state; - struct timer_list timer; + struct work_struct work; struct urb *urb; unsigned char *buffer; @@ -83,7 +81,7 @@ struct bcm203x_data { 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; @@ -106,7 +104,7 @@ static void bcm203x_complete(struct urb *urb, struct pt_regs *regs) data->state = BCM203X_SELECT_MEMORY; - mod_timer(&data->timer, jiffies + (HZ / 10)); + schedule_work(&data->work); break; case BCM203X_SELECT_MEMORY: @@ -159,9 +157,10 @@ static void bcm203x_complete(struct urb *urb, struct pt_regs *regs) } } -static void bcm203x_timer(unsigned long user_data) +static void bcm203x_work(struct work_struct *work) { - struct bcm203x_data *data = (struct bcm203x_data *) user_data; + struct bcm203x_data *data = + container_of(work, struct bcm203x_data, work); if (usb_submit_urb(data->urb, GFP_ATOMIC) < 0) BT_ERR("Can't submit URB"); @@ -235,6 +234,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"); + release_firmware(firmware); usb_free_urb(data->urb); kfree(data->buffer); kfree(data); @@ -247,13 +247,11 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id release_firmware(firmware); - init_timer(&data->timer); - data->timer.function = bcm203x_timer; - data->timer.data = (unsigned long) data; + INIT_WORK(&data->work, bcm203x_work); usb_set_intfdata(intf, data); - mod_timer(&data->timer, jiffies + HZ); + schedule_work(&data->work); return 0; }