staging: comedi: amplc_dio200: Simplify PCI board look-up
authorIan Abbott <abbotti@mev.co.uk>
Mon, 18 Mar 2013 17:19:00 +0000 (17:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 18:30:05 +0000 (11:30 -0700)
commit470cf7261ae7a323d4657bad9d38eb36ddd2c1a2
treeaa3b7c673b060044248f01adfdf484e2ec56c6ab
parent3c6b670d4fa1c811f80a11aa4a3b68ea257a7179
staging: comedi: amplc_dio200: Simplify PCI board look-up

Set the `driver_data` member of each element (apart from the sentinel)
of our PCI device table `dio200_pci_table[]` to the index of the
corresponding element of our private PCI board details
`dio200_pci_boards[]`.  This index appears in the context parameter of
our auto_attach routine `dio200_auto_attach()`.  In this function,
nename the parameter to `context_model` and use it to set
`dev->board_ptr` to point to an element of `dio200_pci_boards[] directly
by index instead of calling `dio200_find_pci_board()` to search for the
element whose `devid` member matches the PCI device ID.

Remove `dio200_find_pci_board()` and the `devid` member of `struct
dio200_board`.  Also remove the `model` member of `struct dio200_board`
and the `enum dio200_model` type as we can do without them.  The only
function that uses the `model` member is `dio200_auto_attach()`, so use
the `context_model` parameter instead.

Define the enumerated value for each PCI board in new type `enum
dio200_pci_model` which replaces `enum dio200_model` minus the
enumerated values for the ISA boards (so the numeric values for the PCI
boards have changed).  Use these enumerated values to designate the
initializer for each element of `dio200_pci_boards[]`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/amplc_dio200.c
This page took 0.026211 seconds and 5 git commands to generate.