diff options
-rw-r--r-- | drivers/media/video/tuner-core.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index d6b64e9178e..335a971298a 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -317,11 +317,6 @@ static void tuner_i2c_address_check(struct tuner *t) | |||
317 | tuner_warn("====================== WARNING! ======================\n"); | 317 | tuner_warn("====================== WARNING! ======================\n"); |
318 | } | 318 | } |
319 | 319 | ||
320 | static inline void attach_simple_tuner(struct tuner *t) | ||
321 | { | ||
322 | simple_tuner_attach(&t->fe, t->i2c->adapter, t->i2c->addr, t->type); | ||
323 | } | ||
324 | |||
325 | static void attach_tda829x(struct tuner *t) | 320 | static void attach_tda829x(struct tuner *t) |
326 | { | 321 | { |
327 | struct tda829x_config cfg = { | 322 | struct tda829x_config cfg = { |
@@ -399,7 +394,12 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
399 | buffer[2] = 0x86; | 394 | buffer[2] = 0x86; |
400 | buffer[3] = 0x54; | 395 | buffer[3] = 0x54; |
401 | i2c_master_send(c, buffer, 4); | 396 | i2c_master_send(c, buffer, 4); |
402 | attach_simple_tuner(t); | 397 | if (simple_tuner_attach(&t->fe, t->i2c->adapter, t->i2c->addr, |
398 | t->type) == NULL) { | ||
399 | t->type = TUNER_ABSENT; | ||
400 | t->mode_mask = T_UNINITIALIZED; | ||
401 | return; | ||
402 | } | ||
403 | break; | 403 | break; |
404 | case TUNER_PHILIPS_TD1316: | 404 | case TUNER_PHILIPS_TD1316: |
405 | buffer[0] = 0x0b; | 405 | buffer[0] = 0x0b; |
@@ -407,7 +407,12 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
407 | buffer[2] = 0x86; | 407 | buffer[2] = 0x86; |
408 | buffer[3] = 0xa4; | 408 | buffer[3] = 0xa4; |
409 | i2c_master_send(c,buffer,4); | 409 | i2c_master_send(c,buffer,4); |
410 | attach_simple_tuner(t); | 410 | if (simple_tuner_attach(&t->fe, t->i2c->adapter, |
411 | t->i2c->addr, t->type) == NULL) { | ||
412 | t->type = TUNER_ABSENT; | ||
413 | t->mode_mask = T_UNINITIALIZED; | ||
414 | return; | ||
415 | } | ||
411 | break; | 416 | break; |
412 | case TUNER_XC2028: | 417 | case TUNER_XC2028: |
413 | { | 418 | { |
@@ -445,7 +450,12 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
445 | } | 450 | } |
446 | break; | 451 | break; |
447 | default: | 452 | default: |
448 | attach_simple_tuner(t); | 453 | if (simple_tuner_attach(&t->fe, t->i2c->adapter, |
454 | t->i2c->addr, t->type) == NULL) { | ||
455 | t->type = TUNER_ABSENT; | ||
456 | t->mode_mask = T_UNINITIALIZED; | ||
457 | return; | ||
458 | } | ||
449 | break; | 459 | break; |
450 | } | 460 | } |
451 | 461 | ||