xiaoxiang781216 commented on a change in pull request #5736:
URL: https://github.com/apache/incubator-nuttx/pull/5736#discussion_r827954509



##########
File path: drivers/input/touchscreen_upper.c
##########
@@ -105,28 +101,25 @@ static const struct file_operations g_touch_fops =
  * Private Functions
  ****************************************************************************/
 
-static void touch_notify(FAR struct touch_upperhalf_s *upper,
+static void touch_notify(FAR struct touch_openpriv_s *openpriv,
                          pollevent_t eventset)
 {
-  FAR struct pollfd *fd;
+  FAR struct pollfd *fd = openpriv->fds;
   int i;
 
-  for (i = 0; i < CONFIG_INPUT_TOUCHSCREEN_NPOLLWAITERS; i++)
+  fd = openpriv->fds;
+  if (fd)
     {
-      fd = upper->fds[i];
-      if (fd)
+      fd->revents |= (fd->events & eventset);
+      if (fd->revents != 0)
         {
-          fd->revents |= (fd->events & eventset);
-          if (fd->revents != 0)
+          /* report event log */
+
+          int semcount;
+          nxsem_get_value(fd->sem, &semcount);
+          if (semcount < 1)
             {
-              /* report event log */
-
-              int semcount;
-              nxsem_get_value(fd->sem, &semcount);
-              if (semcount < 1)
-                {
-                   nxsem_post(fd->sem);
-                }
+              nxsem_post(fd->sem);
             }

Review comment:
       @pkarashchenko check sem count before post, could avoid the poll/read 
thread wake up multiple time but the fifo is empty.




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


Reply via email to