staging: comedi: gsc_hpdi: remove multiple board type support
authorIan Abbott <abbotti@mev.co.uk>
Tue, 5 May 2015 17:47:25 +0000 (18:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2015 12:57:26 +0000 (14:57 +0200)
commite899a4165cffe3aa802f813c624e90ce7ca23189
tree4130e598d6099cff385a88aeff03920e1c4ce20e
parentdc05a7d70b824cbe26f00914e5f94e0b68d5aeda
staging: comedi: gsc_hpdi: remove multiple board type support

The code for determining which board type matches the PCI device ID is
over-the-top since only a single board type is supported.  Also, the
method it uses match the PCI device ID to a board type is a little
antiquated.  Most comedi drivers for PCI devices use `driver_data` from
the probed PCI device as an index into an array of supported board
types, but "gsc_hpdi" uses a `for` loop to find an element of
`hpdi_boards[]` that matches the PCI device.  The only thing in
`hpdi_boards[]` not used for finding a matching PCI device is the `name`
member of `struct hpdi_board` which points to a string literal and ends
up getting assigned to `dev->board_name`.

Get rid of the multiple board type support, and set `dev->board_name` to
point to the original string literal pointed to by
`hpdi_boards[0].name`.  This string is visible to userspace.

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/drivers/gsc_hpdi.c