Commit 5d807c9f authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

V4L/DVB (5759): Tuner-simple: store tuning operations in tuner_operations struct

Create static struct tuner_operations simple_tuner_ops
for tuner-simple tuning function callback pointers
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 0f838f8d
...@@ -479,6 +479,13 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) ...@@ -479,6 +479,13 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc); tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);
} }
static struct tuner_operations simple_tuner_ops = {
.set_tv_freq = default_set_tv_freq,
.set_radio_freq = default_set_radio_freq,
.has_signal = tuner_signal,
.is_stereo = tuner_stereo,
};
int default_tuner_init(struct i2c_client *c) int default_tuner_init(struct i2c_client *c)
{ {
struct tuner *t = i2c_get_clientdata(c); struct tuner *t = i2c_get_clientdata(c);
...@@ -487,11 +494,7 @@ int default_tuner_init(struct i2c_client *c) ...@@ -487,11 +494,7 @@ int default_tuner_init(struct i2c_client *c)
t->type, tuners[t->type].name); t->type, tuners[t->type].name);
strlcpy(c->name, tuners[t->type].name, sizeof(c->name)); strlcpy(c->name, tuners[t->type].name, sizeof(c->name));
t->ops.set_tv_freq = default_set_tv_freq; memcpy(&t->ops, &simple_tuner_ops, sizeof(struct tuner_operations));
t->ops.set_radio_freq = default_set_radio_freq;
t->ops.has_signal = tuner_signal;
t->ops.is_stereo = tuner_stereo;
t->ops.standby = NULL;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment