aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-dvb.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-dvb.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-dvb.c')
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 1773b40467dc..d98b90721019 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -378,7 +378,7 @@ static int dvb_register(struct cx8802_dev *dev)
378 dev->ts_gen_cntrl = 0x0c; 378 dev->ts_gen_cntrl = 0x0c;
379 379
380 /* init frontend */ 380 /* init frontend */
381 switch (dev->core->board) { 381 switch (dev->core->boardnr) {
382 case CX88_BOARD_HAUPPAUGE_DVB_T1: 382 case CX88_BOARD_HAUPPAUGE_DVB_T1:
383 dev->dvb.frontend = dvb_attach(cx22702_attach, 383 dev->dvb.frontend = dvb_attach(cx22702_attach,
384 &connexant_refboard_config, 384 &connexant_refboard_config,
@@ -653,7 +653,7 @@ static int cx8802_dvb_advise_acquire(struct cx8802_driver *drv)
653 int err = 0; 653 int err = 0;
654 dprintk( 1, "%s\n", __FUNCTION__); 654 dprintk( 1, "%s\n", __FUNCTION__);
655 655
656 switch (core->board) { 656 switch (core->boardnr) {
657 case CX88_BOARD_HAUPPAUGE_HVR1300: 657 case CX88_BOARD_HAUPPAUGE_HVR1300:
658 /* We arrive here with either the cx23416 or the cx22702 658 /* We arrive here with either the cx23416 or the cx22702
659 * on the bus. Take the bus from the cx23416 and enable the 659 * on the bus. Take the bus from the cx23416 and enable the
@@ -676,7 +676,7 @@ static int cx8802_dvb_advise_release(struct cx8802_driver *drv)
676 int err = 0; 676 int err = 0;
677 dprintk( 1, "%s\n", __FUNCTION__); 677 dprintk( 1, "%s\n", __FUNCTION__);
678 678
679 switch (core->board) { 679 switch (core->boardnr) {
680 case CX88_BOARD_HAUPPAUGE_HVR1300: 680 case CX88_BOARD_HAUPPAUGE_HVR1300:
681 /* Do Nothing, leave the cx22702 on the bus. */ 681 /* Do Nothing, leave the cx22702 on the bus. */
682 break; 682 break;
@@ -694,13 +694,13 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
694 694
695 dprintk( 1, "%s\n", __FUNCTION__); 695 dprintk( 1, "%s\n", __FUNCTION__);
696 dprintk( 1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n", 696 dprintk( 1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n",
697 core->board, 697 core->boardnr,
698 core->name, 698 core->name,
699 core->pci_bus, 699 core->pci_bus,
700 core->pci_slot); 700 core->pci_slot);
701 701
702 err = -ENODEV; 702 err = -ENODEV;
703 if (!(cx88_boards[core->board].mpeg & CX88_MPEG_DVB)) 703 if (!(core->board.mpeg & CX88_MPEG_DVB))
704 goto fail_core; 704 goto fail_core;
705 705
706 /* If vp3054 isn't enabled, a stub will just return 0 */ 706 /* If vp3054 isn't enabled, a stub will just return 0 */