[PATCH 07/11] staging: comedi: pcmad: change boardinfo 'n_ai_bits' to 'ai_maxdata'

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

 



This information is only used to set the subdevice 'maxdata'. Change
it so the calculation is not needed.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/pcmad.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcmad.c b/drivers/staging/comedi/drivers/pcmad.c
index 76799ce..94f50f6 100644
--- a/drivers/staging/comedi/drivers/pcmad.c
+++ b/drivers/staging/comedi/drivers/pcmad.c
@@ -50,16 +50,16 @@
 
 struct pcmad_board_struct {
 	const char *name;
-	int n_ai_bits;
+	unsigned int ai_maxdata;
 };
 
 static const struct pcmad_board_struct pcmad_boards[] = {
 	{
 		.name		= "pcmad12",
-		.n_ai_bits	= 12,
+		.ai_maxdata	= 0x0fff,
 	}, {
 		.name		= "pcmad16",
-		.n_ai_bits	= 16,
+		.ai_maxdata	= 0xffff,
 	},
 };
 
@@ -137,7 +137,7 @@ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	s->subdev_flags	= SDF_READABLE | AREF_GROUND;
 	s->n_chan	= 16;
 	s->len_chanlist	= 1;
-	s->maxdata	= (1 << board->n_ai_bits) - 1;
+	s->maxdata	= board->ai_maxdata;
 	s->range_table	= &range_unknown;
 	s->insn_read	= pcmad_ai_insn_read;
 
-- 
1.8.1.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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