summaryrefslogtreecommitdiff
path: root/drivers/media/dvb/frontends/dib3000mc.c
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2006-05-14 05:01:31 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 02:00:42 -0300
commitdea74869f3c62b0b7addd67017b22b394e942aac (patch)
treed1a597caea6615c76f34896cc832fd1371f2e776 /drivers/media/dvb/frontends/dib3000mc.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/dib3000mc.c')
-rw-r--r--drivers/media/dvb/frontends/dib3000mc.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c
index 68a443b3d504..6c3be2529980 100644
--- a/drivers/media/dvb/frontends/dib3000mc.c
+++ b/drivers/media/dvb/frontends/dib3000mc.c
@@ -462,9 +462,9 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe,
int search_state,auto_val;
u16 val;
- if (tuner && fe->ops->tuner_ops.set_params) { /* initial call from dvb */
- fe->ops->tuner_ops.set_params(fe, fep);
- if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0);
+ if (tuner && fe->ops.tuner_ops.set_params) { /* initial call from dvb */
+ fe->ops.tuner_ops.set_params(fe, fep);
+ if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
state->last_tuned_freq = fep->frequency;
// if (!scanboost) {
@@ -837,7 +837,6 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config,
/* setup the state */
state->i2c = i2c;
memcpy(&state->config,config,sizeof(struct dib3000_config));
- memcpy(&state->ops, &dib3000mc_ops, sizeof(struct dvb_frontend_ops));
/* check for the correct demod */
if (rd(DIB3000_REG_MANUFACTOR_ID) != DIB3000_I2C_ID_DIBCOM)
@@ -857,7 +856,7 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config,
}
/* create dvb_frontend */
- state->frontend.ops = &state->ops;
+ memcpy(&state->frontend.ops, &dib3000mc_ops, sizeof(struct dvb_frontend_ops));
state->frontend.demodulator_priv = state;
/* set the xfer operations */
@@ -874,6 +873,7 @@ error:
kfree(state);
return NULL;
}
+EXPORT_SYMBOL(dib3000mc_attach);
static struct dvb_frontend_ops dib3000mc_ops = {
@@ -912,5 +912,3 @@ static struct dvb_frontend_ops dib3000mc_ops = {
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
-
-EXPORT_SYMBOL(dib3000mc_attach);