const unsigned minor = iminor(file->f_dentry->d_inode);
dev = comedi_get_device_by_minor(minor);
- mutex_lock(&dev->mutex);
if (!dev->attached) {
DPRINTK("no driver configured on comedi%i\n", dev->minor);
retval = -ENODEV;
retval = -ERESTARTSYS;
break;
}
- mutex_unlock(&dev->mutex);
schedule();
- mutex_lock(&dev->mutex);
if (!s->busy) {
break;
}
set_current_state(TASK_RUNNING);
remove_wait_queue(&async->wait_head, &wait);
- done:
- mutex_unlock(&dev->mutex);
+done:
return (count ? count : retval);
}
const unsigned minor = iminor(file->f_dentry->d_inode);
comedi_device *dev = comedi_get_device_by_minor(minor);
- mutex_lock(&dev->mutex);
if (!dev->attached) {
DPRINTK("no driver configured on comedi%i\n", dev->minor);
retval = -ENODEV;
retval = -ERESTARTSYS;
break;
}
- mutex_unlock(&dev->mutex);
schedule();
- mutex_lock(&dev->mutex);
if (!s->busy) {
retval = 0;
break;
set_current_state(TASK_RUNNING);
remove_wait_queue(&async->wait_head, &wait);
- done:
- mutex_unlock(&dev->mutex);
+done:
return (count ? count : retval);
}