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>
                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->config = new_config;
        if (tuner_callback != 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);
        if (priv == NULL)
                return NULL;