staging: comedi: pcmmio: unwind the digital i/o subdevice init
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 9 Dec 2013 22:31:04 +0000 (15:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2013 18:02:13 +0000 (10:02 -0800)
commit19e0bf12358e5914db07a9026135b5b37aa408ef
tree0dfaa94418cb39459471dc1d6c0e1caedbfe56ec
parent29947fd6310292ce81d1ea4e0b56978a4a921b19
staging: comedi: pcmmio: unwind the digital i/o subdevice init

The board supported by this driver only has one asic that provides the
two digital i/o subdevices. The first dio subdevice has 24 channels that
support interrupts. The second dio subdevice also has 24 channels but no
interrupt support.

To make the code clearer and easier to maintain, remove the for () loop
that initialized these subdevices.

Also, correctly initialize the interrupt subdevice. The current code does
not set the SDF_CMD_READ subdev_flag and does not set the dev->read_subdev
pointer in the comedi_device.

Use the dev->read_subdev pointer in the interrupt handler to get the
interrupt subdevice and private data pointer instead of searching for
them. To keep this patch reviewable, the extra indents in interrupt_pcmmio()
will be removed later.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/pcmmio.c