summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2015-08-05 10:44:50 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-08-07 15:03:28 -0700
commit271f5aa04be0ff3d0c6fc8ccc31a6b0d3294461b (patch)
tree7305b1a9bea95d89baaf5284fb291109002f5e16 /drivers/staging/comedi
parent3674a87ebe73be57fe412b8906b0004c6372bac4 (diff)
downloadlinux-271f5aa04be0ff3d0c6fc8ccc31a6b0d3294461b.tar.bz2
staging: comedi: me4000: remove unnecessary ME4000_AI_LIST_INPUT_SINGLE_ENDED
This define evaluates to 0 and is OR'ed with the 'entry' value that is written to the ME4000_AI_CHANNEL_LIST_REG when the channel aref is a single-ended type (AREF_GROUND or AREF_COMMON). OR'ing a zero value is pretty silly, just remove it. Remove the switch() in me4000_ai_insn_read() to simplify the code. 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/me4000.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/staging/comedi/drivers/me4000.c b/drivers/staging/comedi/drivers/me4000.c
index 0a85ea5ccdca..ba3313c069d0 100644
--- a/drivers/staging/comedi/drivers/me4000.c
+++ b/drivers/staging/comedi/drivers/me4000.c
@@ -110,7 +110,6 @@ broken.
#define ME4000_AI_STATUS_BIT_FSM (1 << 29)
#define ME4000_AI_CTRL_BIT_EX_TRIG_BOTH (1 << 31)
#define ME4000_AI_CHANNEL_LIST_REG 0x78
-#define ME4000_AI_LIST_INPUT_SINGLE_ENDED (0 << 5)
#define ME4000_AI_LIST_INPUT_DIFFERENTIAL (1 << 5)
#define ME4000_AI_LIST_RANGE_BIPOLAR_10 (0 << 6)
#define ME4000_AI_LIST_RANGE_BIPOLAR_2_5 (1 << 6)
@@ -474,13 +473,8 @@ static int me4000_ai_insn_read(struct comedi_device *dev,
return -EINVAL;
}
- switch (aref) {
- case AREF_GROUND:
- case AREF_COMMON:
- entry |= ME4000_AI_LIST_INPUT_SINGLE_ENDED | chan;
- break;
-
- case AREF_DIFF:
+ entry |= chan;
+ if (aref == AREF_DIFF) {
if (!(s->subdev_flags && SDF_DIFF)) {
dev_err(dev->class_dev,
"Differential inputs are not available\n");
@@ -498,11 +492,7 @@ static int me4000_ai_insn_read(struct comedi_device *dev,
"Analog input is not available\n");
return -EINVAL;
}
- entry |= ME4000_AI_LIST_INPUT_DIFFERENTIAL | chan;
- break;
- default:
- dev_err(dev->class_dev, "Invalid aref specified\n");
- return -EINVAL;
+ entry |= ME4000_AI_LIST_INPUT_DIFFERENTIAL;
}
entry |= ME4000_AI_LIST_LAST_ENTRY;
@@ -703,8 +693,6 @@ static int ai_write_chanlist(struct comedi_device *dev,
if (aref == AREF_DIFF)
entry |= ME4000_AI_LIST_INPUT_DIFFERENTIAL;
- else
- entry |= ME4000_AI_LIST_INPUT_SINGLE_ENDED;
outl(entry, dev->iobase + ME4000_AI_CHANNEL_LIST_REG);
}