You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2023/03/19 20:55:07 UTC

[nuttx] 02/03: usb/cdcacm: Remove the process for tc_iflag, tc_oflag and tc_lflag

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit d9a8d5f2ee070601754d22d230b001ef55ddb705
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Mar 20 00:16:33 2023 +0800

    usb/cdcacm: Remove the process for tc_iflag, tc_oflag and tc_lflag
    
    since the common code in serial.c already handle them correctly:
    https://github.com/apache/nuttx/blob/master/drivers/serial/serial.c#L1556-L1601
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 drivers/usbdev/cdcacm.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/usbdev/cdcacm.c b/drivers/usbdev/cdcacm.c
index 6df211a1ae..e096d3149b 100644
--- a/drivers/usbdev/cdcacm.c
+++ b/drivers/usbdev/cdcacm.c
@@ -2339,9 +2339,6 @@ static int cdcuart_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
 
         /* And update with flags from this layer */
 
-        termiosp->c_iflag = serdev->tc_iflag;
-        termiosp->c_oflag = serdev->tc_oflag;
-        termiosp->c_lflag = serdev->tc_lflag;
         termiosp->c_cflag =
             ((priv->linecoding.parity != CDC_PARITY_NONE) ? PARENB : 0) |
             ((priv->linecoding.parity == CDC_PARITY_ODD) ? PARODD : 0) |
@@ -2358,10 +2355,10 @@ static int cdcuart_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
 
         termiosp->c_cflag |= (priv->iflow) ? CRTS_IFLOW : 0;
 #endif
-      cfsetispeed(termiosp, (speed_t) priv->linecoding.baud[3] << 24 |
-                            (speed_t) priv->linecoding.baud[2] << 16 |
-                            (speed_t) priv->linecoding.baud[1] << 8  |
-                            (speed_t) priv->linecoding.baud[0]);
+        cfsetispeed(termiosp, (speed_t) priv->linecoding.baud[3] << 24 |
+                              (speed_t) priv->linecoding.baud[2] << 16 |
+                              (speed_t) priv->linecoding.baud[1] << 8  |
+                              (speed_t) priv->linecoding.baud[0]);
       }
       break;
 
@@ -2380,10 +2377,6 @@ static int cdcuart_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
 
         /* Update the flags we keep at this layer */
 
-        serdev->tc_iflag = termiosp->c_iflag;
-        serdev->tc_oflag = termiosp->c_oflag;
-        serdev->tc_lflag = termiosp->c_lflag;
-
 #ifdef CONFIG_CDCACM_OFLOWCONTROL
         /* Handle changes to output flow control */