diff options
Diffstat (limited to 'drivers/usb/c67x00/c67x00-sched.c')
-rw-r--r-- | drivers/usb/c67x00/c67x00-sched.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/drivers/usb/c67x00/c67x00-sched.c b/drivers/usb/c67x00/c67x00-sched.c index 892cc96466eb..7311ed61e99a 100644 --- a/drivers/usb/c67x00/c67x00-sched.c +++ b/drivers/usb/c67x00/c67x00-sched.c | |||
@@ -144,8 +144,6 @@ struct c67x00_urb_priv { | |||
144 | 144 | ||
145 | /* -------------------------------------------------------------------------- */ | 145 | /* -------------------------------------------------------------------------- */ |
146 | 146 | ||
147 | #ifdef DEBUG | ||
148 | |||
149 | /** | 147 | /** |
150 | * dbg_td - Dump the contents of the TD | 148 | * dbg_td - Dump the contents of the TD |
151 | */ | 149 | */ |
@@ -166,16 +164,8 @@ static void dbg_td(struct c67x00_hcd *c67x00, struct c67x00_td *td, char *msg) | |||
166 | dev_dbg(dev, "retry_cnt: 0x%02x\n", td->retry_cnt); | 164 | dev_dbg(dev, "retry_cnt: 0x%02x\n", td->retry_cnt); |
167 | dev_dbg(dev, "residue: 0x%02x\n", td->residue); | 165 | dev_dbg(dev, "residue: 0x%02x\n", td->residue); |
168 | dev_dbg(dev, "next_td_addr: 0x%04x\n", td_next_td_addr(td)); | 166 | dev_dbg(dev, "next_td_addr: 0x%04x\n", td_next_td_addr(td)); |
169 | dev_dbg(dev, "data:"); | 167 | dev_dbg(dev, "data: %*ph\n", td_length(td), td->data); |
170 | print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, | ||
171 | td->data, td_length(td), 1); | ||
172 | } | 168 | } |
173 | #else /* DEBUG */ | ||
174 | |||
175 | static inline void | ||
176 | dbg_td(struct c67x00_hcd *c67x00, struct c67x00_td *td, char *msg) { } | ||
177 | |||
178 | #endif /* DEBUG */ | ||
179 | 169 | ||
180 | /* -------------------------------------------------------------------------- */ | 170 | /* -------------------------------------------------------------------------- */ |
181 | /* Helper functions */ | 171 | /* Helper functions */ |
@@ -372,6 +362,13 @@ int c67x00_urb_enqueue(struct usb_hcd *hcd, | |||
372 | struct c67x00_hcd *c67x00 = hcd_to_c67x00_hcd(hcd); | 362 | struct c67x00_hcd *c67x00 = hcd_to_c67x00_hcd(hcd); |
373 | int port = get_root_port(urb->dev)-1; | 363 | int port = get_root_port(urb->dev)-1; |
374 | 364 | ||
365 | /* Allocate and initialize urb private data */ | ||
366 | urbp = kzalloc(sizeof(*urbp), mem_flags); | ||
367 | if (!urbp) { | ||
368 | ret = -ENOMEM; | ||
369 | goto err_urbp; | ||
370 | } | ||
371 | |||
375 | spin_lock_irqsave(&c67x00->lock, flags); | 372 | spin_lock_irqsave(&c67x00->lock, flags); |
376 | 373 | ||
377 | /* Make sure host controller is running */ | 374 | /* Make sure host controller is running */ |
@@ -384,13 +381,6 @@ int c67x00_urb_enqueue(struct usb_hcd *hcd, | |||
384 | if (ret) | 381 | if (ret) |
385 | goto err_not_linked; | 382 | goto err_not_linked; |
386 | 383 | ||
387 | /* Allocate and initialize urb private data */ | ||
388 | urbp = kzalloc(sizeof(*urbp), mem_flags); | ||
389 | if (!urbp) { | ||
390 | ret = -ENOMEM; | ||
391 | goto err_urbp; | ||
392 | } | ||
393 | |||
394 | INIT_LIST_HEAD(&urbp->hep_node); | 384 | INIT_LIST_HEAD(&urbp->hep_node); |
395 | urbp->urb = urb; | 385 | urbp->urb = urb; |
396 | urbp->port = port; | 386 | urbp->port = port; |
@@ -453,11 +443,11 @@ int c67x00_urb_enqueue(struct usb_hcd *hcd, | |||
453 | return 0; | 443 | return 0; |
454 | 444 | ||
455 | err_epdata: | 445 | err_epdata: |
456 | kfree(urbp); | ||
457 | err_urbp: | ||
458 | usb_hcd_unlink_urb_from_ep(hcd, urb); | 446 | usb_hcd_unlink_urb_from_ep(hcd, urb); |
459 | err_not_linked: | 447 | err_not_linked: |
460 | spin_unlock_irqrestore(&c67x00->lock, flags); | 448 | spin_unlock_irqrestore(&c67x00->lock, flags); |
449 | kfree(urbp); | ||
450 | err_urbp: | ||
461 | 451 | ||
462 | return ret; | 452 | return ret; |
463 | } | 453 | } |
@@ -780,7 +770,8 @@ static int c67x00_add_iso_urb(struct c67x00_hcd *c67x00, struct urb *urb) | |||
780 | ret = c67x00_create_td(c67x00, urb, td_buf, len, pid, 0, | 770 | ret = c67x00_create_td(c67x00, urb, td_buf, len, pid, 0, |
781 | urbp->cnt); | 771 | urbp->cnt); |
782 | if (ret) { | 772 | if (ret) { |
783 | printk(KERN_DEBUG "create failed: %d\n", ret); | 773 | dev_dbg(c67x00_hcd_dev(c67x00), "create failed: %d\n", |
774 | ret); | ||
784 | urb->iso_frame_desc[urbp->cnt].actual_length = 0; | 775 | urb->iso_frame_desc[urbp->cnt].actual_length = 0; |
785 | urb->iso_frame_desc[urbp->cnt].status = ret; | 776 | urb->iso_frame_desc[urbp->cnt].status = ret; |
786 | if (urbp->cnt + 1 == urb->number_of_packets) | 777 | if (urbp->cnt + 1 == urb->number_of_packets) |