diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2010-05-19 14:10:00 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-17 13:28:56 -0700 |
commit | 3c17ba0743d75f9888d905ddf9f8551c7dd36493 (patch) | |
tree | c473b48f9b5bbf9010c4d4479cebcc7cc21b03eb /drivers/staging/comedi/comedidev.h | |
parent | 3d34023a99d35440d6a22fb0b4547fc9817b7b40 (diff) |
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>
Diffstat (limited to 'drivers/staging/comedi/comedidev.h')
-rw-r--r-- | drivers/staging/comedi/comedidev.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index 4eb2b77f56dc..41ef9207f99c 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -285,7 +285,7 @@ struct comedi_device { struct fasync_struct *async_queue; - void (*open) (struct comedi_device *dev); + int (*open) (struct comedi_device *dev); void (*close) (struct comedi_device *dev); }; |