staging: comedi: ni_660x: remove enum ni_660x_subdevices
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 22 Mar 2016 18:10:27 +0000 (11:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
commit520e61915186e0538a8fc46e5e268a2000141545
tree8f8602fc93b60d9ed952b7012347f998f4bcb7d1
parent6d40805b0b4e4392e68fea0028edcafa5fcdc04a
staging: comedi: ni_660x: remove enum ni_660x_subdevices

Hard-coding the subdevice order is normally a bad idea. If a new subdevice
is added, or removed, it could potentially break pretty badly.

Remove the enum and associated NI_660X_GPCT_SUBDEV() helper that hard-code
the subdevice order.

Fix the (*auto_attach) so it initializes all the subdevices without depending
on the hard-coded order.

Change the interrupt handler so that all the counter subdevices are handled
without depending on the hard-coded order.

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/ni_660x.c