diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-29 10:33:18 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:01:33 -0500 |
commit | 48aa336a842ad3bd4f031f14fb6d06b0274c38f9 (patch) | |
tree | 7fc7f7a056027ea08781248d8dd79406e5b53c57 /drivers/media/video/tuner-core.c | |
parent | 690c544cf849e627d3f40a71633d0caf5c33eafe (diff) |
V4L/DVB (6473): Prevents double tuner registering
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/tuner-core.c')
-rw-r--r-- | drivers/media/video/tuner-core.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 11abd188b17d..cd5f0d8e693c 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -279,8 +279,7 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
279 | t->tuner_callback = tuner_callback; | 279 | t->tuner_callback = tuner_callback; |
280 | } | 280 | } |
281 | 281 | ||
282 | /* This code detects calls by card attach_inform */ | 282 | if (t->mode == T_UNINITIALIZED) { |
283 | if (NULL == t->i2c.dev.driver) { | ||
284 | tuner_dbg ("tuner 0x%02x: called during i2c_client register by adapter's attach_inform\n", c->addr); | 283 | tuner_dbg ("tuner 0x%02x: called during i2c_client register by adapter's attach_inform\n", c->addr); |
285 | 284 | ||
286 | return; | 285 | return; |
@@ -684,6 +683,16 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) | |||
684 | /* Should be just before return */ | 683 | /* Should be just before return */ |
685 | register_client: | 684 | register_client: |
686 | tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name); | 685 | tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name); |
686 | |||
687 | /* Sets a default mode */ | ||
688 | if (t->mode_mask & T_ANALOG_TV) { | ||
689 | t->mode = T_ANALOG_TV; | ||
690 | } else if (t->mode_mask & T_RADIO) { | ||
691 | t->mode = T_RADIO; | ||
692 | } else { | ||
693 | t->mode = T_DIGITAL_TV; | ||
694 | } | ||
695 | |||
687 | i2c_attach_client (client); | 696 | i2c_attach_client (client); |
688 | set_type (client,t->type, t->mode_mask, t->config, t->tuner_callback); | 697 | set_type (client,t->type, t->mode_mask, t->config, t->tuner_callback); |
689 | return 0; | 698 | return 0; |