From: H Hartley Sweeten Date: Fri, 30 Aug 2013 18:10:01 +0000 (-0700) Subject: staging: comedi: ii_pci20kc: use comedi_dio_update_state() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9b13bc1d4ab0c5abc1b29d4fa95a41bf02238d2a;p=openwrt%2Fstaging%2Fblogic.git 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: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c b/drivers/staging/comedi/drivers/ii_pci20kc.c index 5c3a318b4640..8577778441fa 100644 --- a/drivers/staging/comedi/drivers/ii_pci20kc.c +++ b/drivers/staging/comedi/drivers/ii_pci20kc.c @@ -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);