[PATCH 08/23] staging: comedi: me_daq: remove {ao, ai}_resoultion_mask

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

 



These values can be determined from the {ao,ai}_resolution.

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

diff --git a/drivers/staging/comedi/drivers/me_daq.c b/drivers/staging/comedi/drivers/me_daq.c
index 7fd9400..f14907e 100644
--- a/drivers/staging/comedi/drivers/me_daq.c
+++ b/drivers/staging/comedi/drivers/me_daq.c
@@ -178,11 +178,9 @@ struct me_board {
 	int device_id;
 	int ao_channel_nbr;	/* DA config */
 	int ao_resolution;
-	int ao_resolution_mask;
 	const struct comedi_lrange *ao_range_list;
 	int ai_channel_nbr;	/* AD config */
 	int ai_resolution;
-	int ai_resolution_mask;
 	const struct comedi_lrange *ai_range_list;
 	int dio_channel_nbr;	/* DIO config */
 };
@@ -194,12 +192,10 @@ static const struct me_board me_boards[] = {
 	 /* Analog Output */
 	 .ao_channel_nbr = 4,
 	 .ao_resolution = 12,
-	 .ao_resolution_mask = 0x0fff,
 	 .ao_range_list = &me2600_ao_range,
 	 .ai_channel_nbr = 16,
 	 /* Analog Input */
 	 .ai_resolution = 12,
-	 .ai_resolution_mask = 0x0fff,
 	 .ai_range_list = &me2600_ai_range,
 	 .dio_channel_nbr = 32,
 	 },
@@ -209,7 +205,6 @@ static const struct me_board me_boards[] = {
 	 .ai_channel_nbr = 16,
 	 /* Analog Input */
 	 .ai_resolution = 12,
-	 .ai_resolution_mask = 0x0fff,
 	 .ai_range_list = &me2000_ai_range,
 	 .dio_channel_nbr = 32,
 	 }
@@ -721,7 +716,7 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
 	s->type = COMEDI_SUBD_AI;
 	s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_CMD_READ;
 	s->n_chan = board->ai_channel_nbr;
-	s->maxdata = board->ai_resolution_mask;
+	s->maxdata = (1 << board->ai_resolution) - 1;
 	s->len_chanlist = board->ai_channel_nbr;
 	s->range_table = board->ai_range_list;
 	s->cancel = me_ai_cancel;
@@ -734,7 +729,7 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
 		s->type = COMEDI_SUBD_AO;
 		s->subdev_flags = SDF_WRITEABLE | SDF_COMMON;
 		s->n_chan = board->ao_channel_nbr;
-		s->maxdata = board->ao_resolution_mask;
+		s->maxdata = (1 << board->ao_resolution) - 1;
 		s->len_chanlist = board->ao_channel_nbr;
 		s->range_table = board->ao_range_list;
 		s->insn_read = me_ao_insn_read;
-- 
1.7.11

_______________________________________________
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