diff options
author | Patrick Boettcher <pb@linuxtv.org> | 2006-05-14 10:01:31 +0200 |
---|---|---|
committer | Patrick Boettcher <pb@linuxtv.org> | 2006-05-14 10:01:31 +0200 |
commit | d7e9bdcf5053c838a7421c8e52fed2a0bd4644fb (patch) | |
tree | 9e5d14895b19243fdfc53d2344a16d23e0e39586 /linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c | |
parent | b4179ae5b7a6fe509d2cf6ce601880e82c288d5c (diff) | |
download | mediapointer-dvb-s2-d7e9bdcf5053c838a7421c8e52fed2a0bd4644fb.tar.gz mediapointer-dvb-s2-d7e9bdcf5053c838a7421c8e52fed2a0bd4644fb.tar.bz2 |
Change dvb_frontend_ops to be a real field instead of a pointer field inside dvb_frontend
From: Patrick Boettcher <pb@linuxtv.org>
The dvb_frontend_ops is a pointer inside dvb_frontend. That's why every demod-driver
is having a field of dvb_frontend_ops in its private-state-struct and
using the reference for filling the pointer-field in dvb_frontend.
- It saves at least two lines of code per demod-driver,
- reduces object size (one less dereference per frontend_ops-access),
- be coherent with dvb_tuner_ops,
- makes it a little bit easier for newbies to understand how it works and
- avoids stupid mistakes because you would have to copy the dvb_frontend_ops
always, before you could assign the static pointer directly, which was
dangerous.
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c')
-rw-r--r-- | linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c index c4ffdb375..9fd691e5c 100644 --- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c @@ -301,8 +301,8 @@ static int microtune_mt7202dtf_tuner_set_params(struct dvb_frontend* fe, struct data[2] = ((div >> 10) & 0x60) | cfg; data[3] = (cpump << 6) | band_select; - if (fe->ops->i2c_gate_ctrl) - fe->ops->i2c_gate_ctrl(fe, 1); + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 1); i2c_transfer(card->i2c_adapter, &msg, 1); return (div * 166666 - 36000000); } @@ -484,8 +484,8 @@ static int vp3021_alps_tded4_tuner_set_params(struct dvb_frontend* fe, struct dv else return -EINVAL; - if (fe->ops->i2c_gate_ctrl) - fe->ops->i2c_gate_ctrl(fe, 1); + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 1); i2c_transfer(card->i2c_adapter, &msg, 1); return 0; } @@ -608,9 +608,9 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) card->i2c_adapter); if (card->fe != NULL) { - card->fe->ops->tuner_ops.calc_regs = thomson_dtt7579_tuner_calc_regs; - card->fe->ops->info.frequency_min = 174000000; - card->fe->ops->info.frequency_max = 862000000; + card->fe->ops.tuner_ops.calc_regs = thomson_dtt7579_tuner_calc_regs; + card->fe->ops.info.frequency_min = 174000000; + card->fe->ops.info.frequency_max = 862000000; } break; @@ -618,7 +618,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) lgdt330x_reset(card); card->fe = lgdt330x_attach(&tdvs_tua6034_config, card->i2c_adapter); if (card->fe != NULL) { - card->fe->ops->tuner_ops.set_params = tdvs_tua6034_tuner_set_params; + card->fe->ops.tuner_ops.set_params = tdvs_tua6034_tuner_set_params; dprintk ("dvb_bt8xx: lgdt330x detected\n"); } break; @@ -633,7 +633,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) digitv_alps_tded4_reset(card); card->fe = nxt6000_attach(&vp3021_alps_tded4_config, card->i2c_adapter); if (card->fe != NULL) { - card->fe->ops->tuner_ops.set_params = vp3021_alps_tded4_tuner_set_params; + card->fe->ops.tuner_ops.set_params = vp3021_alps_tded4_tuner_set_params; dprintk ("dvb_bt8xx: an nxt6000 was detected on your digitv card\n"); break; } @@ -643,7 +643,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) card->fe = mt352_attach(&digitv_alps_tded4_config, card->i2c_adapter); if (card->fe != NULL) { - card->fe->ops->tuner_ops.calc_regs = digitv_alps_tded4_tuner_calc_regs; + card->fe->ops.tuner_ops.calc_regs = digitv_alps_tded4_tuner_calc_regs; dprintk ("dvb_bt8xx: an mt352 was detected on your digitv card\n"); } break; @@ -651,16 +651,16 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) case BTTV_BOARD_AVDVBT_761: card->fe = sp887x_attach(µtune_mt7202dtf_config, card->i2c_adapter); if (card->fe) { - card->fe->ops->tuner_ops.set_params = microtune_mt7202dtf_tuner_set_params; + card->fe->ops.tuner_ops.set_params = microtune_mt7202dtf_tuner_set_params; } break; case BTTV_BOARD_AVDVBT_771: card->fe = mt352_attach(&advbt771_samsung_tdtc9251dh0_config, card->i2c_adapter); if (card->fe != NULL) { - card->fe->ops->tuner_ops.calc_regs = advbt771_samsung_tdtc9251dh0_tuner_calc_regs; - card->fe->ops->info.frequency_min = 174000000; - card->fe->ops->info.frequency_max = 862000000; + card->fe->ops.tuner_ops.calc_regs = advbt771_samsung_tdtc9251dh0_tuner_calc_regs; + card->fe->ops.info.frequency_min = 174000000; + card->fe->ops.info.frequency_max = 862000000; } break; @@ -688,9 +688,9 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) case BTTV_BOARD_PINNACLESAT: card->fe = cx24110_attach(&pctvsat_config, card->i2c_adapter); if (card->fe) { - card->fe->ops->tuner_ops.init = pinnsat_tuner_init; - card->fe->ops->tuner_ops.sleep = pinnsat_tuner_sleep; - card->fe->ops->tuner_ops.set_params = cx24108_tuner_set_params; + card->fe->ops.tuner_ops.init = pinnsat_tuner_init; + card->fe->ops.tuner_ops.sleep = pinnsat_tuner_sleep; + card->fe->ops.tuner_ops.set_params = cx24108_tuner_set_params; } break; @@ -708,8 +708,8 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) else if (dvb_register_frontend(&card->dvb_adapter, card->fe)) { printk("dvb-bt8xx: Frontend registration failed!\n"); - if (card->fe->ops->release) - card->fe->ops->release(card->fe); + if (card->fe->ops.release) + card->fe->ops.release(card->fe); card->fe = NULL; } } |