From 1d6b912020482abd6eb163baa0190a1da23b9f9e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 30 Jun 2005 16:37:17 +0000 Subject: - Fixed bugs at TEA5767 autodetection code - New debug code for identifying calls to set_type before I2C ok. Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/tuner-core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 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 74f216dd6..072252311 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.32 2005/06/30 09:45:18 mchehab Exp $ + * $Id: tuner-core.c,v 1.33 2005/06/30 16:37:17 mchehab Exp $ * * i2c tv tuner chip device driver * core core, i.e. kernel interfaces, registering and so on @@ -152,8 +152,8 @@ static void set_type(struct i2c_client *c, unsigned int type, return; if (NULL == t->i2c.dev.driver) { + tuner_info("Trying to set type before initializing driver\n"); /* not registered yet */ - t->type = type; return; } /* if ((t->admin_status==T_UNINITIALIZED) && (t->type == type)) @@ -312,8 +312,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) /* TEA5767 autodetection code - only for addr = 0xc0 */ if (addr == 0x60) { - set_type(&t->i2c, TUNER_TEA5767, T_RADIO); - if (t->type == TUNER_TEA5767) { + if (tea5767_autodetection(&t->i2c)!=EINVAL) { t->type = TUNER_TEA5767; t->admin_status = T_RADIO|T_STANDBY; default_admin_status &= ~T_RADIO; -- cgit v1.2.3