staging: comedi: usbduxfast: Move usb_driver (*probe) into comedi_driver
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 14 May 2013 20:30:09 +0000 (13:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2013 23:24:20 +0000 (16:24 -0700)
commit2d719c9cdbb08e90a090145c4ceacc1dbd6d869a
treea2902facea4b4932e8b4a9612e139f802ac4f8d1
parent0c4ab6715cf34293f40c8c80f361ca08d7cf1bc2
staging: comedi: usbduxfast: Move usb_driver (*probe) into comedi_driver

Currently, the usb_driver (*probe) locates a free place in the static
usbduxfast array to use for the private data in this driver. It then
does some initial setup of the usb device and allocates the buffers
needed. The firmware for the device is then requested and uploaded
before calling comedi_usb_auto_config() to allow the comedi core to
complete the (*auto_attach) of the device.

Move the bulk of the (*probe) into the comedi_driver (*auto_attach).
This allows the private data to be kzalloc'ed. We can then remove the
static array along with the semaphore that protected it.

This also removes the 16 attached devices limitation.

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