]> rtime.felk.cvut.cz Git - linux-imx.git/commit
staging: comedi: amplc_dio200: embed board layout in board structure
authorIan Abbott <abbotti@mev.co.uk>
Mon, 18 Mar 2013 17:19:01 +0000 (17:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 18:30:05 +0000 (11:30 -0700)
commitf7282f05e1cb39556b5e29d113803e934f3e6d3e
tree6b787f4dcee63edd46c38917f3077aafec1f8564
parent470cf7261ae7a323d4657bad9d38eb36ddd2c1a2
staging: comedi: amplc_dio200: embed board layout in board structure

The amplc_dio200 driver supports both ISA and PCI boards, some of which
are quite similar.  The driver takes advantage of this by defining a
"board layout" structure `struct dio200_layout` along with an array of
this structure `dio200_layouts[]` and an enumerated type for the indices
into this array `enum dio200_layout_idx`.  The main board information
structure `struct dio200_board` contains a `layout` member holding an
enumerated index into the array of layouts and the enumerated layout
values are used to designate the indices in the initializer of
`dio200_layouts[]`.

We would like to split the ISA and PCI support into separate driver
modules and having the shared layouts makes this slightly awkward as the
enumerated values are condionally present depending on whether the
driver is configured to support ISA, PCI, or both.

Embed the `struct dio200_layout` into the main board information
structure `struct dio200_board` to make things simpler, discarding
`dio200_layouts[]` and the `enum dio200_layout_idx` in the process.
Only two of the layouts were used by more than one board anyway (each of
which was used by one ISA and one PCI board).

While we're at it, change the `has_int_sce`, `has_clk_gat_sce` and
`has_enhancements` members of `struct dio200_layout` to `bool:1`
bit-fields to save a few bytes.

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