Commit 65e8d29f authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (7126): tuner: move tuner type ID check to simple_tuner_attach



Move tuner type ID check from tuner-core::set_type to simple_tuner_attach.

Since tuner-core forwards all attach requests to tuner-simple as the
default case, unless a specific attach function is specified in
set_type, this change is an appropriate cleanup.
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 82b3083d
...@@ -352,11 +352,6 @@ static void set_type(struct i2c_client *c, unsigned int type, ...@@ -352,11 +352,6 @@ static void set_type(struct i2c_client *c, unsigned int type,
return; return;
} }
if (type >= tuner_count) {
tuner_warn ("tuner 0x%02x: Tuner count greater than %d\n",c->addr,tuner_count);
return;
}
t->type = type; t->type = type;
t->config = new_config; t->config = new_config;
if (tuner_callback != NULL) { if (tuner_callback != NULL) {
......
...@@ -688,6 +688,12 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe, ...@@ -688,6 +688,12 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
{ {
struct tuner_simple_priv *priv = NULL; struct tuner_simple_priv *priv = NULL;
if (type >= tuner_count) {
printk(KERN_WARNING "%s: invalid tuner type: %d (max: %d)\n",
__FUNCTION__, type, tuner_count-1);
return NULL;
}
priv = kzalloc(sizeof(struct tuner_simple_priv), GFP_KERNEL); priv = kzalloc(sizeof(struct tuner_simple_priv), GFP_KERNEL);
if (priv == NULL) if (priv == NULL)
return NULL; return NULL;
......
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