From 016aa2e20f1ca4b4f5430c4e945878b73a866894 Mon Sep 17 00:00:00 2001 From: Johannes Stezenbach Date: Fri, 30 Jul 2004 13:16:31 +0000 Subject: use mt352_read_register() only after card_type is set (should fix mt352 detection) --- linux/drivers/media/dvb/frontends/mt352.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'linux/drivers/media') diff --git a/linux/drivers/media/dvb/frontends/mt352.c b/linux/drivers/media/dvb/frontends/mt352.c index 1fbc66d99..3ae72e832 100644 --- a/linux/drivers/media/dvb/frontends/mt352.c +++ b/linux/drivers/media/dvb/frontends/mt352.c @@ -770,9 +770,6 @@ static int mt352_attach_adapter(struct i2c_adapter *i2c) mt352_info.frequency_max = FE_FREQ_MAX; mt352_info.frequency_stepsize = FE_FREQ_STEPSIZE; - if (mt352_read_register(i2c, CHIP_ID) != ID_MT352) - return -ENODEV; - if ( !(state = kmalloc(sizeof(struct mt352_state), GFP_KERNEL)) ) return -ENOMEM; @@ -795,6 +792,11 @@ static int mt352_attach_adapter(struct i2c_adapter *i2c) card_type = force_card; } + if (mt352_read_register(i2c, CHIP_ID) != ID_MT352) { + kfree(state); + return -ENODEV; + } + if (card_type == CARD_AVDVBT771) printk(KERN_INFO FRONTEND_NAME ": Setup for Avermedia 771.\n"); else if (card_type == CARD_TUA6034) -- cgit v1.2.3