Commit 17f98d55 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB minor ehci cleanup

USB minor ehci cleanup

This patch just does minor internal cleanup, renaming to
match the put/get convention used elsewhere in Linux.
(Get ref, put it back ... not "putting a new ref here".)
parent e4a486e9
...@@ -644,7 +644,7 @@ static void ehci_free_config (struct usb_hcd *hcd, struct usb_device *udev) ...@@ -644,7 +644,7 @@ static void ehci_free_config (struct usb_hcd *hcd, struct usb_device *udev)
spin_lock_irqsave (&ehci->lock, flags); spin_lock_irqsave (&ehci->lock, flags);
} }
} }
qh_unput (ehci, qh); qh_put (ehci, qh);
} }
} }
......
...@@ -98,16 +98,16 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, int flags) ...@@ -98,16 +98,16 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, int flags)
} }
/* to share a qh (cpu threads, or hc) */ /* to share a qh (cpu threads, or hc) */
static inline struct ehci_qh *qh_put (/* ehci, */ struct ehci_qh *qh) static inline struct ehci_qh *qh_get (/* ehci, */ struct ehci_qh *qh)
{ {
// dbg ("put %p (%d++)", qh, qh->refcount.counter); // dbg ("get %p (%d++)", qh, qh->refcount.counter);
atomic_inc (&qh->refcount); atomic_inc (&qh->refcount);
return qh; return qh;
} }
static void qh_unput (struct ehci_hcd *ehci, struct ehci_qh *qh) static void qh_put (struct ehci_hcd *ehci, struct ehci_qh *qh)
{ {
// dbg ("unput %p (--%d)", qh, qh->refcount.counter); // dbg ("put %p (--%d)", qh, qh->refcount.counter);
if (!atomic_dec_and_test (&qh->refcount)) if (!atomic_dec_and_test (&qh->refcount))
return; return;
/* clean qtds first, and know this is not linked */ /* clean qtds first, and know this is not linked */
......
...@@ -194,7 +194,7 @@ static void ehci_urb_done ( ...@@ -194,7 +194,7 @@ static void ehci_urb_done (
? PCI_DMA_FROMDEVICE ? PCI_DMA_FROMDEVICE
: PCI_DMA_TODEVICE); : PCI_DMA_TODEVICE);
if (likely (urb->hcpriv != 0)) { if (likely (urb->hcpriv != 0)) {
qh_unput (ehci, (struct ehci_qh *) urb->hcpriv); qh_put (ehci, (struct ehci_qh *) urb->hcpriv);
urb->hcpriv = 0; urb->hcpriv = 0;
} }
...@@ -815,9 +815,9 @@ submit_async ( ...@@ -815,9 +815,9 @@ submit_async (
* the HC and TT handle it when the TT has a buffer ready. * the HC and TT handle it when the TT has a buffer ready.
*/ */
if (likely (qh != 0)) { if (likely (qh != 0)) {
urb->hcpriv = qh_put (qh); urb->hcpriv = qh_get (qh);
if (likely (qh->qh_state == QH_STATE_IDLE)) if (likely (qh->qh_state == QH_STATE_IDLE))
qh_link_async (ehci, qh_put (qh)); qh_link_async (ehci, qh_get (qh));
} }
spin_unlock_irqrestore (&ehci->lock, flags); spin_unlock_irqrestore (&ehci->lock, flags);
if (unlikely (!qh)) if (unlikely (!qh))
...@@ -835,7 +835,7 @@ static void end_unlink_async (struct ehci_hcd *ehci) ...@@ -835,7 +835,7 @@ static void end_unlink_async (struct ehci_hcd *ehci)
qh->qh_state = QH_STATE_IDLE; qh->qh_state = QH_STATE_IDLE;
qh->qh_next.qh = 0; qh->qh_next.qh = 0;
qh_unput (ehci, qh); // refcount from reclaim qh_put (ehci, qh); // refcount from reclaim
ehci->reclaim = 0; ehci->reclaim = 0;
ehci->reclaim_ready = 0; ehci->reclaim_ready = 0;
...@@ -847,7 +847,7 @@ static void end_unlink_async (struct ehci_hcd *ehci) ...@@ -847,7 +847,7 @@ static void end_unlink_async (struct ehci_hcd *ehci)
&& HCD_IS_RUNNING (ehci->hcd.state)) && HCD_IS_RUNNING (ehci->hcd.state))
qh_link_async (ehci, qh); qh_link_async (ehci, qh);
else else
qh_unput (ehci, qh); // refcount from async list qh_put (ehci, qh); // refcount from async list
} }
...@@ -872,7 +872,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -872,7 +872,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
#endif #endif
qh->qh_state = QH_STATE_UNLINK; qh->qh_state = QH_STATE_UNLINK;
ehci->reclaim = qh = qh_put (qh); ehci->reclaim = qh = qh_get (qh);
// dbg_qh ("start unlink", ehci, qh); // dbg_qh ("start unlink", ehci, qh);
...@@ -937,14 +937,14 @@ static void scan_async (struct ehci_hcd *ehci) ...@@ -937,14 +937,14 @@ static void scan_async (struct ehci_hcd *ehci)
/* clean any finished work for this qh */ /* clean any finished work for this qh */
if (!list_empty (&qh->qtd_list)) { if (!list_empty (&qh->qtd_list)) {
// dbg_qh ("scan_async", ehci, qh); // dbg_qh ("scan_async", ehci, qh);
qh = qh_put (qh); qh = qh_get (qh);
spin_unlock_irqrestore (&ehci->lock, flags); spin_unlock_irqrestore (&ehci->lock, flags);
/* concurrent unlink could happen here */ /* concurrent unlink could happen here */
qh_completions (ehci, &qh->qtd_list, 1); qh_completions (ehci, &qh->qtd_list, 1);
spin_lock_irqsave (&ehci->lock, flags); spin_lock_irqsave (&ehci->lock, flags);
qh_unput (ehci, qh); qh_put (ehci, qh);
} }
/* unlink idle entries (reduces PCI usage) */ /* unlink idle entries (reduces PCI usage) */
......
...@@ -224,7 +224,7 @@ static void intr_deschedule ( ...@@ -224,7 +224,7 @@ static void intr_deschedule (
do { do {
periodic_unlink (ehci, frame, qh); periodic_unlink (ehci, frame, qh);
qh_unput (ehci, qh); qh_put (ehci, qh);
frame += period; frame += period;
} while (frame < ehci->periodic_size); } while (frame < ehci->periodic_size);
...@@ -345,7 +345,7 @@ static int intr_submit ( ...@@ -345,7 +345,7 @@ static int intr_submit (
qh->hw_next = EHCI_LIST_END; qh->hw_next = EHCI_LIST_END;
qh->usecs = usecs; qh->usecs = usecs;
urb->hcpriv = qh_put (qh); urb->hcpriv = qh_get (qh);
status = -ENOSPC; status = -ENOSPC;
/* pick a set of schedule slots, link the QH into them */ /* pick a set of schedule slots, link the QH into them */
...@@ -393,7 +393,7 @@ static int intr_submit ( ...@@ -393,7 +393,7 @@ static int intr_submit (
// AND handle it already being (implicitly) linked into this frame // AND handle it already being (implicitly) linked into this frame
BUG (); BUG ();
} else { } else {
ehci->pshadow [frame].qh = qh_put (qh); ehci->pshadow [frame].qh = qh_get (qh);
ehci->periodic [frame] = ehci->periodic [frame] =
QH_NEXT (qh->qh_dma); QH_NEXT (qh->qh_dma);
} }
...@@ -1113,8 +1113,8 @@ static void scan_periodic (struct ehci_hcd *ehci) ...@@ -1113,8 +1113,8 @@ static void scan_periodic (struct ehci_hcd *ehci)
temp = q.qh->qh_next; temp = q.qh->qh_next;
type = Q_NEXT_TYPE (q.qh->hw_next); type = Q_NEXT_TYPE (q.qh->hw_next);
flags = intr_complete (ehci, frame, flags = intr_complete (ehci, frame,
qh_put (q.qh), flags); qh_get (q.qh), flags);
qh_unput (ehci, q.qh); qh_put (ehci, q.qh);
q = temp; q = temp;
break; break;
case Q_TYPE_FSTN: case Q_TYPE_FSTN:
......
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