You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/08/23 14:39:10 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6901: serial/uart/h4: add ioctl interface

pkarashchenko commented on code in PR #6901:
URL: https://github.com/apache/incubator-nuttx/pull/6901#discussion_r952715360


##########
drivers/serial/uart_bth4.c:
##########
@@ -351,7 +351,15 @@ static ssize_t uart_bth4_write(FAR struct file *filep,
 static int uart_bth4_ioctl(FAR struct file *filep, int cmd,
                            unsigned long arg)
 {
-  return OK;
+  FAR struct inode *inode = filep->f_inode;
+  FAR struct uart_bth4_s *dev = inode->i_private;
+
+  if (!dev->drv->ioctl)
+    {
+      return -ENOTTY;
+    }
+
+  return dev->drv->ioctl(dev->drv, cmd, arg);

Review Comment:
   Optional
   ```suggestion
     if (dev->drv->ioctl)
       {
         return dev->drv->ioctl(dev->drv, cmd, arg);
       }
   
     return -ENOTTY;
   ```



-- 
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-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org