aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/dvb-pll.c
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2006-05-14 04:01:31 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 01:00:42 -0400
commitdea74869f3c62b0b7addd67017b22b394e942aac (patch)
treed1a597caea6615c76f34896cc832fd1371f2e776 /drivers/media/dvb/frontends/dvb-pll.c
parent332bed5fc25ab0eb84215ecd89a4acd48219eee0 (diff)
V4L/DVB (4028): Change dvb_frontend_ops to be a real field instead of a pointer field inside dvb_frontend
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends/dvb-pll.c')
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index a1a4be41e03e..a189683454b7 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -505,8 +505,8 @@ static int dvb_pll_sleep(struct dvb_frontend *fe)
505 buf[2] = priv->pll_desc->entries[i].config; 505 buf[2] = priv->pll_desc->entries[i].config;
506 buf[3] = priv->pll_desc->entries[i].cb; 506 buf[3] = priv->pll_desc->entries[i].cb;
507 507
508 if (fe->ops->i2c_gate_ctrl) 508 if (fe->ops.i2c_gate_ctrl)
509 fe->ops->i2c_gate_ctrl(fe, 1); 509 fe->ops.i2c_gate_ctrl(fe, 1);
510 if ((result = i2c_transfer(priv->i2c, &msg, 1)) != 1) { 510 if ((result = i2c_transfer(priv->i2c, &msg, 1)) != 1) {
511 return result; 511 return result;
512 } 512 }
@@ -529,15 +529,15 @@ static int dvb_pll_set_params(struct dvb_frontend *fe, struct dvb_frontend_param
529 return -EINVAL; 529 return -EINVAL;
530 530
531 // DVBT bandwidth only just now 531 // DVBT bandwidth only just now
532 if (fe->ops->info.type == FE_OFDM) { 532 if (fe->ops.info.type == FE_OFDM) {
533 bandwidth = params->u.ofdm.bandwidth; 533 bandwidth = params->u.ofdm.bandwidth;
534 } 534 }
535 535
536 if ((result = dvb_pll_configure(priv->pll_desc, buf, params->frequency, bandwidth)) != 0) 536 if ((result = dvb_pll_configure(priv->pll_desc, buf, params->frequency, bandwidth)) != 0)
537 return result; 537 return result;
538 538
539 if (fe->ops->i2c_gate_ctrl) 539 if (fe->ops.i2c_gate_ctrl)
540 fe->ops->i2c_gate_ctrl(fe, 1); 540 fe->ops.i2c_gate_ctrl(fe, 1);
541 if ((result = i2c_transfer(priv->i2c, &msg, 1)) != 1) { 541 if ((result = i2c_transfer(priv->i2c, &msg, 1)) != 1) {
542 return result; 542 return result;
543 } 543 }
@@ -567,7 +567,7 @@ static int dvb_pll_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parame
567 return -EINVAL; 567 return -EINVAL;
568 568
569 // DVBT bandwidth only just now 569 // DVBT bandwidth only just now
570 if (fe->ops->info.type == FE_OFDM) { 570 if (fe->ops.info.type == FE_OFDM) {
571 bandwidth = params->u.ofdm.bandwidth; 571 bandwidth = params->u.ofdm.bandwidth;
572 } 572 }
573 573
@@ -623,10 +623,10 @@ int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2
623 priv->i2c = i2c; 623 priv->i2c = i2c;
624 priv->pll_desc = desc; 624 priv->pll_desc = desc;
625 625
626 memcpy(&fe->ops->tuner_ops, &dvb_pll_tuner_ops, sizeof(struct dvb_tuner_ops)); 626 memcpy(&fe->ops.tuner_ops, &dvb_pll_tuner_ops, sizeof(struct dvb_tuner_ops));
627 strncpy(fe->ops->tuner_ops.info.name, desc->name, 128); 627 strncpy(fe->ops.tuner_ops.info.name, desc->name, 128);
628 fe->ops->tuner_ops.info.frequency_min = desc->min; 628 fe->ops.tuner_ops.info.frequency_min = desc->min;
629 fe->ops->tuner_ops.info.frequency_min = desc->max; 629 fe->ops.tuner_ops.info.frequency_min = desc->max;
630 630
631 fe->tuner_priv = priv; 631 fe->tuner_priv = priv;
632 return 0; 632 return 0;