# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.456.2.8 -> 1.456.2.9
#	drivers/usb/host/ehci-q.c	1.10    -> 1.11   
#	drivers/usb/host/ehci-sched.c	1.8     -> 1.9    
#	drivers/usb/host/ehci-mem.c	1.5     -> 1.6    
#	drivers/usb/host/ehci-hcd.c	1.12    -> 1.13   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/04/12	david-b@pacbell.com	1.456.2.9
# [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".)
# --------------------------------------------
#
diff -Nru a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
--- a/drivers/usb/host/ehci-hcd.c	Tue Apr 16 11:35:46 2002
+++ b/drivers/usb/host/ehci-hcd.c	Tue Apr 16 11:35:46 2002
@@ -644,7 +644,7 @@
 					spin_lock_irqsave (&ehci->lock, flags);
 				}
 			}
-			qh_unput (ehci, qh);
+			qh_put (ehci, qh);
 		}
 	}
 
diff -Nru a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c
--- a/drivers/usb/host/ehci-mem.c	Tue Apr 16 11:35:46 2002
+++ b/drivers/usb/host/ehci-mem.c	Tue Apr 16 11:35:46 2002
@@ -98,16 +98,16 @@
 }
 
 /* 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);
 	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))
 		return;
 	/* clean qtds first, and know this is not linked */
diff -Nru a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
--- a/drivers/usb/host/ehci-q.c	Tue Apr 16 11:35:46 2002
+++ b/drivers/usb/host/ehci-q.c	Tue Apr 16 11:35:46 2002
@@ -194,7 +194,7 @@
 			    ? PCI_DMA_FROMDEVICE
 			    : PCI_DMA_TODEVICE);
 	if (likely (urb->hcpriv != 0)) {
-		qh_unput (ehci, (struct ehci_qh *) urb->hcpriv);
+		qh_put (ehci, (struct ehci_qh *) urb->hcpriv);
 		urb->hcpriv = 0;
 	}
 
@@ -815,9 +815,9 @@
 	 * the HC and TT handle it when the TT has a buffer ready.
 	 */
 	if (likely (qh != 0)) {
-		urb->hcpriv = qh_put (qh);
+		urb->hcpriv = qh_get (qh);
 		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);
 	if (unlikely (!qh))
@@ -835,7 +835,7 @@
 
 	qh->qh_state = QH_STATE_IDLE;
 	qh->qh_next.qh = 0;
-	qh_unput (ehci, qh);			// refcount from reclaim 
+	qh_put (ehci, qh);			// refcount from reclaim 
 	ehci->reclaim = 0;
 	ehci->reclaim_ready = 0;
 
@@ -847,7 +847,7 @@
 			&& HCD_IS_RUNNING (ehci->hcd.state))
 		qh_link_async (ehci, qh);
 	else
-		qh_unput (ehci, qh);		// refcount from async list
+		qh_put (ehci, qh);		// refcount from async list
 }
 
 
@@ -872,7 +872,7 @@
 #endif
 
 	qh->qh_state = QH_STATE_UNLINK;
-	ehci->reclaim = qh = qh_put (qh);
+	ehci->reclaim = qh = qh_get (qh);
 
 	// dbg_qh ("start unlink", ehci, qh);
 
@@ -937,14 +937,14 @@
 			/* clean any finished work for this qh */
 			if (!list_empty (&qh->qtd_list)) {
 				// dbg_qh ("scan_async", ehci, qh);
-				qh = qh_put (qh);
+				qh = qh_get (qh);
 				spin_unlock_irqrestore (&ehci->lock, flags);
 
 				/* concurrent unlink could happen here */
 				qh_completions (ehci, &qh->qtd_list, 1);
 
 				spin_lock_irqsave (&ehci->lock, flags);
-				qh_unput (ehci, qh);
+				qh_put (ehci, qh);
 			}
 
 			/* unlink idle entries (reduces PCI usage) */
diff -Nru a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
--- a/drivers/usb/host/ehci-sched.c	Tue Apr 16 11:35:46 2002
+++ b/drivers/usb/host/ehci-sched.c	Tue Apr 16 11:35:46 2002
@@ -224,7 +224,7 @@
 
 	do {
 		periodic_unlink (ehci, frame, qh);
-		qh_unput (ehci, qh);
+		qh_put (ehci, qh);
 		frame += period;
 	} while (frame < ehci->periodic_size);
 
@@ -345,7 +345,7 @@
 		qh->hw_next = EHCI_LIST_END;
 		qh->usecs = usecs;
 
-		urb->hcpriv = qh_put (qh);
+		urb->hcpriv = qh_get (qh);
 		status = -ENOSPC;
 
 		/* pick a set of schedule slots, link the QH into them */
@@ -393,7 +393,7 @@
 // AND handle it already being (implicitly) linked into this frame
 					BUG ();
 				} else {
-					ehci->pshadow [frame].qh = qh_put (qh);
+					ehci->pshadow [frame].qh = qh_get (qh);
 					ehci->periodic [frame] =
 						QH_NEXT (qh->qh_dma);
 				}
@@ -1113,8 +1113,8 @@
 				temp = q.qh->qh_next;
 				type = Q_NEXT_TYPE (q.qh->hw_next);
 				flags = intr_complete (ehci, frame,
-						qh_put (q.qh), flags);
-				qh_unput (ehci, q.qh);
+						qh_get (q.qh), flags);
+				qh_put (ehci, q.qh);
 				q = temp;
 				break;
 			case Q_TYPE_FSTN:
