aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-vp3054-i2c.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-08-15 13:41:57 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:05:16 -0400
commit6a59d64c5cc302e0139ddb1f5e57afceecb14368 (patch)
treee3a14e27b5aca04a4069797893d59df7bc0f8f65 /drivers/media/video/cx88/cx88-vp3054-i2c.c
parentb09a79f5848f2143a8ffc724910743027d5a70e0 (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-vp3054-i2c.c')
-rw-r--r--drivers/media/video/cx88/cx88-vp3054-i2c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/cx88/cx88-vp3054-i2c.c b/drivers/media/video/cx88/cx88-vp3054-i2c.c
index cd0877636a32..f76ca9e2eebf 100644
--- a/drivers/media/video/cx88/cx88-vp3054-i2c.c
+++ b/drivers/media/video/cx88/cx88-vp3054-i2c.c
@@ -111,7 +111,7 @@ int vp3054_i2c_probe(struct cx8802_dev *dev)
111 struct vp3054_i2c_state *vp3054_i2c; 111 struct vp3054_i2c_state *vp3054_i2c;
112 int rc; 112 int rc;
113 113
114 if (core->board != CX88_BOARD_DNTV_LIVE_DVB_T_PRO) 114 if (core->boardnr != CX88_BOARD_DNTV_LIVE_DVB_T_PRO)
115 return 0; 115 return 0;
116 116
117 dev->card_priv = kzalloc(sizeof(*vp3054_i2c), GFP_KERNEL); 117 dev->card_priv = kzalloc(sizeof(*vp3054_i2c), GFP_KERNEL);
@@ -152,7 +152,7 @@ void vp3054_i2c_remove(struct cx8802_dev *dev)
152 struct vp3054_i2c_state *vp3054_i2c = dev->card_priv; 152 struct vp3054_i2c_state *vp3054_i2c = dev->card_priv;
153 153
154 if (vp3054_i2c == NULL || 154 if (vp3054_i2c == NULL ||
155 dev->core->board != CX88_BOARD_DNTV_LIVE_DVB_T_PRO) 155 dev->core->boardnr != CX88_BOARD_DNTV_LIVE_DVB_T_PRO)
156 return; 156 return;
157 157
158 i2c_del_adapter(&vp3054_i2c->adap); 158 i2c_del_adapter(&vp3054_i2c->adap);