Index: uspace/drv/ohci/endpoint_list.c
===================================================================
--- uspace/drv/ohci/endpoint_list.c	(revision 2aaf80403cfc5d32059b7711a076f77b1dcfd359)
+++ uspace/drv/ohci/endpoint_list.c	(revision 4fe3b6d8a9632b4191c8e88471849f92bd765912)
@@ -44,5 +44,5 @@
  * @return Error code
  *
- * Allocates memory for internal qh_t structure.
+ * Allocates memory for internal ed_t structure.
  */
 int endpoint_list_init(endpoint_list_t *instance, const char *name)
@@ -69,7 +69,6 @@
  * @param[in] instance List to lead.
  * @param[in] next List to append.
- * @return Error code
  *
- * Does not check whether this replaces an existing list .
+ * Does not check whether this replaces an existing list.
  */
 void endpoint_list_set_next(endpoint_list_t *instance, endpoint_list_t *next)
@@ -80,9 +79,8 @@
 }
 /*----------------------------------------------------------------------------*/
-/** Submit transfer endpoint to the list and queue.
+/** Add endpoint to the list and queue.
  *
  * @param[in] instance List to use.
- * @param[in] endpoint Transfer endpoint to submit.
- * @return Error code
+ * @param[in] endpoint Endpoint to add.
  *
  * The endpoint is added to the end of the list and queue.
@@ -100,10 +98,11 @@
 	/* Add to the hardware queue. */
 	if (list_empty(&instance->endpoint_list)) {
-		/* There is nothing scheduled */
+		/* There are no active EDs */
 		last_ed = instance->list_head;
 	} else {
-		/* There is something scheduled */
+		/* There are active EDs, get the last one */
 		hcd_endpoint_t *last = list_get_instance(
 		    instance->endpoint_list.prev, hcd_endpoint_t, link);
+		assert(last);
 		last_ed = last->ed;
 	}
@@ -113,11 +112,10 @@
 	write_barrier();
 
-	/* Add ed to the hw list */
+	/* Add ed to the hw queue */
 	ed_append_ed(last_ed, hcd_ep->ed);
 	/* Make sure ED is updated */
 	write_barrier();
 
-
-	/* Add to the driver list */
+	/* Add to the sw list */
 	list_append(&hcd_ep->link, &instance->endpoint_list);
 
@@ -135,59 +133,8 @@
 }
 /*----------------------------------------------------------------------------*/
-#if 0
-/** Create list for finished endpoints.
+/** Remove endpoint from the list and queue.
  *
  * @param[in] instance List to use.
- * @param[in] done list to fill
- */
-void endpoint_list_remove_finished(endpoint_list_t *instance, link_t *done)
-{
-	assert(instance);
-	assert(done);
-
-	fibril_mutex_lock(&instance->guard);
-	usb_log_debug2("Checking list %s for completed endpointes(%d).\n",
-	    instance->name, list_count(&instance->endpoint_list));
-	link_t *current = instance->endpoint_list.next;
-	while (current != &instance->endpoint_list) {
-		link_t *next = current->next;
-		hcd_endpoint_t *endpoint =
-		    list_get_instance(current, hcd_endpoint_t, link);
-
-		if (endpoint_is_complete(endpoint)) {
-			/* Save for post-processing */
-			endpoint_list_remove_endpoint(instance, endpoint);
-			list_append(current, done);
-		}
-		current = next;
-	}
-	fibril_mutex_unlock(&instance->guard);
-}
-/*----------------------------------------------------------------------------*/
-/** Walk the list and abort all endpointes.
- *
- * @param[in] instance List to use.
- */
-void endpoint_list_abort_all(endpoint_list_t *instance)
-{
-	fibril_mutex_lock(&instance->guard);
-	while (!list_empty(&instance->endpoint_list)) {
-		link_t *current = instance->endpoint_list.next;
-		hcd_endpoint_t *endpoint =
-		    list_get_instance(current, hcd_endpoint_t, link);
-		endpoint_list_remove_endpoint(instance, endpoint);
-		hcd_endpoint_finish_error(endpoint, EIO);
-	}
-	fibril_mutex_unlock(&instance->guard);
-}
-#endif
-/*----------------------------------------------------------------------------*/
-/** Remove a transfer endpoint from the list and queue.
- *
- * @param[in] instance List to use.
- * @param[in] endpoint Transfer endpoint to remove.
- * @return Error code
- *
- * Does not lock the transfer list, caller is responsible for that.
+ * @param[in] endpoint Endpoint to remove.
  */
 void endpoint_list_remove_ep(endpoint_list_t *instance, hcd_endpoint_t *hcd_ep)
