staging: comedi: amplc_dio200: don't check bus type in attach
authorIan Abbott <abbotti@mev.co.uk>
Mon, 18 Mar 2013 17:18:59 +0000 (17:18 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 18:30:05 +0000 (11:30 -0700)
commit3c6b670d4fa1c811f80a11aa4a3b68ea257a7179
treebdf357885c0576b5fce9c536c4d43f05a6b959f6
parent3d9bfccd13252efffbe2f31e8e66cecfd9e6cc65
staging: comedi: amplc_dio200: don't check bus type in attach

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

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

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