summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-06-12 16:21:53 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-17 14:33:56 -0700
commit040540763b5729b99e24c118d4343f489a00b456 (patch)
tree57b8851f3acc41315117314488f6af1d39775794 /drivers/staging/comedi
parent8d4729066cde58c730573d6aad2ea29f8048fcb3 (diff)
downloadlinux-040540763b5729b99e24c118d4343f489a00b456.tar.bz2
staging: comedi: addi_apci_3xxx: remove 'b_SingleDiff' private data
The analog reference desired for the acquisition is stored in the insn->chanspec that is passed to the (*insn_read) function. There is no need to use a private data variable to hold the desired analog reference that is set in the (*insn_config). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c8
-rw-r--r--drivers/staging/comedi/drivers/addi_apci_3xxx.c4
2 files changed, 2 insertions, 10 deletions
diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c
index ce4c41fb5ef7..bea57235b287 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c
@@ -41,14 +41,10 @@ static int apci3xxx_ai_configure(struct comedi_device *dev,
{
const struct apci3xxx_boardinfo *board = comedi_board(dev);
struct apci3xxx_private *devpriv = dev->private;
- unsigned int aref_mode = data[1];
unsigned int time_base = data[2];
unsigned int reload_time = data[3];
unsigned int acq_ns;
- if (aref_mode != 0 && aref_mode != 1)
- return -EINVAL;
-
if (time_base > 2)
return -EINVAL;
@@ -80,7 +76,6 @@ static int apci3xxx_ai_configure(struct comedi_device *dev,
devpriv->ui_EocEosConversionTime = reload_time;
devpriv->b_EocEosConversionTimeBase = time_base;
- devpriv->b_SingelDiff = aref_mode;
/* Set the convert timing unit */
writel(time_base, devpriv->mmio + 36);
@@ -116,6 +111,7 @@ static int apci3xxx_ai_insn_read(struct comedi_device *dev,
struct apci3xxx_private *devpriv = dev->private;
unsigned int chan = CR_CHAN(insn->chanspec);
unsigned int range = CR_RANGE(insn->chanspec);
+ unsigned int aref = CR_AREF(insn->chanspec);
unsigned char use_interrupt = 0; /* FIXME: use interrupts */
unsigned int delay_mode;
unsigned int val;
@@ -139,7 +135,7 @@ static int apci3xxx_ai_insn_read(struct comedi_device *dev,
/* Make the configuration */
val = (range & 3) | ((range >> 2) << 6) |
- (devpriv->b_SingelDiff << 7);
+ ((aref == AREF_DIFF) << 7);
writel(val, devpriv->mmio + 0);
/* Channel selection */
diff --git a/drivers/staging/comedi/drivers/addi_apci_3xxx.c b/drivers/staging/comedi/drivers/addi_apci_3xxx.c
index bb62c871da9f..b724cf653080 100644
--- a/drivers/staging/comedi/drivers/addi_apci_3xxx.c
+++ b/drivers/staging/comedi/drivers/addi_apci_3xxx.c
@@ -356,7 +356,6 @@ struct apci3xxx_private {
unsigned char b_EocEosInterrupt;
unsigned int ui_EocEosConversionTime;
unsigned char b_EocEosConversionTimeBase;
- unsigned char b_SingelDiff;
};
#include "addi-data/hwdrv_apci3xxx.c"
@@ -611,9 +610,6 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
s->insn_config = apci3xxx_ai_insn_config;
s->insn_read = apci3xxx_ai_insn_read;
- if ((board->ai_subdev_flags & (SDF_COMMON | SDF_GROUND)) == 0)
- devpriv->b_SingelDiff = 1;
-
} else {
s->type = COMEDI_SUBD_UNUSED;
}