diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-08-11 11:13:11 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-08-11 11:13:11 -0600 |
commit | 90d17e48b58e3fbffbe8b4d6b2476ba8bf23797d (patch) | |
tree | 21e4701e547f65027af8cd6d57c40708daa2a73e /nuttx/drivers/serial | |
parent | 6ed9d8e8b37324daa7b32667af750cc27c5558ee (diff) | |
download | px4-nuttx-90d17e48b58e3fbffbe8b4d6b2476ba8bf23797d.tar.gz px4-nuttx-90d17e48b58e3fbffbe8b4d6b2476ba8bf23797d.tar.bz2 px4-nuttx-90d17e48b58e3fbffbe8b4d6b2476ba8bf23797d.zip |
SAMA5: Some improvements to the HSCMI card removal/insertion logic
Diffstat (limited to 'nuttx/drivers/serial')
-rw-r--r-- | nuttx/drivers/serial/serial.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/nuttx/drivers/serial/serial.c b/nuttx/drivers/serial/serial.c index 690ae2efd..d452b6b4b 100644 --- a/nuttx/drivers/serial/serial.c +++ b/nuttx/drivers/serial/serial.c @@ -289,7 +289,8 @@ static int uart_putxmitchar(FAR uart_dev_t *dev, int ch, bool oktoblock) * Name: uart_irqwrite ************************************************************************************/ -static inline ssize_t uart_irqwrite(FAR uart_dev_t *dev, FAR const char *buffer, size_t buflen) +static inline ssize_t uart_irqwrite(FAR uart_dev_t *dev, FAR const char *buffer, + size_t buflen) { ssize_t ret = buflen; @@ -321,9 +322,9 @@ static inline ssize_t uart_irqwrite(FAR uart_dev_t *dev, FAR const char *buffer, static ssize_t uart_write(FAR struct file *filep, FAR const char *buffer, size_t buflen) { - FAR struct inode *inode = filep->f_inode; - FAR uart_dev_t *dev = inode->i_private; - ssize_t nread = buflen; + FAR struct inode *inode = filep->f_inode; + FAR uart_dev_t *dev = inode->i_private; + ssize_t nwritten = buflen; bool oktoblock; int ret; char ch; @@ -473,13 +474,13 @@ static ssize_t uart_write(FAR struct file *filep, FAR const char *buffer, * interrupted transfer. */ - if (buflen < nread) + if (buflen < nwritten) { /* Some data was transferred. Return the number of bytes that * were successfully transferred. */ - nread -= buflen; + nwritten -= buflen; } else { @@ -487,7 +488,7 @@ static ssize_t uart_write(FAR struct file *filep, FAR const char *buffer, * The VFS layer will set the errno value appropriately). */ - nread = ret; + nwritten = ret; } break; @@ -500,7 +501,7 @@ static ssize_t uart_write(FAR struct file *filep, FAR const char *buffer, } uart_givesem(&dev->xmit.sem); - return nread; + return nwritten; } /************************************************************************************ |