strcpy(i2c_clientname(&chip->c),desc->name); 
strcpy(chip->c.name, desc->name); 
static int chip_attach(struct i2c_adapter *adap, int addr, int kind){	struct CHIPSTATE *chip;	struct CHIPDESC  *desc;	chip = kmalloc(sizeof(*chip),GFP_KERNEL);	if (!chip)		return -ENOMEM;	memset(chip,0,sizeof(*chip));	memcpy(&chip->c,&client_template,sizeof(struct i2c_client));        chip->c.adapter = adap;        chip->c.addr = addr;	i2c_set_clientdata(&chip->c, chip);	/* find description for the chip */	dprintk("tvaudio: chip found @ i2c-addr=0x%x\n", addr<<1);	for (desc = chiplist; desc->name != NULL; desc++) {		if (0 == *(desc->insmodopt))			continue;		if (addr < desc->addr_lo ||		    addr > desc->addr_hi)			continue;		if (desc->checkit && !desc->checkit(chip))			continue;		break;	}	if (desc->name == NULL) {		dprintk("tvaudio: no matching chip description found\n");		return -EIO;	}	printk("tvaudio: found %s @ 0x%x\n", desc->name, addr<<1);	dprintk("tvaudio: matches:%s%s%s.\n",		(desc->flags & CHIP_HAS_VOLUME)     ? " volume"      : "",		(desc->flags & CHIP_HAS_BASSTREBLE) ? " bass/treble" : "",		(desc->flags & CHIP_HAS_INPUTSEL)   ? " audiomux"    : "");	/* fill required data structures */	strcpy(i2c_clientname(&chip->c),desc->name);	chip->type = desc-chiplist;	chip->shadow.count = desc->registers+1;        chip->prevmode = -1;	/* register */	i2c_attach_client(&chip->c);	/* initialization  */	if (desc->initialize != NULL)		desc->initialize(chip);	else		chip_cmd(chip,"init",&desc->init);	if (desc->flags & CHIP_HAS_VOLUME) {		chip->left   = desc->leftinit   ? desc->leftinit   : 65535;		chip->right  = desc->rightinit  ? desc->rightinit  : 65535;		chip_write(chip,desc->leftreg,desc->volfunc(chip->left));		chip_write(chip,desc->rightreg,desc->volfunc(chip->right));	}	if (desc->flags & CHIP_HAS_BASSTREBLE) {		chip->treble = desc->trebleinit ? desc->trebleinit : 32768;		chip->bass   = desc->bassinit   ? desc->bassinit   : 32768;		chip_write(chip,desc->bassreg,desc->bassfunc(chip->bass));		chip_write(chip,desc->treblereg,desc->treblefunc(chip->treble));	}	chip->tpid = -1;	if (desc->checkmode) {		/* start async thread */		init_timer(&chip->wt);		chip->wt.function = chip_thread_wake;		chip->wt.data     = (unsigned long)chip;		init_waitqueue_head(&chip->wq);		init_completion(&chip->texit);		chip->tpid = kernel_thread(chip_thread,(void *)chip,0);		if (chip->tpid < 0)			printk(KERN_WARNING "%s: kernel_thread() failed\n",			       i2c_clientname(&chip->c));		wake_up_interruptible(&chip->wq);	}	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/fae91e72b79ba9a21f0ce7551a1fd7e8984c85a6/tvaudio.c/buggy/drivers/media/video/tvaudio.c