Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=48aa336a842ad3bd4f031f14fb6d06b0274c38f9
Commit:     48aa336a842ad3bd4f031f14fb6d06b0274c38f9
Parent:     690c544cf849e627d3f40a71633d0caf5c33eafe
Author:     Mauro Carvalho Chehab <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 29 11:33:18 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 19:01:33 2008 -0200

    V4L/DVB (6473): Prevents double tuner registering
    
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 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 11abd18..cd5f0d8 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,
                t->tuner_callback = tuner_callback;
        }
 
-       /* This code detects calls by card attach_inform */
-       if (NULL == t->i2c.dev.driver) {
+       if (t->mode == T_UNINITIALIZED) {
                tuner_dbg ("tuner 0x%02x: called during i2c_client register by 
adapter's attach_inform\n", c->addr);
 
                return;
@@ -684,6 +683,16 @@ static int tuner_attach(struct i2c_adapter *adap, int 
addr, int kind)
        /* Should be just before return */
 register_client:
        tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name);
+
+       /* Sets a default mode */
+       if (t->mode_mask & T_ANALOG_TV) {
+               t->mode = T_ANALOG_TV;
+       } else  if (t->mode_mask & T_RADIO) {
+               t->mode = T_RADIO;
+       } else {
+               t->mode = T_DIGITAL_TV;
+       }
+
        i2c_attach_client (client);
        set_type (client,t->type, t->mode_mask, t->config, t->tuner_callback);
        return 0;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to