diff options
author | Patrick Boettcher <pb@linuxtv.org> | 2006-05-14 04:01:31 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-25 01:00:42 -0400 |
commit | dea74869f3c62b0b7addd67017b22b394e942aac (patch) | |
tree | d1a597caea6615c76f34896cc832fd1371f2e776 /drivers/media/dvb/frontends/bcm3510.c | |
parent | 332bed5fc25ab0eb84215ecd89a4acd48219eee0 (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/bcm3510.c')
-rw-r--r-- | drivers/media/dvb/frontends/bcm3510.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/media/dvb/frontends/bcm3510.c b/drivers/media/dvb/frontends/bcm3510.c index 1708a1d4893e..baeb311de893 100644 --- a/drivers/media/dvb/frontends/bcm3510.c +++ b/drivers/media/dvb/frontends/bcm3510.c | |||
@@ -48,7 +48,6 @@ | |||
48 | struct bcm3510_state { | 48 | struct bcm3510_state { |
49 | 49 | ||
50 | struct i2c_adapter* i2c; | 50 | struct i2c_adapter* i2c; |
51 | struct dvb_frontend_ops ops; | ||
52 | const struct bcm3510_config* config; | 51 | const struct bcm3510_config* config; |
53 | struct dvb_frontend frontend; | 52 | struct dvb_frontend frontend; |
54 | 53 | ||
@@ -791,10 +790,9 @@ struct dvb_frontend* bcm3510_attach(const struct bcm3510_config *config, | |||
791 | 790 | ||
792 | state->config = config; | 791 | state->config = config; |
793 | state->i2c = i2c; | 792 | state->i2c = i2c; |
794 | memcpy(&state->ops, &bcm3510_ops, sizeof(struct dvb_frontend_ops)); | ||
795 | 793 | ||
796 | /* create dvb_frontend */ | 794 | /* create dvb_frontend */ |
797 | state->frontend.ops = &state->ops; | 795 | memcpy(&state->frontend.ops, &bcm3510_ops, sizeof(struct dvb_frontend_ops)); |
798 | state->frontend.demodulator_priv = state; | 796 | state->frontend.demodulator_priv = state; |
799 | 797 | ||
800 | mutex_init(&state->hab_mutex); | 798 | mutex_init(&state->hab_mutex); |