static int tuner_attach(struct i2c_adapter *adap, int addr, int kind){	struct tuner *t;	client_template.adapter = adap;	client_template.addr = addr;	t = kmalloc(sizeof(struct tuner), GFP_KERNEL);	if (NULL == t)		return -ENOMEM;	memset(t, 0, sizeof(struct tuner));	memcpy(&t->i2c, &client_template, sizeof(struct i2c_client));	i2c_set_clientdata(&t->i2c, t);	t->type = UNSET;	t->radio_if2 = 10700 * 1000;	/* 10.7MHz - FM radio */	t->audmode = V4L2_TUNER_MODE_STEREO;	t->mode_mask = T_UNINITIALIZED;	tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name);	if (show_i2c) {		unsigned char buffer[16];		int i,rc;		memset(buffer, 0, sizeof(buffer));		rc = i2c_master_recv(&t->i2c, buffer, sizeof(buffer));		printk("tuner-%04x I2C RECV = ",addr);		for (i=0;i<rc;i++)			printk("%02x ",buffer[i]);		printk("\n");	}	/* TEA5767 autodetection code - only for addr = 0xc0 */	if (!no_autodetect) {		if (addr == 0x60) {			if (tea5767_autodetection(&t->i2c) != EINVAL) {				t->type = TUNER_TEA5767;				t->mode_mask = T_RADIO;				t->mode = T_STANDBY;				t->freq = 87.5 * 16; /* Sets freq to FM range */				default_mode_mask &= ~T_RADIO;				i2c_attach_client (&t->i2c);				set_type(&t->i2c,t->type, t->mode_mask);				return 0;			}		}	}	/* Initializes only the first adapter found */	if (default_mode_mask != T_UNINITIALIZED) {		tuner_dbg ("Setting mode_mask to 0x%02x\n", default_mode_mask);		t->mode_mask = default_mode_mask;		t->freq = 400 * 16; /* Sets freq to VHF High */		default_mode_mask = T_UNINITIALIZED;	}	/* Should be just before return */	i2c_attach_client (&t->i2c);	set_type (&t->i2c,t->type, t->mode_mask);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/13dd38d0814f36fce3a7ec9cb29a5ce6b0fc2522/tuner-core.c/buggy/drivers/media/video/tuner-core.c