提交 7a45ae6e 编写于 作者: B Bernd Porr 提交者: Greg Kroah-Hartman

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: NBernd Porr <mail@berndporr.me.uk>
Reviewed-by: NIan Abbott <abbotti@mev.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 bcb6232d
...@@ -1655,9 +1655,11 @@ static int usbduxsigma_auto_attach(struct comedi_device *dev, ...@@ -1655,9 +1655,11 @@ static int usbduxsigma_auto_attach(struct comedi_device *dev,
} }
offset = usbduxsigma_getstatusinfo(dev, 0); offset = usbduxsigma_getstatusinfo(dev, 0);
if (offset < 0) if (offset < 0) {
dev_err(dev->class_dev, 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); dev_info(dev->class_dev, "attached, ADC_zero = %x\n", offset);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册