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)
commit3c17ba0743d75f9888d905ddf9f8551c7dd36493
treec473b48f9b5bbf9010c4d4479cebcc7cc21b03eb
parent3d34023a99d35440d6a22fb0b4547fc9817b7b40
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