ldube commented on code in PR #8879:
URL: https://github.com/apache/nuttx/pull/8879#discussion_r1146276825


##########
arch/arm/src/sama5/sam_ohci.c:
##########
@@ -3899,20 +3907,18 @@ static void sam_disconnect(struct usbhost_driver_s 
*drvr,
   DEBUGASSERT(rhport != NULL && hport != NULL && hport->ep0);
   ep0 = (struct sam_eplist_s *)hport->ep0;
 
-  /* Remove the disconnected port from the control list */
-
-  sam_ep0dequeue(ep0);
-
-  /* Did we just dequeue EP0 from a hoot hub port? */
+  /* Did we just dequeue EP0 from a root hub port? */
 
   if (ROOTHUB(hport))
     {
+      /* Remove the disconnected port from the control list */
+
+      sam_ep0dequeue(ep0);
       rhport->ep0init = false;
     }
 
   /* Unbind the class from the port */
 
-  hport->ep0      = NULL;

Review Comment:
   This was removed for two reasons:
   1) No allowed to set to NULL for root hubs.
   2) Already NULL because usbhost_hport_deactivate runs first.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to