V4L/DVB (5758): Tea5767: store tuning operations in tuner_operations structure
authorMichael Krufky <mkrufky@linuxtv.org>
Wed, 6 Jun 2007 19:17:17 +0000 (16:17 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 18 Jul 2007 17:24:05 +0000 (14:24 -0300)
Create static struct tuner_operations tea5767_tuner_ops for tea5767
tuning function callback pointers

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/tea5767.c

index c5510422aa3e549035a63c4bbae2628ce328b449..9cce9be718c5de1b6309820496722f5be78e5072 100644 (file)
@@ -343,6 +343,14 @@ int tea5767_autodetection(struct i2c_client *c)
        return 0;
 }
 
+static struct tuner_operations tea5767_tuner_ops = {
+       .set_tv_freq    = set_tv_freq,
+       .set_radio_freq = set_radio_freq,
+       .has_signal     = tea5767_signal,
+       .is_stereo      = tea5767_stereo,
+       .standby        = tea5767_standby,
+};
+
 int tea5767_tuner_init(struct i2c_client *c)
 {
        struct tuner *t = i2c_get_clientdata(c);
@@ -350,11 +358,7 @@ int tea5767_tuner_init(struct i2c_client *c)
        tuner_info("type set to %d (%s)\n", t->type, "Philips TEA5767HN FM Radio");
        strlcpy(c->name, "tea5767", sizeof(c->name));
 
-       t->ops.set_tv_freq = set_tv_freq;
-       t->ops.set_radio_freq = set_radio_freq;
-       t->ops.has_signal = tea5767_signal;
-       t->ops.is_stereo = tea5767_stereo;
-       t->ops.standby = tea5767_standby;
+       memcpy(&t->ops, &tea5767_tuner_ops, sizeof(struct tuner_operations));
 
        return (0);
 }