snd_printk("SI7018: the secondary codec - invalid access\n"); 
snd_printk(KERN_ERR "SI7018: the secondary codec - invalid access\n"); 
static int __devinit snd_trident_mixer(trident_t * trident, int pcm_spdif_device){	ac97_template_t _ac97;	snd_card_t * card = trident->card;	snd_kcontrol_t *kctl;	snd_ctl_elem_value_t *uctl;	int idx, err, retries = 2;	static ac97_bus_ops_t ops = {		.write = snd_trident_codec_write,		.read = snd_trident_codec_read,	};	uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);	if (!uctl)		return -ENOMEM;	if ((err = snd_ac97_bus(trident->card, 0, &ops, NULL, &trident->ac97_bus)) < 0)		goto __out;	memset(&_ac97, 0, sizeof(_ac97));	_ac97.private_data = trident;	trident->ac97_detect = 1;      __again:	if ((err = snd_ac97_mixer(trident->ac97_bus, &_ac97, &trident->ac97)) < 0) {		if (trident->device == TRIDENT_DEVICE_ID_SI7018) {			if ((err = snd_trident_sis_reset(trident)) < 0)				goto __out;			if (retries-- > 0)				goto __again;			err = -EIO;		}		goto __out;	}		/* secondary codec? */	if (trident->device == TRIDENT_DEVICE_ID_SI7018 &&	    (inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) & SI_AC97_PRIMARY_READY) != 0) {		_ac97.num = 1;		err = snd_ac97_mixer(trident->ac97_bus, &_ac97, &trident->ac97_sec);		if (err < 0)			snd_printk("SI7018: the secondary codec - invalid access\n");#if 0	// only for my testing purpose --jk		{			ac97_t *mc97;			err = snd_ac97_modem(trident->card, &_ac97, &mc97);			if (err < 0)				snd_printk("snd_ac97_modem returned error %i\n", err);		}#endif	}		trident->ac97_detect = 0;	if (trident->device != TRIDENT_DEVICE_ID_SI7018) {		if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_trident_vol_wave_control, trident))) < 0)			goto __out;		kctl->put(kctl, uctl);		if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_trident_vol_music_control, trident))) < 0)			goto __out;		kctl->put(kctl, uctl);		outl(trident->musicvol_wavevol = 0x00000000, TRID_REG(trident, T4D_MUSICVOL_WAVEVOL));	} else {		outl(trident->musicvol_wavevol = 0xffff0000, TRID_REG(trident, T4D_MUSICVOL_WAVEVOL));	}	for (idx = 0; idx < 32; idx++) {		snd_trident_pcm_mixer_t *tmix;				tmix = &trident->pcm_mixer[idx];		tmix->voice = NULL;	}	if ((trident->ctl_vol = snd_ctl_new1(&snd_trident_pcm_vol_control, trident)) == NULL)		goto __nomem;	if ((err = snd_ctl_add(card, trident->ctl_vol)))		goto __out;			if ((trident->ctl_pan = snd_ctl_new1(&snd_trident_pcm_pan_control, trident)) == NULL)		goto __nomem;	if ((err = snd_ctl_add(card, trident->ctl_pan)))		goto __out;	if ((trident->ctl_rvol = snd_ctl_new1(&snd_trident_pcm_rvol_control, trident)) == NULL)		goto __nomem;	if ((err = snd_ctl_add(card, trident->ctl_rvol)))		goto __out;	if ((trident->ctl_cvol = snd_ctl_new1(&snd_trident_pcm_cvol_control, trident)) == NULL)		goto __nomem;	if ((err = snd_ctl_add(card, trident->ctl_cvol)))		goto __out;	if (trident->device == TRIDENT_DEVICE_ID_NX) {		if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_trident_ac97_rear_control, trident))) < 0)			goto __out;		kctl->put(kctl, uctl);	}	if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) {		kctl = snd_ctl_new1(&snd_trident_spdif_control, trident);		if (kctl == NULL) {			err = -ENOMEM;			goto __out;		}		if (trident->ac97->ext_id & AC97_EI_SPDIF)			kctl->id.index++;		if (trident->ac97_sec && (trident->ac97_sec->ext_id & AC97_EI_SPDIF))			kctl->id.index++;		idx = kctl->id.index;		if ((err = snd_ctl_add(card, kctl)) < 0)			goto __out;		kctl->put(kctl, uctl);		kctl = snd_ctl_new1(&snd_trident_spdif_default, trident);		if (kctl == NULL) {			err = -ENOMEM;			goto __out;		}		kctl->id.index = idx;		kctl->id.device = pcm_spdif_device;		if ((err = snd_ctl_add(card, kctl)) < 0)			goto __out;		kctl = snd_ctl_new1(&snd_trident_spdif_mask, trident);		if (kctl == NULL) {			err = -ENOMEM;			goto __out;		}		kctl->id.index = idx;		kctl->id.device = pcm_spdif_device;		if ((err = snd_ctl_add(card, kctl)) < 0)			goto __out;		kctl = snd_ctl_new1(&snd_trident_spdif_stream, trident);		if (kctl == NULL) {			err = -ENOMEM;			goto __out;		}		kctl->id.index = idx;		kctl->id.device = pcm_spdif_device;		if ((err = snd_ctl_add(card, kctl)) < 0)			goto __out;		trident->spdif_pcm_ctl = kctl;	}	err = 0;	goto __out; __nomem:	err = -ENOMEM; __out:	kfree(uctl);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/99b359ba10a582148c6725f428a33ba5356dd993/trident_main.c/buggy/sound/pci/trident/trident_main.c