Commit aa33122f authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: comedi_fops: send SIGIO according to command direction

`comedi_event()` is called from low-level drivers to handle comedi
asynchronous command event flags.  Some events cause waiting tasks to be
woken up, and a `SIGIO` signal to be sent via `kill_fasync()`.  The
signal code is `POLL_OUT` if the subdevice supports commands in the
"write" direction, or `POLL_IN` for the "read" direction.  If the
subdevice supports commands in either direction, it sends two `SIGIO`
signals, one with each code.  Change that latter case to only send one
`SIGIO` signal, using the direction of the current command to determine
the signal code.  If the `CMDF_WRITE` flag is set in the current
command, it's in the "write" direction, otherwise it's in the "read"
direction.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 922d9ced
......@@ -2674,11 +2674,11 @@ void comedi_event(struct comedi_device *dev, struct comedi_subdevice *s)
}
if (async->cb_mask & events) {
int si_code;
wake_up_interruptible(&async->wait_head);
if (s->subdev_flags & SDF_CMD_READ)
kill_fasync(&dev->async_queue, SIGIO, POLL_IN);
if (s->subdev_flags & SDF_CMD_WRITE)
kill_fasync(&dev->async_queue, SIGIO, POLL_OUT);
si_code = async->cmd.flags & CMDF_WRITE ? POLL_OUT : POLL_IN;
kill_fasync(&dev->async_queue, SIGIO, si_code);
}
}
EXPORT_SYMBOL_GPL(comedi_event);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment