Commit 08d0ea94 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

usb_submit_urb() changes for USB drivers that live outside of the drivers/usb subdirectory.

parent af2a09fe
...@@ -120,11 +120,11 @@ int hci_usb_open(struct hci_dev *hdev) ...@@ -120,11 +120,11 @@ int hci_usb_open(struct hci_dev *hdev)
DBG("%s", hdev->name); DBG("%s", hdev->name);
husb->read_urb->dev = husb->udev; husb->read_urb->dev = husb->udev;
if ((status = usb_submit_urb(husb->read_urb))) if ((status = usb_submit_urb(husb->read_urb, GFP_KERNEL)))
DBG("read submit failed. %d", status); DBG("read submit failed. %d", status);
husb->intr_urb->dev = husb->udev; husb->intr_urb->dev = husb->udev;
if ((status = usb_submit_urb(husb->intr_urb))) if ((status = usb_submit_urb(husb->intr_urb, GFP_KERNEL)))
DBG("interrupt submit failed. %d", status); DBG("interrupt submit failed. %d", status);
hdev->flags |= HCI_RUNNING; hdev->flags |= HCI_RUNNING;
...@@ -428,7 +428,7 @@ static void hci_usb_bulk_read(struct urb *urb) ...@@ -428,7 +428,7 @@ static void hci_usb_bulk_read(struct urb *urb)
resubmit: resubmit:
husb->read_urb->dev = husb->udev; husb->read_urb->dev = husb->udev;
if ((status = usb_submit_urb(husb->read_urb))) if ((status = usb_submit_urb(husb->read_urb, GFP_KERNEL)))
DBG("%s read URB submit failed %d", husb->hdev.name, status); DBG("%s read URB submit failed %d", husb->hdev.name, status);
DBG("%s read URB re-submited", husb->hdev.name); DBG("%s read URB re-submited", husb->hdev.name);
...@@ -453,7 +453,7 @@ static int hci_usb_ctrl_msg(struct hci_usb *husb, struct sk_buff *skb) ...@@ -453,7 +453,7 @@ static int hci_usb_ctrl_msg(struct hci_usb *husb, struct sk_buff *skb)
FILL_CONTROL_URB(urb, husb->udev, pipe, (void*)dr, skb->data, skb->len, FILL_CONTROL_URB(urb, husb->udev, pipe, (void*)dr, skb->data, skb->len,
hci_usb_ctrl, skb); hci_usb_ctrl, skb);
if ((status = usb_submit_urb(urb))) { if ((status = usb_submit_urb(urb, GFP_KERNEL))) {
DBG("%s control URB submit failed %d", husb->hdev.name, status); DBG("%s control URB submit failed %d", husb->hdev.name, status);
return status; return status;
} }
...@@ -474,7 +474,7 @@ static int hci_usb_write_msg(struct hci_usb *husb, struct sk_buff *skb) ...@@ -474,7 +474,7 @@ static int hci_usb_write_msg(struct hci_usb *husb, struct sk_buff *skb)
hci_usb_bulk_write, skb); hci_usb_bulk_write, skb);
urb->transfer_flags |= USB_QUEUE_BULK; urb->transfer_flags |= USB_QUEUE_BULK;
if ((status = usb_submit_urb(urb))) { if ((status = usb_submit_urb(urb, GFP_KERNEL))) {
DBG("%s write URB submit failed %d", husb->hdev.name, status); DBG("%s write URB submit failed %d", husb->hdev.name, status);
return status; return status;
} }
......
...@@ -204,7 +204,7 @@ static void send_packet(struct iforce *iforce, u16 cmd, unsigned char* data) ...@@ -204,7 +204,7 @@ static void send_packet(struct iforce *iforce, u16 cmd, unsigned char* data)
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&iforce->wait, &wait); add_wait_queue(&iforce->wait, &wait);
if (usb_submit_urb(iforce->out)) { if (usb_submit_urb(iforce->out, GFP_ATOMIC)) {
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
remove_wait_queue(&iforce->wait, &wait); remove_wait_queue(&iforce->wait, &wait);
return; return;
...@@ -289,7 +289,7 @@ static int get_id_packet(struct iforce *iforce, char *packet) ...@@ -289,7 +289,7 @@ static int get_id_packet(struct iforce *iforce, char *packet)
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&iforce->wait, &wait); add_wait_queue(&iforce->wait, &wait);
if (usb_submit_urb(iforce->ctrl)) { if (usb_submit_urb(iforce->ctrl, GFP_ATOMIC)) {
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
remove_wait_queue(&iforce->wait, &wait); remove_wait_queue(&iforce->wait, &wait);
return -1; return -1;
...@@ -345,7 +345,7 @@ static int iforce_open(struct input_dev *dev) ...@@ -345,7 +345,7 @@ static int iforce_open(struct input_dev *dev)
if (iforce->open++) if (iforce->open++)
break; break;
iforce->irq->dev = iforce->usbdev; iforce->irq->dev = iforce->usbdev;
if (usb_submit_urb(iforce->irq)) if (usb_submit_urb(iforce->irq, GFP_KERNEL))
return -EIO; return -EIO;
break; break;
#endif #endif
......
...@@ -409,10 +409,10 @@ struct st5481_adapter { ...@@ -409,10 +409,10 @@ struct st5481_adapter {
* Submit an URB with error reporting. This is a macro so * Submit an URB with error reporting. This is a macro so
* the __FUNCTION__ returns the caller function name. * the __FUNCTION__ returns the caller function name.
*/ */
#define SUBMIT_URB(urb) \ #define SUBMIT_URB(urb, mem_flags) \
({ \ ({ \
int status; \ int status; \
if ((status = usb_submit_urb(urb)) < 0) { \ if ((status = usb_submit_urb(urb, mem_flags)) < 0) { \
WARN("usb_submit_urb failed,status=%d", status); \ WARN("usb_submit_urb failed,status=%d", status); \
} \ } \
status; \ status; \
......
...@@ -115,7 +115,7 @@ static void usb_b_out(struct st5481_bcs *bcs,int buf_nr) ...@@ -115,7 +115,7 @@ static void usb_b_out(struct st5481_bcs *bcs,int buf_nr)
DBG_ISO_PACKET(0x200,urb); DBG_ISO_PACKET(0x200,urb);
SUBMIT_URB(urb); SUBMIT_URB(urb, GFP_KERNEL);
} }
/* /*
......
...@@ -356,10 +356,10 @@ static void usb_d_out(struct st5481_adapter *adapter, int buf_nr) ...@@ -356,10 +356,10 @@ static void usb_d_out(struct st5481_adapter *adapter, int buf_nr)
DBG_ISO_PACKET(0x20,urb); DBG_ISO_PACKET(0x20,urb);
if (usb_submit_urb(urb) < 0) { if (usb_submit_urb(urb, GFP_KERNEL) < 0) {
// There is another URB queued up // There is another URB queued up
urb->transfer_flags = USB_ISO_ASAP; urb->transfer_flags = USB_ISO_ASAP;
SUBMIT_URB(urb); SUBMIT_URB(urb, GFP_KERNEL);
} }
} }
...@@ -450,7 +450,7 @@ static void dout_start_xmit(struct FsmInst *fsm, int event, void *arg) ...@@ -450,7 +450,7 @@ static void dout_start_xmit(struct FsmInst *fsm, int event, void *arg)
urb->transfer_flags = USB_ISO_ASAP; urb->transfer_flags = USB_ISO_ASAP;
DBG_ISO_PACKET(0x20,urb); DBG_ISO_PACKET(0x20,urb);
SUBMIT_URB(urb); SUBMIT_URB(urb, GFP_KERNEL);
} }
static void dout_short_fifo(struct FsmInst *fsm, int event, void *arg) static void dout_short_fifo(struct FsmInst *fsm, int event, void *arg)
......
...@@ -48,7 +48,7 @@ static void usb_next_ctrl_msg(struct urb *urb, ...@@ -48,7 +48,7 @@ static void usb_next_ctrl_msg(struct urb *urb,
// Prepare the URB // Prepare the URB
urb->dev = adapter->usb_dev; urb->dev = adapter->usb_dev;
SUBMIT_URB(urb); SUBMIT_URB(urb, GFP_KERNEL);
} }
/* /*
...@@ -357,7 +357,7 @@ void __devinit st5481_start(struct st5481_adapter *adapter) ...@@ -357,7 +357,7 @@ void __devinit st5481_start(struct st5481_adapter *adapter)
adapter->leds = RED_LED; adapter->leds = RED_LED;
// Start receiving on the interrupt endpoint // Start receiving on the interrupt endpoint
SUBMIT_URB(intr->urb); SUBMIT_URB(intr->urb, GFP_KERNEL);
while ((request = init_cmd_table[i++])) { while ((request = init_cmd_table[i++])) {
value = init_cmd_table[i++]; value = init_cmd_table[i++];
...@@ -517,7 +517,7 @@ static void usb_in_complete(struct urb *urb) ...@@ -517,7 +517,7 @@ static void usb_in_complete(struct urb *urb)
urb->dev = in->adapter->usb_dev; urb->dev = in->adapter->usb_dev;
urb->actual_length = 0; urb->actual_length = 0;
SUBMIT_URB(urb); SUBMIT_URB(urb, GFP_KERNEL);
} }
int __devinit st5481_setup_in(struct st5481_in *in) int __devinit st5481_setup_in(struct st5481_in *in)
...@@ -603,10 +603,10 @@ static void st5481_start_rcv(void *context) ...@@ -603,10 +603,10 @@ static void st5481_start_rcv(void *context)
DBG(4,""); DBG(4,"");
in->urb[0]->dev = adapter->usb_dev; in->urb[0]->dev = adapter->usb_dev;
SUBMIT_URB(in->urb[0]); SUBMIT_URB(in->urb[0], GFP_KERNEL);
in->urb[1]->dev = adapter->usb_dev; in->urb[1]->dev = adapter->usb_dev;
SUBMIT_URB(in->urb[1]); SUBMIT_URB(in->urb[1], GFP_KERNEL);
} }
void st5481_in_mode(struct st5481_in *in, int mode) void st5481_in_mode(struct st5481_in *in, int mode)
......
...@@ -246,13 +246,13 @@ static int cpia_usb_open(void *privdata) ...@@ -246,13 +246,13 @@ static int cpia_usb_open(void *privdata)
ucpia->sbuf[1].urb->next = ucpia->sbuf[0].urb; ucpia->sbuf[1].urb->next = ucpia->sbuf[0].urb;
ucpia->sbuf[0].urb->next = ucpia->sbuf[1].urb; ucpia->sbuf[0].urb->next = ucpia->sbuf[1].urb;
err = usb_submit_urb(ucpia->sbuf[0].urb); err = usb_submit_urb(ucpia->sbuf[0].urb, GFP_KERNEL);
if (err) { if (err) {
printk(KERN_ERR "cpia_init_isoc: usb_submit_urb 0 ret %d\n", printk(KERN_ERR "cpia_init_isoc: usb_submit_urb 0 ret %d\n",
err); err);
goto error_urb1; goto error_urb1;
} }
err = usb_submit_urb(ucpia->sbuf[1].urb); err = usb_submit_urb(ucpia->sbuf[1].urb, GFP_KERNEL);
if (err) { if (err) {
printk(KERN_ERR "cpia_init_isoc: usb_submit_urb 1 ret %d\n", printk(KERN_ERR "cpia_init_isoc: usb_submit_urb 1 ret %d\n",
err); err);
......
...@@ -278,7 +278,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self) ...@@ -278,7 +278,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self)
urb->transfer_flags = USB_QUEUE_BULK | USB_ASYNC_UNLINK; urb->transfer_flags = USB_QUEUE_BULK | USB_ASYNC_UNLINK;
urb->timeout = MSECS_TO_JIFFIES(100); urb->timeout = MSECS_TO_JIFFIES(100);
if ((ret = usb_submit_urb(urb))) { if ((ret = usb_submit_urb(urb, GFP_KERNEL))) {
WARNING(__FUNCTION__ "(), failed Speed URB\n"); WARNING(__FUNCTION__ "(), failed Speed URB\n");
} }
spin_unlock_irqrestore(&self->lock, flags); spin_unlock_irqrestore(&self->lock, flags);
...@@ -451,7 +451,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -451,7 +451,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
} }
/* Ask USB to send the packet */ /* Ask USB to send the packet */
if ((res = usb_submit_urb(urb))) { if ((res = usb_submit_urb(urb, GFP_KERNEL))) {
WARNING(__FUNCTION__ "(), failed Tx URB\n"); WARNING(__FUNCTION__ "(), failed Tx URB\n");
self->stats.tx_errors++; self->stats.tx_errors++;
/* Let USB recover : We will catch that in the watchdog */ /* Let USB recover : We will catch that in the watchdog */
...@@ -730,7 +730,7 @@ static void irda_usb_submit(struct irda_usb_cb *self, struct sk_buff *skb, struc ...@@ -730,7 +730,7 @@ static void irda_usb_submit(struct irda_usb_cb *self, struct sk_buff *skb, struc
urb->status = 0; urb->status = 0;
urb->next = NULL; /* Don't auto resubmit URBs */ urb->next = NULL; /* Don't auto resubmit URBs */
ret = usb_submit_urb(urb); ret = usb_submit_urb(urb, GFP_KERNEL);
if (ret) { if (ret) {
/* If this ever happen, we are in deep s***. /* If this ever happen, we are in deep s***.
* Basically, the Rx path will stop... */ * Basically, the Rx path will stop... */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment