提交 873524c8 编写于 作者: H H Hartley Sweeten 提交者: Greg Kroah-Hartman

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: NH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: NIan Abbott <abbotti@mev.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2d71464f
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册