]> git.baikalelectronics.ru Git - kernel.git/commit
Staging: comedi: Allow 'open' driver method to fail
authorIan Abbott <abbotti@mev.co.uk>
Wed, 19 May 2010 13:10:00 +0000 (14:10 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Jun 2010 20:28:56 +0000 (13:28 -0700)
commite72273c0f3a2db2a5b300857a74a368c0f3ce47d
treec473b48f9b5bbf9010c4d4479cebcc7cc21b03eb
parentac97d96f0184ef1942b7d70ff6fbd3fff67ca058
Staging: comedi: Allow 'open' driver method to fail

Some comedi drivers should return an error from their 'open' method when
something goes wrong.  Change the prototype of the 'open' method in
'struct comedi_device' to allow this, and change the drivers that use it.
Propagate any error to the 'open' file operation.

The corresponding 'close' method won't be called when the 'open' method
fails, so drivers failing the 'open' need to clean up any mess they
created.

The dt9812 and serial2002 drivers can now return an error on 'open'.
The jr3_pci driver also uses the 'open' method but doesn't fail it.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/comedi/comedi_fops.c
drivers/staging/comedi/comedidev.h
drivers/staging/comedi/drivers/dt9812.c
drivers/staging/comedi/drivers/jr3_pci.c
drivers/staging/comedi/drivers/serial2002.c