From 2a07da4812a2b8039516a29d30ac1d3c09a9ac36 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 1 Jul 2005 12:13:09 +0000 Subject: * tuner-core.c: - Fixed a race condition at I2C implementation. Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/tuner-core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media/video/tuner-core.c') diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c index e71e8df6b..ee6249263 100644 --- a/linux/drivers/media/video/tuner-core.c +++ b/linux/drivers/media/video/tuner-core.c @@ -1,5 +1,5 @@ /* - * $Id: tuner-core.c,v 1.36 2005/07/01 08:22:24 nsh Exp $ + * $Id: tuner-core.c,v 1.37 2005/07/01 12:13:09 mchehab Exp $ * * i2c tv tuner chip device driver * core core, i.e. kernel interfaces, registering and so on @@ -325,7 +325,6 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) t->audmode = V4L2_TUNER_MODE_STEREO; t->admin_status = T_UNINITIALIZED; - i2c_attach_client(&t->i2c); tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name); /* TEA5767 autodetection code - only for addr = 0xc0 */ @@ -334,6 +333,9 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) t->type = TUNER_TEA5767; t->admin_status = T_RADIO|T_STANDBY; default_admin_status &= ~T_RADIO; + + /* Should be just before return */ + i2c_attach_client(&t->i2c); return 0; } } @@ -345,6 +347,8 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) default_admin_status = T_UNINITIALIZED; } + /* Should be just before return */ + i2c_attach_client(&t->i2c); return 0; } -- cgit v1.2.3