Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353935
b: refs/heads/master
c: 2714b01
h: refs/heads/master
i:
  353933: 6db9d69
  353931: c16a83f
  353927: 5673f4e
  353919: 1d28a6f
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 7, 2013
1 parent f990e98 commit 8d98c9f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 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: 5c87fef53cb338a919a18349facaf172c1f0cf75
refs/heads/master: 2714b019fd570309e9a4cab2b988cbb7a36bbecd
35 changes: 11 additions & 24 deletions trunk/drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1870,39 +1870,27 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
DECLARE_WAITQUEUE(wait, current);
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_file_info *info = comedi_file_info_from_minor(minor);
struct comedi_device *dev;
struct comedi_device *dev = comedi_dev_from_minor(minor);

if (info == NULL)
return -ENODEV;
dev = info->device;
if (dev == NULL)
if (!dev)
return -ENODEV;

if (!dev->attached) {
DPRINTK("no driver configured on comedi%i\n", dev->minor);
retval = -ENODEV;
goto done;
return -ENODEV;
}

s = comedi_write_subdevice(info);
if (s == NULL) {
retval = -EIO;
goto done;
}
if (!s)
return -EIO;

async = s->async;

if (!nbytes) {
retval = 0;
goto done;
}
if (!s->busy) {
retval = 0;
goto done;
}
if (s->busy != file) {
retval = -EACCES;
goto done;
}
if (!s->busy || !nbytes)
return 0;
if (s->busy != file)
return -EACCES;

add_wait_queue(&async->wait_head, &wait);
while (nbytes > 0 && !retval) {
set_current_state(TASK_INTERRUPTIBLE);
Expand Down Expand Up @@ -1967,7 +1955,6 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
set_current_state(TASK_RUNNING);
remove_wait_queue(&async->wait_head, &wait);

done:
return count ? count : retval;
}

Expand Down

0 comments on commit 8d98c9f

Please sign in to comment.