From: Ian Abbott Date: Mon, 18 Mar 2013 17:19:00 +0000 (+0000) Subject: staging: comedi: amplc_dio200: Simplify PCI board look-up X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~137^2~497 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=470cf7261ae7a323d4657bad9d38eb36ddd2c1a2;p=pandora-kernel.git 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 Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed