staging: comedi: simplify comedi_board_minor_table[]
authorIan Abbott <abbotti@mev.co.uk>
Thu, 4 Apr 2013 13:59:16 +0000 (14:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2013 21:33:21 +0000 (14:33 -0700)
commitcb6b79dedb5e57a51761d5d08540b5e1127df571
treec06b28d3d172ba9568c8c14eb8524da57c6236df
parentbd5b4173d50af86798d98b147321a92cf3a0a8ec
staging: comedi: simplify comedi_board_minor_table[]

`comedi_alloc_board_minor()` allocates and initializes a `struct
comedi_file_info` and a `struct comedi_device`, and assigns a board
minor device number (if there are any available), storing a pointer to
the allocated `struct comedi_file_info` in
`comedi_board_minor_table[minor]` where `minor` is the board minor
device number.

There is no longer anything useful in the `struct comedi_file_info`
apart from the pointer to the `struct comedi_device` that was allocated,
so the `struct comedi_file_info` is superfluous.

Change `comedi_board_minor_table[]` to hold pointers to the actual
`struct comedi_device`'s.  `comedi_alloc_board_minor()` no longer needs
to allocate a `struct comedi_file_info`.  Replace
`comedi_free_board_file_info()` with `comedi_free_board_dev()` with its
parameter pointing to the `struct comedi_device` to be freed (there is
no longer a `struct comedi_file_info` to be freed).

There are consequential changes to `comedi_dev_from_board_minor()`,
`comedi_clear_board_minor()` (which now returns a `struct comedi_device
*`), `comedi_free_board_minor()`, `comedi_release_hardware_device()` and
`comedi_unlocked_ioctl()` (when dealing with detachment of a dynamically
allocated comedi device by the `COMEDI_DEVCONFIG` ioctl).

`comedi_dev_from_file_info()` is no longer used as a result of the above
changes so remove it.

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