diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2015-10-14 00:47:51 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-17 06:20:10 (GMT) |
commit | 873524c8517cf0986768685358d124aae7f7e495 (patch) | |
tree | a74885ab4bf417beec758a9a24d0fb9024a9d976 /drivers | |
parent | 2d71464fd137d4a830dddfc799de8158e9ddc97c (diff) | |
download | linux-873524c8517cf0986768685358d124aae7f7e495.tar.xz |
staging: comedi: cb_pcidas: tidy up cb_pcidas_trimpot_write()
All the boards supported by this driver have an AD7376 or AD8402
trimpot. Replace the switch () with and if () and remove the
unreachable dev_err() noise.
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')
-rw-r--r-- | drivers/staging/comedi/drivers/cb_pcidas.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c index f22611b..2c6ef6e 100644 --- a/drivers/staging/comedi/drivers/cb_pcidas.c +++ b/drivers/staging/comedi/drivers/cb_pcidas.c @@ -634,18 +634,12 @@ static void cb_pcidas_trimpot_write(struct comedi_device *dev, { const struct cb_pcidas_board *board = dev->board_ptr; - switch (board->trimpot) { - case AD7376: + if (board->trimpot == AD7376) { /* write 7-bit value to trimpot */ cb_pcidas_calib_write(dev, val, 7, true); - break; - case AD8402: + } else { /* AD8402 */ /* write 10-bit channel/value to trimpot */ cb_pcidas_calib_write(dev, (chan << 8) | val, 10, true); - break; - default: - dev_err(dev->class_dev, "driver bug?\n"); - break; } } |