OSDN Git Service

staging: comedi: usbdux: push usb (*probe) into comedi (*auto_attach)
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 24 Jul 2013 21:08:24 +0000 (14:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2013 20:15:25 +0000 (13:15 -0700)
commitef1ee8cf126a84f5049c6dbf5dc3a350fdc84262
treebbc8c0057a20df6cad4fe1cd12e204dfde6f5c4e
parenta7dd65f57cc4bf07c3bcfb798577e275186a9c6f
staging: comedi: usbdux: push usb (*probe) into comedi (*auto_attach)

The usb_driver (*probe) calls comedi_usb_auto_config() after finding a
free slot for the static private data and doind some initial allocation
and setup. The comedi_usb_auto_config() will then call the comedi_driver
(*auto_attach).

Move all the probe/auto_attach into the comedi_driver and just have the
usb_driver call comedi_usb_auto_config(). This allows the comedi_driver
to allocate the private data and removes the need for the static array
and the semaphore that protects it.

Since all the probe/auto_attach is now handled by the comedi_driver, we
can also remove the 'attached' and 'probed' information from the private
data. The subdevice functions will only be hooked up if the usb device
has been probed and the comedi device is attached.

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