Skip to content
Snippets Groups Projects
Commit ad258cb3 authored by Gregory Nutt's avatar Gregory Nutt
Browse files

SAMA5 OHCI: Fix some erors in the loop that waits for device connection changes

parent 9220a748
No related branches found
No related tags found
No related merge requests found
......@@ -1616,11 +1616,17 @@ static int sam_wait(FAR struct usbhost_driver_s *drvr, FAR const bool *connected
{
/* Has the connection state changed on the RH port? */
while (priv->rhport[rhpndx].connected != connected[rhpndx])
if (priv->rhport[rhpndx].connected != connected[rhpndx])
{
/* Yes.. break out and return the RH port number */
/* Yes.. Return the RH port number */
break;
irqrestore(flags);
udbg("RHPort%d connected: %s\n",
rhpndx + 1,
priv->rhport[rhpndx].connected ? "YES" : "NO");
return rhpndx;
}
}
......@@ -1631,13 +1637,6 @@ static int sam_wait(FAR struct usbhost_driver_s *drvr, FAR const bool *connected
priv->rhswait = true;
sam_takesem(&priv->rhssem);
}
irqrestore(flags);
udbg("RHPort%d connected: %s\n",
rhpndx + 1, priv->rhport[rhpndx].connected ? "YES" : "NO");
return rhpndx;
}
/*******************************************************************************
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment