Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353944
b: refs/heads/master
c: c098c21
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 7, 2013
1 parent 0858e0b commit 7acc568
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ade1764ff5f03bea4bc848de5e6d3db0758ff15a
refs/heads/master: c098c21a9d32f1cd828f23e617cb55909c75e7e2
19 changes: 11 additions & 8 deletions trunk/drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,13 @@ bool comedi_is_subdevice_running(struct comedi_subdevice *s)
}
EXPORT_SYMBOL_GPL(comedi_is_subdevice_running);

static bool comedi_is_subdevice_in_error(struct comedi_subdevice *s)
{
unsigned runflags = comedi_get_subdevice_runflags(s);

return (runflags & SRF_ERROR) ? true : false;
}

/*
This function restores a subdevice to an idle state.
*/
Expand Down Expand Up @@ -1908,12 +1915,10 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,

if (!comedi_is_subdevice_running(s)) {
if (count == 0) {
if (comedi_get_subdevice_runflags(s) &
SRF_ERROR) {
if (comedi_is_subdevice_in_error(s))
retval = -EPIPE;
} else {
else
retval = 0;
}
do_become_nonbusy(dev, s);
}
break;
Expand Down Expand Up @@ -2015,12 +2020,10 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
if (n == 0) {
if (!comedi_is_subdevice_running(s)) {
do_become_nonbusy(dev, s);
if (comedi_get_subdevice_runflags(s) &
SRF_ERROR) {
if (comedi_is_subdevice_in_error(s))
retval = -EPIPE;
} else {
else
retval = 0;
}
break;
}
if (file->f_flags & O_NONBLOCK) {
Expand Down

0 comments on commit 7acc568

Please sign in to comment.