diff options
author | Bernd Porr <mail@berndporr.me.uk> | 2014-01-07 21:43:10 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-09 10:51:54 -0800 |
commit | 7a45ae6edf808821a9799eccd9043177463aa05f (patch) | |
tree | 905e4ad259cbf1cf534c88ecdeba388d1e238053 /drivers | |
parent | bcb6232d090c82e41d6bce9474e031bfd948fcdb (diff) | |
download | linux-7a45ae6edf808821a9799eccd9043177463aa05f.tar.bz2 |
staging: comedi: usbduxsigma: return failure of auto attach
The function usbduxsigma_getstatusinfo() returns a negative
value in case there has been a communication error with
the board. This should always work and if this communication
fails then there is something seriously wrong with the board.
This is now returned to the caller so that it can
terminte the auto attachement. The return command also prevents
printing out the offset value in case of a fault.
Signed-off-by: Bernd Porr <mail@berndporr.me.uk>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/comedi/drivers/usbduxsigma.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c index 194c686c5a42..ff521b3a07d0 100644 --- a/drivers/staging/comedi/drivers/usbduxsigma.c +++ b/drivers/staging/comedi/drivers/usbduxsigma.c @@ -1655,9 +1655,11 @@ static int usbduxsigma_auto_attach(struct comedi_device *dev, } offset = usbduxsigma_getstatusinfo(dev, 0); - if (offset < 0) + if (offset < 0) { dev_err(dev->class_dev, - "Communication to USBDUXSIGMA failed! Check firmware and cabling\n"); + "Communication to USBDUXSIGMA failed! Check firmware and cabling.\n"); + return offset; + } dev_info(dev->class_dev, "attached, ADC_zero = %x\n", offset); |