]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: return error on "write" if no command set up
authorIan Abbott <abbotti@mev.co.uk>
Wed, 18 Nov 2015 17:55:09 +0000 (17:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Dec 2015 23:58:54 +0000 (15:58 -0800)
commit39a1d8aab3f1360588e59d51cb943747c1c5cad1
tree779e97ea7e0188c9418f959f3dc4780b5c1f9ddd
parent80a3feeba91faccba59320f8c3f2a6e755386d05
staging: comedi: return error on "write" if no command set up

The "write" file operation handler, `comedi_write()` returns an error
for pretty much any condition that prevents a "write" going ahead.  One
of the conditions that prevents a "write" going ahead is that no
asynchronous command has been set up, but that currently results in a
return value of 0 (unless COMEDI instructions are being processed or an
asynchronous command has been set up by a different file object).
Change it to return `-EINVAL` in this case.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedi_fops.c