]> git.openfabrics.org - ~emulex/infiniband.git/commit
staging: comedi: dt9812: remove attaching by serial number
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 14 May 2013 21:22:11 +0000 (14:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2013 23:25:54 +0000 (16:25 -0700)
commit1415003fe6015575ed00f85bacd948b93d7ca78c
tree572dd60af9ab15b07147788e50a4b75fd0cd2bdc
parent98c83cfac3a6c410497ac16a88e1424e0a57e265
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>
drivers/staging/comedi/drivers/dt9812.c