aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/mt352.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/frontends/mt352.c')
-rw-r--r--drivers/media/dvb/frontends/mt352.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/media/dvb/frontends/mt352.c b/drivers/media/dvb/frontends/mt352.c
index 8601a3f43074..5de7376c94ce 100644
--- a/drivers/media/dvb/frontends/mt352.c
+++ b/drivers/media/dvb/frontends/mt352.c
@@ -45,7 +45,6 @@
45struct mt352_state { 45struct mt352_state {
46 struct i2c_adapter* i2c; 46 struct i2c_adapter* i2c;
47 struct dvb_frontend frontend; 47 struct dvb_frontend frontend;
48 struct dvb_frontend_ops ops;
49 48
50 /* configuration settings */ 49 /* configuration settings */
51 struct mt352_config config; 50 struct mt352_config config;
@@ -288,17 +287,17 @@ static int mt352_set_parameters(struct dvb_frontend* fe,
288 mt352_calc_input_freq(state, buf+6); 287 mt352_calc_input_freq(state, buf+6);
289 288
290 if (state->config.no_tuner) { 289 if (state->config.no_tuner) {
291 if (fe->ops->tuner_ops.set_params) { 290 if (fe->ops.tuner_ops.set_params) {
292 fe->ops->tuner_ops.set_params(fe, param); 291 fe->ops.tuner_ops.set_params(fe, param);
293 if (fe->ops->i2c_gate_ctrl) 292 if (fe->ops.i2c_gate_ctrl)
294 fe->ops->i2c_gate_ctrl(fe, 0); 293 fe->ops.i2c_gate_ctrl(fe, 0);
295 } 294 }
296 295
297 mt352_write(fe, buf, 8); 296 mt352_write(fe, buf, 8);
298 mt352_write(fe, fsm_go, 2); 297 mt352_write(fe, fsm_go, 2);
299 } else { 298 } else {
300 if (fe->ops->tuner_ops.calc_regs) { 299 if (fe->ops.tuner_ops.calc_regs) {
301 fe->ops->tuner_ops.calc_regs(fe, param, buf+8, 5); 300 fe->ops.tuner_ops.calc_regs(fe, param, buf+8, 5);
302 buf[8] <<= 1; 301 buf[8] <<= 1;
303 mt352_write(fe, buf, sizeof(buf)); 302 mt352_write(fe, buf, sizeof(buf));
304 mt352_write(fe, tuner_go, 2); 303 mt352_write(fe, tuner_go, 2);
@@ -550,13 +549,12 @@ struct dvb_frontend* mt352_attach(const struct mt352_config* config,
550 /* setup the state */ 549 /* setup the state */
551 state->i2c = i2c; 550 state->i2c = i2c;
552 memcpy(&state->config,config,sizeof(struct mt352_config)); 551 memcpy(&state->config,config,sizeof(struct mt352_config));
553 memcpy(&state->ops, &mt352_ops, sizeof(struct dvb_frontend_ops));
554 552
555 /* check if the demod is there */ 553 /* check if the demod is there */
556 if (mt352_read_register(state, CHIP_ID) != ID_MT352) goto error; 554 if (mt352_read_register(state, CHIP_ID) != ID_MT352) goto error;
557 555
558 /* create dvb_frontend */ 556 /* create dvb_frontend */
559 state->frontend.ops = &state->ops; 557 memcpy(&state->frontend.ops, &mt352_ops, sizeof(struct dvb_frontend_ops));
560 state->frontend.demodulator_priv = state; 558 state->frontend.demodulator_priv = state;
561 return &state->frontend; 559 return &state->frontend;
562 560