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/frontends/dvb-pll.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/frontends/dvb-pll.c')
-rw-r--r-- | linux/drivers/media/dvb/frontends/dvb-pll.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/linux/drivers/media/dvb/frontends/dvb-pll.c b/linux/drivers/media/dvb/frontends/dvb-pll.c index a1a4be41e..a18968345 100644 --- a/linux/drivers/media/dvb/frontends/dvb-pll.c +++ b/linux/drivers/media/dvb/frontends/dvb-pll.c @@ -505,8 +505,8 @@ static int dvb_pll_sleep(struct dvb_frontend *fe) buf[2] = priv->pll_desc->entries[i].config; buf[3] = priv->pll_desc->entries[i].cb; - 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); if ((result = i2c_transfer(priv->i2c, &msg, 1)) != 1) { return result; } @@ -529,15 +529,15 @@ static int dvb_pll_set_params(struct dvb_frontend *fe, struct dvb_frontend_param return -EINVAL; // DVBT bandwidth only just now - if (fe->ops->info.type == FE_OFDM) { + if (fe->ops.info.type == FE_OFDM) { bandwidth = params->u.ofdm.bandwidth; } if ((result = dvb_pll_configure(priv->pll_desc, buf, params->frequency, bandwidth)) != 0) return result; - 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); if ((result = i2c_transfer(priv->i2c, &msg, 1)) != 1) { return result; } @@ -567,7 +567,7 @@ static int dvb_pll_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parame return -EINVAL; // DVBT bandwidth only just now - if (fe->ops->info.type == FE_OFDM) { + if (fe->ops.info.type == FE_OFDM) { bandwidth = params->u.ofdm.bandwidth; } @@ -623,10 +623,10 @@ int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2 priv->i2c = i2c; priv->pll_desc = desc; - memcpy(&fe->ops->tuner_ops, &dvb_pll_tuner_ops, sizeof(struct dvb_tuner_ops)); - strncpy(fe->ops->tuner_ops.info.name, desc->name, 128); - fe->ops->tuner_ops.info.frequency_min = desc->min; - fe->ops->tuner_ops.info.frequency_min = desc->max; + memcpy(&fe->ops.tuner_ops, &dvb_pll_tuner_ops, sizeof(struct dvb_tuner_ops)); + strncpy(fe->ops.tuner_ops.info.name, desc->name, 128); + fe->ops.tuner_ops.info.frequency_min = desc->min; + fe->ops.tuner_ops.info.frequency_min = desc->max; fe->tuner_priv = priv; return 0; |