diff options
Diffstat (limited to 'drivers/media/video/tuner-core.c')
-rw-r--r-- | drivers/media/video/tuner-core.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 6bf104ea051d..5a75788b92ae 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -40,11 +40,11 @@ | |||
40 | typeof(&FUNCTION) __a = symbol_request(FUNCTION); \ | 40 | typeof(&FUNCTION) __a = symbol_request(FUNCTION); \ |
41 | if (__a) { \ | 41 | if (__a) { \ |
42 | __r = (int) __a(ARGS); \ | 42 | __r = (int) __a(ARGS); \ |
43 | symbol_put(FUNCTION); \ | ||
43 | } else { \ | 44 | } else { \ |
44 | printk(KERN_ERR "TUNER: Unable to find " \ | 45 | printk(KERN_ERR "TUNER: Unable to find " \ |
45 | "symbol "#FUNCTION"()\n"); \ | 46 | "symbol "#FUNCTION"()\n"); \ |
46 | } \ | 47 | } \ |
47 | symbol_put(FUNCTION); \ | ||
48 | __r; \ | 48 | __r; \ |
49 | }) | 49 | }) |
50 | 50 | ||
@@ -340,16 +340,6 @@ static void tuner_i2c_address_check(struct tuner *t) | |||
340 | tuner_warn("====================== WARNING! ======================\n"); | 340 | tuner_warn("====================== WARNING! ======================\n"); |
341 | } | 341 | } |
342 | 342 | ||
343 | static void attach_tda829x(struct tuner *t) | ||
344 | { | ||
345 | struct tda829x_config cfg = { | ||
346 | .lna_cfg = t->config, | ||
347 | .tuner_callback = t->tuner_callback, | ||
348 | }; | ||
349 | dvb_attach(tda829x_attach, | ||
350 | &t->fe, t->i2c->adapter, t->i2c->addr, &cfg); | ||
351 | } | ||
352 | |||
353 | static struct xc5000_config xc5000_cfg; | 343 | static struct xc5000_config xc5000_cfg; |
354 | 344 | ||
355 | static void set_type(struct i2c_client *c, unsigned int type, | 345 | static void set_type(struct i2c_client *c, unsigned int type, |
@@ -385,12 +375,19 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
385 | 375 | ||
386 | switch (t->type) { | 376 | switch (t->type) { |
387 | case TUNER_MT2032: | 377 | case TUNER_MT2032: |
388 | dvb_attach(microtune_attach, | 378 | if (!dvb_attach(microtune_attach, |
389 | &t->fe, t->i2c->adapter, t->i2c->addr); | 379 | &t->fe, t->i2c->adapter, t->i2c->addr)) |
380 | goto attach_failed; | ||
390 | break; | 381 | break; |
391 | case TUNER_PHILIPS_TDA8290: | 382 | case TUNER_PHILIPS_TDA8290: |
392 | { | 383 | { |
393 | attach_tda829x(t); | 384 | struct tda829x_config cfg = { |
385 | .lna_cfg = t->config, | ||
386 | .tuner_callback = t->tuner_callback, | ||
387 | }; | ||
388 | if (!dvb_attach(tda829x_attach, &t->fe, t->i2c->adapter, | ||
389 | t->i2c->addr, &cfg)) | ||
390 | goto attach_failed; | ||
394 | break; | 391 | break; |
395 | } | 392 | } |
396 | case TUNER_TEA5767: | 393 | case TUNER_TEA5767: |
@@ -441,8 +438,9 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
441 | break; | 438 | break; |
442 | } | 439 | } |
443 | case TUNER_TDA9887: | 440 | case TUNER_TDA9887: |
444 | dvb_attach(tda9887_attach, | 441 | if (!dvb_attach(tda9887_attach, |
445 | &t->fe, t->i2c->adapter, t->i2c->addr); | 442 | &t->fe, t->i2c->adapter, t->i2c->addr)) |
443 | goto attach_failed; | ||
446 | break; | 444 | break; |
447 | case TUNER_XC5000: | 445 | case TUNER_XC5000: |
448 | { | 446 | { |
@@ -450,10 +448,10 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
450 | 448 | ||
451 | xc5000_cfg.i2c_address = t->i2c->addr; | 449 | xc5000_cfg.i2c_address = t->i2c->addr; |
452 | xc5000_cfg.if_khz = 5380; | 450 | xc5000_cfg.if_khz = 5380; |
453 | xc5000_cfg.priv = c->adapter->algo_data; | ||
454 | xc5000_cfg.tuner_callback = t->tuner_callback; | 451 | xc5000_cfg.tuner_callback = t->tuner_callback; |
455 | if (!dvb_attach(xc5000_attach, | 452 | if (!dvb_attach(xc5000_attach, |
456 | &t->fe, t->i2c->adapter, &xc5000_cfg)) | 453 | &t->fe, t->i2c->adapter, &xc5000_cfg, |
454 | c->adapter->algo_data)) | ||
457 | goto attach_failed; | 455 | goto attach_failed; |
458 | 456 | ||
459 | xc_tuner_ops = &t->fe.ops.tuner_ops; | 457 | xc_tuner_ops = &t->fe.ops.tuner_ops; |
@@ -1167,7 +1165,7 @@ static int tuner_probe(struct i2c_client *client, | |||
1167 | /* If chip is not tda8290, don't register. | 1165 | /* If chip is not tda8290, don't register. |
1168 | since it can be tda9887*/ | 1166 | since it can be tda9887*/ |
1169 | if (tuner_symbol_probe(tda829x_probe, t->i2c->adapter, | 1167 | if (tuner_symbol_probe(tda829x_probe, t->i2c->adapter, |
1170 | t->i2c->addr) == 0) { | 1168 | t->i2c->addr) >= 0) { |
1171 | tuner_dbg("tda829x detected\n"); | 1169 | tuner_dbg("tda829x detected\n"); |
1172 | } else { | 1170 | } else { |
1173 | /* Default is being tda9887 */ | 1171 | /* Default is being tda9887 */ |
@@ -1181,7 +1179,7 @@ static int tuner_probe(struct i2c_client *client, | |||
1181 | case 0x60: | 1179 | case 0x60: |
1182 | if (tuner_symbol_probe(tea5767_autodetection, | 1180 | if (tuner_symbol_probe(tea5767_autodetection, |
1183 | t->i2c->adapter, t->i2c->addr) | 1181 | t->i2c->adapter, t->i2c->addr) |
1184 | != EINVAL) { | 1182 | >= 0) { |
1185 | t->type = TUNER_TEA5767; | 1183 | t->type = TUNER_TEA5767; |
1186 | t->mode_mask = T_RADIO; | 1184 | t->mode_mask = T_RADIO; |
1187 | t->mode = T_STANDBY; | 1185 | t->mode = T_STANDBY; |