blue-debug commented on code in PR #18348:
URL: https://github.com/apache/nuttx/pull/18348#discussion_r2767394200


##########
audio/audio.c:
##########
@@ -141,42 +162,47 @@ static int audio_open(FAR struct file *filep)
 {
   FAR struct inode *inode = filep->f_inode;
   FAR struct audio_upperhalf_s *upper = inode->i_private;
-  uint8_t tmp;
+  FAR struct audio_openpriv_s *priv;
+  irqstate_t flags;
   int ret;
 
-  audinfo("crefs: %d\n", upper->crefs);
-
   /* Get exclusive access to the device structures */
 
   ret = nxmutex_lock(&upper->lock);
   if (ret < 0)
     {
-      goto errout;
+      return ret;
     }
 
-  /* Increment the count of references to the device.  If this the first
-   * time that the driver has been opened for this device, then initialize
-   * the device.
-   */
+  /* First open, alloc status memory */
 
-  tmp = upper->crefs + 1;

Review Comment:
   
   Crefs only counted opens. Now each open has its own priv in a list, with an 
independent state machine for multiplexing. If the list is empty, it’s the last 
close, so crefs isn’t needed.



-- 
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