diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-04-22 13:41:50 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 12:42:23 -0400 |
commit | 65e8d29f7a37faaf9c73c633447bebd4b31b2c89 (patch) | |
tree | 9e4d72f4a6710d3435ae51499d74cdf2c7a8f916 | |
parent | 82b3083d2673e5fe8ac508071038b2b4c10bbf9c (diff) |
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: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/tuner-core.c | 5 | ||||
-rw-r--r-- | drivers/media/video/tuner-simple.c | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 770dbcbecb63..4d791766ce11 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -352,11 +352,6 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
352 | return; | 352 | return; |
353 | } | 353 | } |
354 | 354 | ||
355 | if (type >= tuner_count) { | ||
356 | tuner_warn ("tuner 0x%02x: Tuner count greater than %d\n",c->addr,tuner_count); | ||
357 | return; | ||
358 | } | ||
359 | |||
360 | t->type = type; | 355 | t->type = type; |
361 | t->config = new_config; | 356 | t->config = new_config; |
362 | if (tuner_callback != NULL) { | 357 | if (tuner_callback != NULL) { |
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c index 85556d44c8ab..d3362703e258 100644 --- a/drivers/media/video/tuner-simple.c +++ b/drivers/media/video/tuner-simple.c | |||
@@ -688,6 +688,12 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe, | |||
688 | { | 688 | { |
689 | struct tuner_simple_priv *priv = NULL; | 689 | struct tuner_simple_priv *priv = NULL; |
690 | 690 | ||
691 | if (type >= tuner_count) { | ||
692 | printk(KERN_WARNING "%s: invalid tuner type: %d (max: %d)\n", | ||
693 | __FUNCTION__, type, tuner_count-1); | ||
694 | return NULL; | ||
695 | } | ||
696 | |||
691 | priv = kzalloc(sizeof(struct tuner_simple_priv), GFP_KERNEL); | 697 | priv = kzalloc(sizeof(struct tuner_simple_priv), GFP_KERNEL); |
692 | if (priv == NULL) | 698 | if (priv == NULL) |
693 | return NULL; | 699 | return NULL; |