From 8161d6f6eb9d3682ea6c774f3de62563e429da33 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Wed, 5 Mar 2008 14:14:01 +0000 Subject: [PATCH] Set SDF_CMD_READ subdevice flag if do_cmd and do_cmdtest are set. Only set read_subdev if do_cmd and do_cmdtest are set. Don't set write_subdev as no subdevice supports write commands. --- comedi/drivers/pcl818.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comedi/drivers/pcl818.c b/comedi/drivers/pcl818.c index 263dc6a1..62595dd1 100644 --- a/comedi/drivers/pcl818.c +++ b/comedi/drivers/pcl818.c @@ -1829,7 +1829,6 @@ static int pcl818_attach(comedi_device * dev, comedi_devconfig * it) if (!this_board->n_aichan_se) { s->type = COMEDI_SUBD_UNUSED; } else { - dev->read_subdev = s; s->type = COMEDI_SUBD_AI; devpriv->sub_ai = s; s->subdev_flags = SDF_READABLE; @@ -1848,6 +1847,8 @@ static int pcl818_attach(comedi_device * dev, comedi_devconfig * it) s->cancel = pcl818_ai_cancel; s->insn_read = pcl818_ai_insn_read; if ((irq) || (devpriv->dma_rtc)) { + dev->read_subdev = s; + s->subdev_flags |= SDF_CMD_READ; s->do_cmdtest = ai_cmdtest; s->do_cmd = ai_cmd; } @@ -1894,7 +1895,6 @@ static int pcl818_attach(comedi_device * dev, comedi_devconfig * it) if (!this_board->n_aochan) { s->type = COMEDI_SUBD_UNUSED; } else { - dev->write_subdev = s; s->type = COMEDI_SUBD_AO; s->subdev_flags = SDF_WRITABLE | SDF_GROUND; s->n_chan = this_board->n_aochan; -- 2.26.2