[PATCH] comedi: Change error return code for if statement in the function, cb_pcimdas_ai_rinsn

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This changes us using the incorrect error,-ETIMEOUT when checking if
the channel we are allocating to on the device structure pointer passed 
to this function is greater then the maximum available channels for this 
device to the correct error for a channel being out of range,-ECHRNG.

Signed-off-by: Nicholas Krause <xerofoify@xxxxxxxxx>
---
 drivers/staging/comedi/drivers/cb_pcimdas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcimdas.c b/drivers/staging/comedi/drivers/cb_pcimdas.c
index 70dd2c9..d91a6f3 100644
--- a/drivers/staging/comedi/drivers/cb_pcimdas.c
+++ b/drivers/staging/comedi/drivers/cb_pcimdas.c
@@ -121,7 +121,7 @@ static int cb_pcimdas_ai_rinsn(struct comedi_device *dev,
 		maxchans = s->n_chan;
 
 	if (chan > (maxchans - 1))
-		return -ETIMEDOUT;	/* *** Wrong error code. Fixme. */
+		return -ECHRNG;
 
 	/* configure for sw initiated read */
 	d = inb(devpriv->BADR3 + 5);
-- 
2.1.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux