mirror of
https://github.com/adulau/aha.git
synced 2024-12-30 12:46:17 +00:00
[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>
This commit is contained in:
parent
e08fb39b77
commit
8b4cd42134
4 changed files with 10 additions and 43 deletions
|
@ -348,7 +348,6 @@ static int uhci_show_urbp(struct uhci_hcd *uhci, struct urb_priv *urbp, char *bu
|
||||||
|
|
||||||
if (urbp->urb->status != -EINPROGRESS)
|
if (urbp->urb->status != -EINPROGRESS)
|
||||||
out += sprintf(out, "Status=%d ", urbp->urb->status);
|
out += sprintf(out, "Status=%d ", urbp->urb->status);
|
||||||
//out += sprintf(out, "Inserttime=%lx ",urbp->inserttime);
|
|
||||||
//out += sprintf(out, "FSBRtime=%lx ",urbp->fsbrtime);
|
//out += sprintf(out, "FSBRtime=%lx ",urbp->fsbrtime);
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
|
@ -437,36 +437,18 @@ static void release_uhci(struct uhci_hcd *uhci)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < UHCI_NUM_SKELQH; i++)
|
for (i = 0; i < UHCI_NUM_SKELQH; i++)
|
||||||
if (uhci->skelqh[i]) {
|
uhci_free_qh(uhci, uhci->skelqh[i]);
|
||||||
uhci_free_qh(uhci, uhci->skelqh[i]);
|
|
||||||
uhci->skelqh[i] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (uhci->term_td) {
|
uhci_free_td(uhci, uhci->term_td);
|
||||||
uhci_free_td(uhci, uhci->term_td);
|
|
||||||
uhci->term_td = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (uhci->qh_pool) {
|
dma_pool_destroy(uhci->qh_pool);
|
||||||
dma_pool_destroy(uhci->qh_pool);
|
|
||||||
uhci->qh_pool = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (uhci->td_pool) {
|
dma_pool_destroy(uhci->td_pool);
|
||||||
dma_pool_destroy(uhci->td_pool);
|
|
||||||
uhci->td_pool = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (uhci->fl) {
|
dma_free_coherent(uhci_dev(uhci), sizeof(*uhci->fl),
|
||||||
dma_free_coherent(uhci_dev(uhci), sizeof(*uhci->fl),
|
uhci->fl, uhci->fl->dma_handle);
|
||||||
uhci->fl, uhci->fl->dma_handle);
|
|
||||||
uhci->fl = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (uhci->dentry) {
|
debugfs_remove(uhci->dentry);
|
||||||
debugfs_remove(uhci->dentry);
|
|
||||||
uhci->dentry = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int uhci_reset(struct usb_hcd *hcd)
|
static int uhci_reset(struct usb_hcd *hcd)
|
||||||
|
@ -690,31 +672,25 @@ static int uhci_start(struct usb_hcd *hcd)
|
||||||
* error exits:
|
* error exits:
|
||||||
*/
|
*/
|
||||||
err_alloc_skelqh:
|
err_alloc_skelqh:
|
||||||
for (i = 0; i < UHCI_NUM_SKELQH; i++)
|
for (i = 0; i < UHCI_NUM_SKELQH; i++) {
|
||||||
if (uhci->skelqh[i]) {
|
if (uhci->skelqh[i])
|
||||||
uhci_free_qh(uhci, uhci->skelqh[i]);
|
uhci_free_qh(uhci, uhci->skelqh[i]);
|
||||||
uhci->skelqh[i] = NULL;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
uhci_free_td(uhci, uhci->term_td);
|
uhci_free_td(uhci, uhci->term_td);
|
||||||
uhci->term_td = NULL;
|
|
||||||
|
|
||||||
err_alloc_term_td:
|
err_alloc_term_td:
|
||||||
dma_pool_destroy(uhci->qh_pool);
|
dma_pool_destroy(uhci->qh_pool);
|
||||||
uhci->qh_pool = NULL;
|
|
||||||
|
|
||||||
err_create_qh_pool:
|
err_create_qh_pool:
|
||||||
dma_pool_destroy(uhci->td_pool);
|
dma_pool_destroy(uhci->td_pool);
|
||||||
uhci->td_pool = NULL;
|
|
||||||
|
|
||||||
err_create_td_pool:
|
err_create_td_pool:
|
||||||
dma_free_coherent(uhci_dev(uhci), sizeof(*uhci->fl),
|
dma_free_coherent(uhci_dev(uhci), sizeof(*uhci->fl),
|
||||||
uhci->fl, uhci->fl->dma_handle);
|
uhci->fl, uhci->fl->dma_handle);
|
||||||
uhci->fl = NULL;
|
|
||||||
|
|
||||||
err_alloc_fl:
|
err_alloc_fl:
|
||||||
debugfs_remove(uhci->dentry);
|
debugfs_remove(uhci->dentry);
|
||||||
uhci->dentry = NULL;
|
|
||||||
|
|
||||||
err_create_debug_entry:
|
err_create_debug_entry:
|
||||||
return retval;
|
return retval;
|
||||||
|
|
|
@ -205,8 +205,6 @@ struct uhci_td {
|
||||||
/* Software fields */
|
/* Software fields */
|
||||||
dma_addr_t dma_handle;
|
dma_addr_t dma_handle;
|
||||||
|
|
||||||
struct urb *urb;
|
|
||||||
|
|
||||||
struct list_head list; /* P: urb->lock */
|
struct list_head list; /* P: urb->lock */
|
||||||
struct list_head remove_list; /* P: uhci->td_remove_list_lock */
|
struct list_head remove_list; /* P: uhci->td_remove_list_lock */
|
||||||
|
|
||||||
|
@ -434,7 +432,6 @@ struct urb_priv {
|
||||||
/* a control transfer, retrigger */
|
/* a control transfer, retrigger */
|
||||||
/* the status phase */
|
/* the status phase */
|
||||||
|
|
||||||
unsigned long inserttime; /* In jiffies */
|
|
||||||
unsigned long fsbrtime; /* In jiffies */
|
unsigned long fsbrtime; /* In jiffies */
|
||||||
|
|
||||||
struct list_head queue_list; /* P: uhci->frame_list_lock */
|
struct list_head queue_list; /* P: uhci->frame_list_lock */
|
||||||
|
|
|
@ -443,7 +443,6 @@ static struct urb_priv *uhci_alloc_urb_priv(struct uhci_hcd *uhci, struct urb *u
|
||||||
|
|
||||||
memset((void *)urbp, 0, sizeof(*urbp));
|
memset((void *)urbp, 0, sizeof(*urbp));
|
||||||
|
|
||||||
urbp->inserttime = jiffies;
|
|
||||||
urbp->fsbrtime = jiffies;
|
urbp->fsbrtime = jiffies;
|
||||||
urbp->urb = urb;
|
urbp->urb = urb;
|
||||||
|
|
||||||
|
@ -462,8 +461,6 @@ static void uhci_add_td_to_urb(struct urb *urb, struct uhci_td *td)
|
||||||
{
|
{
|
||||||
struct urb_priv *urbp = (struct urb_priv *)urb->hcpriv;
|
struct urb_priv *urbp = (struct urb_priv *)urb->hcpriv;
|
||||||
|
|
||||||
td->urb = urb;
|
|
||||||
|
|
||||||
list_add_tail(&td->list, &urbp->td_list);
|
list_add_tail(&td->list, &urbp->td_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -473,8 +470,6 @@ static void uhci_remove_td_from_urb(struct uhci_td *td)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
list_del_init(&td->list);
|
list_del_init(&td->list);
|
||||||
|
|
||||||
td->urb = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void uhci_destroy_urb_priv(struct uhci_hcd *uhci, struct urb *urb)
|
static void uhci_destroy_urb_priv(struct uhci_hcd *uhci, struct urb *urb)
|
||||||
|
|
Loading…
Reference in a new issue