aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/uhci-hcd.c
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/uhci-hcd.c
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/uhci-hcd.c')
-rw-r--r--drivers/usb/host/uhci-hcd.c44
1 files changed, 10 insertions, 34 deletions
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;