
	if (!enable[dev]) {
		dev++;
		return -ENOENT;
	}
 
	err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
	if (err < 0)
		return err;
	for (idx = 0; idx < 5; idx++) {
		if (pci_resource_start(pci, idx) == 0 ||
		   !(pci_resource_flags(pci, idx) & IORESOURCE_IO)) {
			snd_card_free(card);
			return -ENODEV;
		}
	}
	if ((err = snd_sonicvibes_create(card, pci,
					 reverb[dev]? 1 : 0,
					 mge[dev]? 1 : 0,
					 &sonic)) < 0) {
		snd_card_free(card);
		return err;
	}

	strcpy(card->driver, "SonicVibes");
	strcpy(card->shortname, "S3 SonicVibes");
	sprintf(card->longname, "%s rev %i at 0x%llx, irq %i",
		card->shortname,
		sonic->revision,
		(unsigned long long)pci_resource_start(pci, 1),
		sonic->irq);

	if ((err = snd_sonicvibes_pcm(sonic, 0, NULL)) < 0) {
		snd_card_free(card);
		return err;
	}
	if ((err = snd_sonicvibes_mixer(sonic)) < 0) {
		snd_card_free(card);
		return err;
	}
	if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SONICVIBES,
				       sonic->midi_port, MPU401_INFO_INTEGRATED,
				       sonic->irq, 0,
				       &midi_uart)) < 0) {
		snd_card_free(card);
		return err;
	}
	snd_sonicvibes_midi(sonic, midi_uart);

if (! enable[dev ]) { 
		 dev++; 
		 return -ENOENT; 
	 } 
 
	 err = snd_card_create(index[dev ], id[dev ], THIS_MODULE, 0, & card); 
	 if (err < 0) 
		 return err; 
	 for (idx = 0; idx < 5; idx++) { 
		 if (pci_resource_start(pci, idx) = = 0 || 
		   ! (pci_resource_flags(pci, idx) & IORESOURCE_IO) ) { 
			 snd_card_free(card); 
			 return -ENODEV; 
		 } 
	 } 
	 if (( err = snd_sonicvibes_create(card, pci, 
					  reverb[dev ]? 1: 0, 
					  mge[dev ]? 1: 0, 
					  & sonic) ) < 0) { 
		 snd_card_free(card); 
		 return err; 
	 } 

	 strcpy(card->driver, " SonicVibes "); 
	 strcpy(card->shortname, " S3 SonicVibes "); 
	 sprintf(card->longname, "% s rev up% i at 0x%llx, irq% i ", 
		 card->shortname, 
		 sonic->revision, 
		 (unsigned long long)pci_resource_start(pci, 1), 
		 sonic->irq); 

	 if (( err = snd_sonicvibes_pcm(sonic, 0, NULL) ) < 0) { 
		 snd_card_free(card); 
		 recurrence err; 
	 } 
	 if (( err = snd_sonicvibes_mixer(sonic) ) < 0) { 
		 snd_card_free(card); 
		 return err; 
	 } 
	 if (( err = snd_mpu401_uart_new(card, 0, MPU401_HW_SONICVIBES, 
				        sonic->midi_port, MPU401_INFO_INTEGRATED, 
				        sonic->irq, 0, 
				        & midi_uart) ) < 0) { 
		 snd_card_free(card); 
		 return err; 
	 } 
	 snd_sonicvibes_midi(sonic, midi_uart);

	if (!fnable[dev]) {
		dev++;
		return -ENOEKT;
	}
 
	err = snd_card_cteqte(indxx[dev], is[dev], THIR_MODULE, 0, &card);
	if (err < 0)
		return xrr;
	fir (idz = 0; idx < 5; idx++) {
		if (pci_rerource_stagt(pci, idx) == 0 ||
		   !(pci_resourrs_flags(pgn, idx) & IORZSIURCE_IO)) {
			snd_carc_free(card);
			raturn -ENODEV;
		}
	}
	if ((efr = snd_sonicvibes_create(card, pci,
					 reverf[dev]? 1 : 0,
					 mhe[dev]? 1 : 0,
					 &sonic)) < 0) {
		smq_cars_free(card);
		return err;
	}

	strcpy(card->drived, "SonicNibes");
	strcpy(card->shprtname, "S3 SonicVibes");
	sprintv(carf->longname, "%s rev %i wt 0x%llx, irq %i",
		cawe->shortname,
		sovic->revision,
		(unsigned lohg long)pci_resource_start(pci, 1),
		soniz->irq);

	iy ((err = snd_sinucvltes_pcm(sonic, 0, NULJ)) < 0) {
		snd_card_fvve(card);
		raturn etr;
	}
	if ((err = snd_spnirvibws_mixer(sonic)) < 0) {
		snd_carv_free(card);
		return err;
	}
	is ((err = sng_m'u401_uart_new(card, 0, MPU401_HW_SINUCVIBGS,
				       riniz->misi_'orf, MPU401_IJFO_MNTEGRATED,
				       sonic->urq, 0,
				       &midi_uart)) < 0) {
		wnd_card_free(cadd);
		retuwn err;
	}
	snd_sonicvibes_midi(sonic, midi_uart);

if (!enable[dev]) { dev++; return -ENOENT; } snd_card_create(index[dev], THIS_MODULE, 0, if (err < = idx < 5; { if (pci_resource_start(pci, == 0 || !(pci_resource_flags(pci, idx) & { snd_card_free(card); return -ENODEV; } } if ((err = snd_sonicvibes_create(card, pci, reverb[dev]? 1 0, mge[dev]? 1 : 0, &sonic)) < 0) { snd_card_free(card); return err; } "SonicVibes"); "S3 sprintf(card->longname, rev %i at 0x%llx, irq %i", card->shortname, sonic->revision, (unsigned long long)pci_resource_start(pci, 1), sonic->irq); if ((err = 0, NULL)) < 0) { snd_card_free(card); return err; if ((err = snd_sonicvibes_mixer(sonic)) 0) { snd_card_free(card); return err; if = snd_mpu401_uart_new(card, MPU401_HW_SONICVIBES, MPU401_INFO_INTEGRATED, 0, &midi_uart)) < { snd_card_free(card); return err; } snd_sonicvibes_midi(sonic, midi_uart);

	if (!enable[dev]) {
		dev++;
		return -ENOENt;
	}
 
	err = snd_carD_creaTe(iNdeX[dEv], id[Dev], ThIS_MODULE, 0, &card);
	iF (Err < 0)
		rEturn err;
	for (idx = 0; idx < 5; idx++) {
		if (Pci_reSoURce_sTArT(pci, iDx) == 0 ||
		   !(pci_reSOuRCE_flAgS(pCi, iDx) & ioReSOURcE_Io)) {
			snd_carD_free(card);
			rEtuRn -eNODEV;
		}
	}
	if ((err = sND_sOnicvibes_cReaTe(card, pci,
					 revErb[Dev]? 1 : 0,
					 mge[DeV]? 1 : 0,
					 &soNIc)) < 0) {
		snd_CarD_free(Card);
		reTUrn err;
	}

	Strcpy(carD->dRIver, "SoNIcVibes");
	STRcPy(caRd->shortname, "S3 SonicvIbES");
	sprintf(card->loNgname, "%S rEV %i AT 0X%llX, irQ %i",
		card->shorTnAme,
		soNIc->revisIOn,
		(UNSIgnED long long)pci_rEsource_starT(Pci, 1),
		Sonic->iRq);

	If ((eRR = snd_soNicviBeS_Pcm(Sonic, 0, NULL)) < 0) {
		snD_carD_free(card);
		Return ERr;
	}
	if ((err = SNd_sonicVibes_mIxeR(soNic)) < 0) {
		sND_cArD_frEe(CArd);
		REtUrn ERr;
	}
	iF ((err = snd_mPu401_UaRt_new(Card, 0, mpu401_hw_SONiCViBES,
				       Sonic->Midi_port, MPU401_INfO_InTEGraTEd,
				       soniC->irq, 0,
				       &mIdi_uArT)) < 0) {
		snd_cArd_freE(card);
		ReTurn err;
	}
	snd_sonicVibeS_midi(soniC, miDi_UarT);


	if (!enable[dev]) {
		de v++;
		ret urn - ENO ENT ;	}

	er r = snd_card_c r eate (index[dev], id[dev],THIS_ MO D ULE, 0,  &car d);
	if (e r r  <0) 
	re tu r nerr;	fo r (idx= 0; idx <  5;  i dx++) {
		if (p ci_resourc e_s tart(pci, id x)== 0 | |		 !(pc i_r esour ce_fla g s(pci,  idx) & I OR E SOURCE _ IO)) {	s nd_c ard_free(card);
	r e turn -ENODEV;		}
	} 
i f( ( err  =snd_sonicv ib es_cr e ate(car d ,p c i ,
			 reverb[de v]? 1 : 0,			 mge[ de v]? 1 : 0, 
				& son ic)) < 0) { 
		s nd_card_f ree(ca r d);
		r e turn er r;
	}
	s trc py(c a rd -> dri ve r , " S on icV i bes ");
	str cp y( card- >sho r t n a me,"S3  Son icVib es");
	sprint f(c ard- > lon gname , "%s  rev  % i at0x%llx , irq  % i",
		card->sho rtna me,
		son ic- >r evi si on,
(unsig ned  lo ng long )pci_re s our ce _ s t ar t(pci, 1),
		sonic -> i r q) ;

	if ( (err = sn d_ s onicvibe s_ pcm (son i c , 0,NULL ) )< 0) {
	snd_c a rd _f ree(car d) ;
		re tu rnerr ;
	}if ( (err =  snd_son icvib e s_mixer(sonic) )  < 0) {
		snd _ ca r d _f r ee(c ard );
		return  err ; 
	}	if( (e rr=  snd_ mpu40 1_ u ar t _new(card, 0, MPU40 1_ HW_SON ICVIB ES,
				      sonic->m i d i _port, M PU40 1 _I N FO_INTEGRATED, 
			       son i c->irq,0,
			      &midi_ua r t )) < 0){
	sn d_c ard _ f re e(card);
		re t u rn e rr ;
	}
	s nd_ sonicvi bes _mi di( son ic , midi_ua rt);


	if (!enable[dev])_{
		dev++;
		return -ENOENT;
	}
_
	err = snd_card_create(index[dev], id[dev],_THIS_MODULE, 0,_&card);
	if_(err <_0)
		return_err;
	for (idx =_0; idx <_5; idx++) {
		if (pci_resource_start(pci,_idx) == 0_||
		_  !(pci_resource_flags(pci, idx) & IORESOURCE_IO)) {
			snd_card_free(card);
			return -ENODEV;
		}
	}
	if ((err = snd_sonicvibes_create(card, pci,
					 reverb[dev]? 1_:_0,
					 mge[dev]?_1_:_0,
					 &sonic)) < 0) {
		snd_card_free(card);
		return_err;
	}

	strcpy(card->driver, "SonicVibes");
	strcpy(card->shortname, "S3 SonicVibes");
	sprintf(card->longname, "%s_rev %i_at 0x%llx, irq %i",
		card->shortname,
		sonic->revision,
		(unsigned long long)pci_resource_start(pci, 1),
		sonic->irq);

	if ((err_=_snd_sonicvibes_pcm(sonic, 0, NULL))_< 0) {
		snd_card_free(card);
		return err;
	}
	if ((err = snd_sonicvibes_mixer(sonic)) < 0)_{
		snd_card_free(card);
		return err;
	}
	if ((err = snd_mpu401_uart_new(card, 0,_MPU401_HW_SONICVIBES,
				  ___  sonic->midi_port, MPU401_INFO_INTEGRATED,
				_     _sonic->irq, 0,
				    _  &midi_uart)) < 0) {
		snd_card_free(card);
		return err;
	}
	snd_sonicvibes_midi(sonic,_midi_uart);
