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

Commit 9b13bc1d authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: ii_pci20kc: use comedi_dio_update_state()



The extra mask used to only update the channels configured as outputs is
not necessary in this driver. Remove it and use comedi_dio_update_state()
to handle the boilerplate code to update the subdevice s->state.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ca5d4a20
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -378,13 +378,10 @@ static int ii20k_dio_insn_bits(struct comedi_device *dev,
			       unsigned int *data)
{
	struct ii20k_private *devpriv = dev->private;
	unsigned int mask = data[0] & s->io_bits;	/* outputs only */
	unsigned int bits = data[1];
	unsigned int mask;

	mask = comedi_dio_update_state(s, data);
	if (mask) {
		s->state &= ~mask;
		s->state |= (bits & mask);

		if (mask & 0x000000ff)
			writeb((s->state >> 0) & 0xff,
			       devpriv->ioaddr + II20K_DIO0_REG);