Commit c72b4fbb authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] USB: Cosmetic improvements for the UHCI driver

This patch makes a few minor improvements to the appearance of the UHCI
driver.  Please apply.
parent c1f4a51d
...@@ -157,8 +157,8 @@ static struct uhci_td *uhci_alloc_td(struct uhci_hcd *uhci, struct usb_device *d ...@@ -157,8 +157,8 @@ static struct uhci_td *uhci_alloc_td(struct uhci_hcd *uhci, struct usb_device *d
return td; return td;
} }
static inline void uhci_fill_td(struct uhci_td *td, __u32 status, static inline void uhci_fill_td(struct uhci_td *td, u32 status,
__u32 token, __u32 buffer) u32 token, u32 buffer)
{ {
td->status = cpu_to_le32(status); td->status = cpu_to_le32(status);
td->token = cpu_to_le32(token); td->token = cpu_to_le32(token);
...@@ -184,11 +184,11 @@ static void uhci_insert_td_frame_list(struct uhci_hcd *uhci, struct uhci_td *td, ...@@ -184,11 +184,11 @@ static void uhci_insert_td_frame_list(struct uhci_hcd *uhci, struct uhci_td *td,
list_add_tail(&td->fl_list, &ftd->fl_list); list_add_tail(&td->fl_list, &ftd->fl_list);
td->link = ltd->link; td->link = ltd->link;
mb(); wmb();
ltd->link = cpu_to_le32(td->dma_handle); ltd->link = cpu_to_le32(td->dma_handle);
} else { } else {
td->link = uhci->fl->frame[framenum]; td->link = uhci->fl->frame[framenum];
mb(); wmb();
uhci->fl->frame[framenum] = cpu_to_le32(td->dma_handle); uhci->fl->frame[framenum] = cpu_to_le32(td->dma_handle);
uhci->fl->frame_cpu[framenum] = td; uhci->fl->frame_cpu[framenum] = td;
} }
...@@ -218,7 +218,7 @@ static void uhci_remove_td(struct uhci_hcd *uhci, struct uhci_td *td) ...@@ -218,7 +218,7 @@ static void uhci_remove_td(struct uhci_hcd *uhci, struct uhci_td *td)
ptd->link = td->link; ptd->link = td->link;
} }
mb(); wmb();
td->link = UHCI_PTR_TERM; td->link = UHCI_PTR_TERM;
list_del_init(&td->fl_list); list_del_init(&td->fl_list);
...@@ -352,15 +352,15 @@ static void uhci_insert_qh(struct uhci_hcd *uhci, struct uhci_qh *skelqh, struct ...@@ -352,15 +352,15 @@ static void uhci_insert_qh(struct uhci_hcd *uhci, struct uhci_qh *skelqh, struct
* *
* The HC could see (and use!) any of these as we write them. * The HC could see (and use!) any of these as we write them.
*/ */
lqh->link = cpu_to_le32(urbp->qh->dma_handle) | UHCI_PTR_QH;
if (lqh->urbp) { if (lqh->urbp) {
list_for_each (tmp, &lqh->urbp->queue_list) { list_for_each (tmp, &lqh->urbp->queue_list) {
struct urb_priv *turbp = struct urb_priv *turbp =
list_entry(tmp, struct urb_priv, queue_list); list_entry(tmp, struct urb_priv, queue_list);
turbp->qh->link = cpu_to_le32(urbp->qh->dma_handle) | UHCI_PTR_QH; turbp->qh->link = lqh->link;
} }
} }
lqh->link = cpu_to_le32(urbp->qh->dma_handle) | UHCI_PTR_QH;
list_add_tail(&urbp->qh->list, &skelqh->list); list_add_tail(&urbp->qh->list, &skelqh->list);
} }
...@@ -372,7 +372,7 @@ static void uhci_insert_qh(struct uhci_hcd *uhci, struct uhci_qh *skelqh, struct ...@@ -372,7 +372,7 @@ static void uhci_insert_qh(struct uhci_hcd *uhci, struct uhci_qh *skelqh, struct
static void uhci_remove_qh(struct uhci_hcd *uhci, struct uhci_qh *qh) static void uhci_remove_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
{ {
struct uhci_qh *pqh; struct uhci_qh *pqh;
__u32 newlink; u32 newlink;
if (!qh) if (!qh)
return; return;
...@@ -413,7 +413,7 @@ static void uhci_remove_qh(struct uhci_hcd *uhci, struct uhci_qh *qh) ...@@ -413,7 +413,7 @@ static void uhci_remove_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
turbp->qh->link = newlink; turbp->qh->link = newlink;
} }
} }
mb(); wmb();
/* Leave qh->link in case the HC is on the QH now, it will */ /* Leave qh->link in case the HC is on the QH now, it will */
/* continue the rest of the schedule */ /* continue the rest of the schedule */
...@@ -500,7 +500,7 @@ static void uhci_append_queued_urb(struct uhci_hcd *uhci, struct urb *eurb, stru ...@@ -500,7 +500,7 @@ static void uhci_append_queued_urb(struct uhci_hcd *uhci, struct urb *eurb, stru
/* All qh's in the queue need to link to the next queue */ /* All qh's in the queue need to link to the next queue */
urbp->qh->link = eurbp->qh->link; urbp->qh->link = eurbp->qh->link;
mb(); /* Make sure we flush everything */ wmb(); /* Make sure we flush everything */
lltd->link = cpu_to_le32(urbp->qh->dma_handle) | UHCI_PTR_QH; lltd->link = cpu_to_le32(urbp->qh->dma_handle) | UHCI_PTR_QH;
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
#define CAN_SCHEDULE_FRAMES 1000 /* how far future frames can be scheduled */ #define CAN_SCHEDULE_FRAMES 1000 /* how far future frames can be scheduled */
struct uhci_frame_list { struct uhci_frame_list {
__u32 frame[UHCI_NUMFRAMES]; u32 frame[UHCI_NUMFRAMES];
void *frame_cpu[UHCI_NUMFRAMES]; void *frame_cpu[UHCI_NUMFRAMES];
...@@ -105,8 +105,8 @@ struct urb_priv; ...@@ -105,8 +105,8 @@ struct urb_priv;
*/ */
struct uhci_qh { struct uhci_qh {
/* Hardware fields */ /* Hardware fields */
__u32 link; /* Next queue */ u32 link; /* Next queue */
__u32 element; /* Queue element pointer */ u32 element; /* Queue element pointer */
/* Software fields */ /* Software fields */
dma_addr_t dma_handle; dma_addr_t dma_handle;
...@@ -185,10 +185,10 @@ struct uhci_qh { ...@@ -185,10 +185,10 @@ struct uhci_qh {
*/ */
struct uhci_td { struct uhci_td {
/* Hardware fields */ /* Hardware fields */
__u32 link; u32 link;
__u32 status; u32 status;
__u32 token; u32 token;
__u32 buffer; u32 buffer;
/* Software fields */ /* Software fields */
dma_addr_t dma_handle; dma_addr_t dma_handle;
......
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