aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2005-09-16 14:17:45 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 19:47:39 -0400
commit8b4cd42134fbd3c9a9a5c3467d31717798219b1b (patch)
treeaec7570ecc2f481b2a3357f05810be8c3d897669 /drivers/usb/host
parente08fb39b771dd7dcba405669b5384fe9929e1caf (diff)
[PATCH] USB: UHCI: Remove unused fields and unneeded tests for NULL
This patch (as562) removes from the uhci-hcd driver a few unused fields and some unnecessary tests against NULL and assignments to NULL. In fact it wasn't until fairly recently that the tests became unnecessary. Before last winter it was possible that the driver's stop() routine would get called even if the start() routine returned an error, but now that can't happen. Hence there's no longer any need to check for partial initialization. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/uhci-debug.c1
-rw-r--r--drivers/usb/host/uhci-hcd.c44
-rw-r--r--drivers/usb/host/uhci-hcd.h3
-rw-r--r--drivers/usb/host/uhci-q.c5
4 files changed, 10 insertions, 43 deletions
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c
index 4538a98b6f9d..04eddd7995c3 100644
--- a/drivers/usb/host/uhci-debug.c
+++ b/drivers/usb/host/uhci-debug.c
@@ -348,7 +348,6 @@ static int uhci_show_urbp(struct uhci_hcd *uhci, struct urb_priv *urbp, char *bu
348 348
349 if (urbp->urb->status != -EINPROGRESS) 349 if (urbp->urb->status != -EINPROGRESS)
350 out += sprintf(out, "Status=%d ", urbp->urb->status); 350 out += sprintf(out, "Status=%d ", urbp->urb->status);
351 //out += sprintf(out, "Inserttime=%lx ",urbp->inserttime);
352 //out += sprintf(out, "FSBRtime=%lx ",urbp->fsbrtime); 351 //out += sprintf(out, "FSBRtime=%lx ",urbp->fsbrtime);
353 352
354 count = 0; 353 count = 0;
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index 0c024898cbea..17de9ee910f6 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -437,36 +437,18 @@ static void release_uhci(struct uhci_hcd *uhci)
437 int i; 437 int i;
438 438
439 for (i = 0; i < UHCI_NUM_SKELQH; i++) 439 for (i = 0; i < UHCI_NUM_SKELQH; i++)
440 if (uhci->skelqh[i]) { 440 uhci_free_qh(uhci, uhci->skelqh[i]);
441 uhci_free_qh(uhci, uhci->skelqh[i]);
442 uhci->skelqh[i] = NULL;
443 }
444 441
445 if (uhci->term_td) { 442 uhci_free_td(uhci, uhci->term_td);
446 uhci_free_td(uhci, uhci->term_td);
447 uhci->term_td = NULL;
448 }
449 443
450 if (uhci->qh_pool) { 444 dma_pool_destroy(uhci->qh_pool);
451 dma_pool_destroy(uhci->qh_pool);
452 uhci->qh_pool = NULL;
453 }
454 445
455 if (uhci->td_pool) { 446 dma_pool_destroy(uhci->td_pool);
456 dma_pool_destroy(uhci->td_pool);
457 uhci->td_pool = NULL;
458 }
459 447
460 if (uhci->fl) { 448 dma_free_coherent(uhci_dev(uhci), sizeof(*uhci->fl),
461 dma_free_coherent(uhci_dev(uhci), sizeof(*uhci->fl), 449 uhci->fl, uhci->fl->dma_handle);
462 uhci->fl, uhci->fl->dma_handle);
463 uhci->fl = NULL;
464 }
465 450
466 if (uhci->dentry) { 451 debugfs_remove(uhci->dentry);
467 debugfs_remove(uhci->dentry);
468 uhci->dentry = NULL;
469 }
470} 452}
471 453
472static int uhci_reset(struct usb_hcd *hcd) 454static int uhci_reset(struct usb_hcd *hcd)
@@ -690,31 +672,25 @@ static int uhci_start(struct usb_hcd *hcd)
690 * error exits: 672 * error exits:
691 */ 673 */
692err_alloc_skelqh: 674err_alloc_skelqh:
693 for (i = 0; i < UHCI_NUM_SKELQH; i++) 675 for (i = 0; i < UHCI_NUM_SKELQH; i++) {
694 if (uhci->skelqh[i]) { 676 if (uhci->skelqh[i])
695 uhci_free_qh(uhci, uhci->skelqh[i]); 677 uhci_free_qh(uhci, uhci->skelqh[i]);
696 uhci->skelqh[i] = NULL; 678 }
697 }
698 679
699 uhci_free_td(uhci, uhci->term_td); 680 uhci_free_td(uhci, uhci->term_td);
700 uhci->term_td = NULL;
701 681
702err_alloc_term_td: 682err_alloc_term_td:
703 dma_pool_destroy(uhci->qh_pool); 683 dma_pool_destroy(uhci->qh_pool);
704 uhci->qh_pool = NULL;
705 684
706err_create_qh_pool: 685err_create_qh_pool:
707 dma_pool_destroy(uhci->td_pool); 686 dma_pool_destroy(uhci->td_pool);
708 uhci->td_pool = NULL;
709 687
710err_create_td_pool: 688err_create_td_pool:
711 dma_free_coherent(uhci_dev(uhci), sizeof(*uhci->fl), 689 dma_free_coherent(uhci_dev(uhci), sizeof(*uhci->fl),
712 uhci->fl, uhci->fl->dma_handle); 690 uhci->fl, uhci->fl->dma_handle);
713 uhci->fl = NULL;
714 691
715err_alloc_fl: 692err_alloc_fl:
716 debugfs_remove(uhci->dentry); 693 debugfs_remove(uhci->dentry);
717 uhci->dentry = NULL;
718 694
719err_create_debug_entry: 695err_create_debug_entry:
720 return retval; 696 return retval;
diff --git a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h
index 282f40b75881..1c161b4f5bcf 100644
--- a/drivers/usb/host/uhci-hcd.h
+++ b/drivers/usb/host/uhci-hcd.h
@@ -205,8 +205,6 @@ struct uhci_td {
205 /* Software fields */ 205 /* Software fields */
206 dma_addr_t dma_handle; 206 dma_addr_t dma_handle;
207 207
208 struct urb *urb;
209
210 struct list_head list; /* P: urb->lock */ 208 struct list_head list; /* P: urb->lock */
211 struct list_head remove_list; /* P: uhci->td_remove_list_lock */ 209 struct list_head remove_list; /* P: uhci->td_remove_list_lock */
212 210
@@ -434,7 +432,6 @@ struct urb_priv {
434 /* a control transfer, retrigger */ 432 /* a control transfer, retrigger */
435 /* the status phase */ 433 /* the status phase */
436 434
437 unsigned long inserttime; /* In jiffies */
438 unsigned long fsbrtime; /* In jiffies */ 435 unsigned long fsbrtime; /* In jiffies */
439 436
440 struct list_head queue_list; /* P: uhci->frame_list_lock */ 437 struct list_head queue_list; /* P: uhci->frame_list_lock */
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c
index 4e0fbe2c1a9a..d54038211ca6 100644
--- a/drivers/usb/host/uhci-q.c
+++ b/drivers/usb/host/uhci-q.c
@@ -443,7 +443,6 @@ static struct urb_priv *uhci_alloc_urb_priv(struct uhci_hcd *uhci, struct urb *u
443 443
444 memset((void *)urbp, 0, sizeof(*urbp)); 444 memset((void *)urbp, 0, sizeof(*urbp));
445 445
446 urbp->inserttime = jiffies;
447 urbp->fsbrtime = jiffies; 446 urbp->fsbrtime = jiffies;
448 urbp->urb = urb; 447 urbp->urb = urb;
449 448
@@ -462,8 +461,6 @@ static void uhci_add_td_to_urb(struct urb *urb, struct uhci_td *td)
462{ 461{
463 struct urb_priv *urbp = (struct urb_priv *)urb->hcpriv; 462 struct urb_priv *urbp = (struct urb_priv *)urb->hcpriv;
464 463
465 td->urb = urb;
466
467 list_add_tail(&td->list, &urbp->td_list); 464 list_add_tail(&td->list, &urbp->td_list);
468} 465}
469 466
@@ -473,8 +470,6 @@ static void uhci_remove_td_from_urb(struct uhci_td *td)
473 return; 470 return;
474 471
475 list_del_init(&td->list); 472 list_del_init(&td->list);
476
477 td->urb = NULL;
478} 473}
479 474
480static void uhci_destroy_urb_priv(struct uhci_hcd *uhci, struct urb *urb) 475static void uhci_destroy_urb_priv(struct uhci_hcd *uhci, struct urb *urb)