SAM3/4: Fix error serial TERMIOS ioctl handling

This commit is contained in:
Gregory Nutt 2014-10-30 12:23:15 -06:00
parent 274002a8e1
commit 87ee3f2fc7
2 changed files with 4 additions and 3 deletions

View File

@ -1118,7 +1118,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
/* Decode number of bits */ /* Decode number of bits */
switch (priv->bits) switch (termiosp->c_cflag & CSIZE)
{ {
case CS5: case CS5:
nbits = 5; nbits = 5;
@ -1147,7 +1147,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
/* Decode parity */ /* Decode parity */
if (termiosp->c_cflag & PARENB) if ((termiosp->c_cflag & PARENB) != 0)
{ {
parity = (termiosp->c_cflag & PARODD) ? 1 : 2; parity = (termiosp->c_cflag & PARODD) ? 1 : 2;
} }
@ -1183,7 +1183,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
* implement TCSADRAIN / TCSAFLUSH * implement TCSADRAIN / TCSAFLUSH
*/ */
up_setup(dev); ret = up_setup(dev);
} }
} }
break; break;

View File

@ -118,5 +118,6 @@ int tcsetattr(int fd, int options, FAR const struct termios *termiosp)
{ {
return ioctl(fd, TCSETS, (unsigned long)termiosp); return ioctl(fd, TCSETS, (unsigned long)termiosp);
} }
return -ENOSYS; return -ENOSYS;
} }