]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: addi_apci_3xxx: only allocate needed subdevices
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 12 Jun 2013 23:23:14 +0000 (16:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Jun 2013 21:33:56 +0000 (14:33 -0700)
commit441649808dae34a9dcaf3b6890c2a1cb399cf759
tree1d12a9dd9dd5136016a7f39b3d10b38845bdfd34
parentfacb26d4af3dc12b8f9d172c0f50d8fcf1cc65d2
staging: comedi: addi_apci_3xxx: only allocate needed subdevices

The number of subdevices needed by a given board supported by this
driver can cary from 2 (for the apci3500) to a maximum of 5. Currently
this driver always allocates 7 subdevices and sets the subdevice type
to COMEDI_SUBD_UNUSED for the ones that are not needed.

Calculate the actual number of needed subdevices from the boardinfo
and only allocate and setup the ones that are used.

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