staging: comedi: dt9812: remove attaching by serial number
Currently this driver supports attaching 16 usb devices to 16
comedi devices. The user can pass the 32-bit serial number of
the usb device when attaching to force a comedi device to attach
to a specific usb device.
It's also possible to attach a comedi device without having an
attached usb device. When the device is first opened the
comedi_device (*open) function in this driver then checks to
see if a usb device has been attached. If so the subdevice
information is updated based on the usb device and the comedi
device is then operational. If a usb device is not attached
the (*open) returns -ENODEV.
To simplify converting this driver to the comedi (*auto_attach)
mechanism, remove the attaching by serial number option.
Modify the usb (*probe) so that the first available slot is used.
If all the slots are used return -ENODEV.
Modify the comedi (*attach) so that the first unused slot that
has an attached usb device is used. If all the slots are used
return -ENODEV.
Since this ensures that the comedi device has an attached usb
device, remove the (*open) function and fully initialize the
subdevices during the (*attach).
Fix the comedi (*detach) so that the slot is made available
after detaching.
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>