xiaoxiang781216 commented on code in PR #6965: URL: https://github.com/apache/incubator-nuttx/pull/6965#discussion_r989755733
########## drivers/usbhost/usbhost_max3421e.c: ########## @@ -419,13 +414,6 @@ static void max3421e_sndblock(FAR struct max3421e_usbhost_s *priv, # define max3421e_pktdump(m,b,n) #endif -/* Semaphores ***************************************************************/ - -static int max3421e_takesem(FAR sem_t *sem); -#define max3421e_givesem(s) nxsem_post(s); -static int max3421e_take_exclsem(FAR struct max3421e_usbhost_s *priv); -static void max3421e_give_exclsem(FAR struct max3421e_usbhost_s *priv); - /* Byte stream access helper functions **************************************/ static inline uint16_t max3421e_getle16(const uint8_t *val); Review Comment: Done. ########## drivers/usbhost/usbhost_xboxcontroller.c: ########## @@ -318,56 +312,14 @@ static uint32_t g_devinuse; /* The following are used to managed the class creation operation */ -static sem_t g_exclsem; /* For mutually exclusive thread creation */ -static sem_t g_syncsem; /* Thread data passing interlock */ -static struct usbhost_state_s *g_priv; /* Data passed to thread */ +static mutex_t g_lock = NXMUTEX_INITIALIZER; +static sem_t g_syncsem = NXSEM_INITIALIZER(0, PRIOINHERIT_FLAGS_DISABLE); +static struct usbhost_state_s *g_priv; Review Comment: Done. -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org