Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b08ad665 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman
Browse files

staging: comedi: cb_pcimdas: fix handlers for DI and DO subdevices



Normally, low-level Comedi drivers set an `insn_bits` handler for
digital input (DI), digital output (DO) and digital input/output (DIO)
subdevice types to handle normal reading and writing of digital
channels.  The "cb_pcimdas" driver currently has an `insn_read` handler
for the DI subdevice and an `insn_write` handler for the DO subdevice.
However, the actual handler functions `cb_pcimdas_di_insn_read()` and
`cb_pcimdas_do_insn_write()` are written to behave like `insn_bits`
handlers.  Something's wrong there!  To fix it, set the functions as
`insn_bits` handlers and rename them for consistency.

Fixes: e56d03de ("staging: comedi: cb_pcimdas: add main connector digital input/output")
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4f3ca893
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ static int cb_pcimdas_ao_insn_write(struct comedi_device *dev,
	return insn->n;
}

static int cb_pcimdas_di_insn_read(struct comedi_device *dev,
static int cb_pcimdas_di_insn_bits(struct comedi_device *dev,
				   struct comedi_subdevice *s,
				   struct comedi_insn *insn,
				   unsigned int *data)
@@ -258,7 +258,7 @@ static int cb_pcimdas_di_insn_read(struct comedi_device *dev,
	return insn->n;
}

static int cb_pcimdas_do_insn_write(struct comedi_device *dev,
static int cb_pcimdas_do_insn_bits(struct comedi_device *dev,
				    struct comedi_subdevice *s,
				    struct comedi_insn *insn,
				    unsigned int *data)
@@ -424,7 +424,7 @@ static int cb_pcimdas_auto_attach(struct comedi_device *dev,
	s->n_chan	= 4;
	s->maxdata	= 1;
	s->range_table	= &range_digital;
	s->insn_read	= cb_pcimdas_di_insn_read;
	s->insn_bits	= cb_pcimdas_di_insn_bits;

	/* Digital Output subdevice (main connector) */
	s = &dev->subdevices[4];
@@ -433,7 +433,7 @@ static int cb_pcimdas_auto_attach(struct comedi_device *dev,
	s->n_chan	= 4;
	s->maxdata	= 1;
	s->range_table	= &range_digital;
	s->insn_write	= cb_pcimdas_do_insn_write;
	s->insn_bits	= cb_pcimdas_do_insn_bits;

	/* Counter subdevice (8254) */
	s = &dev->subdevices[5];