提交 06bda66b 编写于 作者: E Eli Billauer 提交者: Greg Kroah-Hartman

staging: xillybus: EAGAIN status handling improvement

The -EAGAIN status is passed through an "rc" variable instead of a less
common flow.
Suggested-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NEli Billauer <eli.billauer@gmail.com>
Reviewed-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 5b09fc96
......@@ -833,7 +833,7 @@ static ssize_t xillybus_read(struct file *filp, char __user *userbuf,
if (ready)
goto desperate;
bytes_done = -EAGAIN;
rc = -EAGAIN;
break;
}
......@@ -995,6 +995,9 @@ static ssize_t xillybus_read(struct file *filp, char __user *userbuf,
if (channel->endpoint->fatal_error)
return -EIO;
if (rc)
return rc;
return bytes_done;
}
......@@ -1386,7 +1389,7 @@ static ssize_t xillybus_write(struct file *filp, const char __user *userbuf,
*/
if (filp->f_flags & O_NONBLOCK) {
bytes_done = -EAGAIN;
rc = -EAGAIN;
break;
}
......@@ -1412,6 +1415,12 @@ static ssize_t xillybus_write(struct file *filp, const char __user *userbuf,
&channel->rd_workitem,
XILLY_RX_TIMEOUT);
if (channel->endpoint->fatal_error)
return -EIO;
if (rc)
return rc;
if ((channel->rd_synchronous) && (bytes_done > 0)) {
rc = xillybus_myflush(filp->private_data, 0); /* No timeout */
......@@ -1419,9 +1428,6 @@ static ssize_t xillybus_write(struct file *filp, const char __user *userbuf,
return rc;
}
if (channel->endpoint->fatal_error)
return -EIO;
return bytes_done;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册