]> git.karo-electronics.de Git - linux-beck.git/commit
staging: comedi: amplc_pc236: don't check bus type in attach
authorIan Abbott <abbotti@mev.co.uk>
Fri, 25 Jul 2014 09:04:55 +0000 (10:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Jul 2014 18:28:38 +0000 (11:28 -0700)
commitffe2d9fd49af6461972201eeaa8012e71fe40c97
tree36999c98676ef07526d81c89c48aa2796623daf5
parent22c39196b661c8569d92db50459dfa3a3afd4335
staging: comedi: amplc_pc236: don't check bus type in attach

Since the legacy attach routine `pc236_attach()` is only called for
board names matching an entry in our array of ISA boards
`pc236_isa_boards[]`, and it is reasonable to expect all elements of
`pc236_isa_boards[]` to have their `bustype` member initialized
correctly to `isa_bustype`, don't bother checking the bus type in
`pc236_attach()`.  Add `if (!DO_ISA) return -EINVAL` to optimize out the
remainder of the function if `CONFIG_COMEDI_AMPLC_PC236_ISA` is not
defined.

Similarly, don't bother checking the bus type in
`pc236_find_pci_board()` as it is reasonable to expect all elements of
`pc236_pci_boards[]` to have their `bustype` member initialized
correctly to `pci_bustype`.

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/amplc_pc236.c