diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2007-08-15 14:41:57 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-09 22:05:16 -0300 |
commit | 6a59d64c5cc302e0139ddb1f5e57afceecb14368 (patch) | |
tree | e3a14e27b5aca04a4069797893d59df7bc0f8f65 /drivers/media/video/cx88/cx88.h | |
parent | b09a79f5848f2143a8ffc724910743027d5a70e0 (diff) |
V4L/DVB (6021): cx88: Copy board information into card state
The cx88 driver state stored the ID of the board type in core->board. Every
time the driver need to get some information about the board configuration, it
uses the board number as an index into board configuration array.
This patch changes it so that the board number is in core->boardnr, and
core->board is a copy of the board configuration information. This allows
access to board information without the extra indirection. e.g.
cx88_boards[core->board].mpeg becomes core->board.mpeg.
This has a number of advantages:
- The code is simpler to write.
- It compiles to be smaller and faster, without needing the extra array lookup
to get at the board information.
- The cx88_boards array no longer needs to be exported to all cx88 modules.
- The boards array can be made const
- It should be possible to avoid keeping the (large) cx88_boards array around
after the module is loaded.
- If module parameters or eeprom info override some board configuration
setting, it's not necessary to modify the boards array, which would
affect all boards of the same type.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx88/cx88.h')
-rw-r--r-- | drivers/media/video/cx88/cx88.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 78486f90327..3636ec26de5 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h @@ -250,7 +250,7 @@ struct cx88_subid { u32 card; }; -#define INPUT(nr) (&cx88_boards[core->board].input[nr]) +#define INPUT(nr) (core->board.input[nr]) /* ----------------------------------------------------------- */ /* device / file handle status */ @@ -304,13 +304,8 @@ struct cx88_core { u32 i2c_state, i2c_rc; /* config info -- analog */ - unsigned int board; - unsigned int tuner_type; - unsigned int radio_type; - unsigned char tuner_addr; - unsigned char radio_addr; - unsigned int tda9887_conf; - unsigned int has_radio; + unsigned int boardnr; + struct cx88_board board; /* Supported V4L _STD_ tuner formats */ unsigned int tuner_formats; @@ -585,7 +580,7 @@ extern void cx88_call_i2c_clients(struct cx88_core *core, /* ----------------------------------------------------------- */ /* cx88-cards.c */ -extern struct cx88_board cx88_boards[]; +extern const struct cx88_board cx88_boards[]; extern const unsigned int cx88_bcount; extern struct cx88_subid cx88_subids[]; |