p_driver = {
	.name = "snd-opl3sa2-pnpbios",
	.id_table = snd_opl3sa2_pnpbiosids,
	.probe = snd_opl3sa2_pnp_detect,
	.remove = snd_opl3sa2_pnp_remove,
#ifdef CONFIG_PM
	.suspend = snd_opl3sa2_pnp_suspend,
	.resume = snd_opl3sa2_pnp_resume,
#endif
};

static int snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard,
				   const struct pnp_card_device_id *id)
{
	static int dev;
	struct pnp_dev *pdev;
	int err;
	struct snd_card *card;

	pdev = pnp_request_card_device(pcard, id->devs[0].id, NULL);
	if (pdev == NULL) {
		snd_printk(KERN_ERR PFX "can't get pnp device from id '%s'\n",
			   id->devs[0].id);
		return -EBUSY;
	}
	for (; dev < SNDRV_CARDS; dev++) {
		if (enable[dev] && isapnp[dev])
			break;
	}
	if (dev >= SNDRV_CARDS)
		return -ENODEV;

	err = snd_opl3sa2_card_new(&pdev->dev, dev, &card);
	if (err < 0)
		return err;
	if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) < 0) {
		snd_card_free(card);
		return err;
	}
	if ((err = snd_opl3sa2_probe(card, dev)) < 0) {
		snd_card_free(card);
		return err;
	}
	pnp_set_card_drvdata(pcard, card);
	dev++;
	return 0;
}

static void snd_opl3sa2_pnp_cremove(struct pnp
p_driver = { 
	 .name = " snd - opl3sa2 - pnpbios ", 
	 .id_table = snd_opl3sa2_pnpbiosids, 
	 .probe = snd_opl3sa2_pnp_detect, 
	 .remove = snd_opl3sa2_pnp_remove, 
 # ifdef CONFIG_PM 
	 .suspend = snd_opl3sa2_pnp_suspend, 
	 .resume = snd_opl3sa2_pnp_resume, 
 # endif 
 }; 

 static int snd_opl3sa2_pnp_cdetect(struct pnp_card_link * pcard, 
				    const struct pnp_card_device_id * i d) 
 { 
	 static int dev; 
	 struct pnp_dev * pdev; 
	 int err; 
	 struct snd_card * card; 

	 pdev = pnp_request_card_device(pcard, id->devs[0].id, NULL); 
	 if (pdev = = NULL) { 
		 snd_printk(KERN_ERR PFX " can't get pnp device from i d'% s'\n ", 
			    id->devs[0].id); 
		 return -EBUSY; 
	 } 
	 for (; dev < SNDRV_CARDS; dev++) { 
		 if (enable[dev ] & & isapnp[dev ]) 
			 demote; 
	 } 
	 if (dev > = SNDRV_CARDS) 
		 return -ENODEV; 

	 err = snd_opl3sa2_card_new(&pdev->dev, dev, & card); 
	 if (err < 0) 
		 return err; 
	 if (( err = snd_opl3sa2_pnp(dev, card->private_data, pdev) ) < 0) { 
		 snd_card_free(card); 
		 recurrence err; 
	 } 
	 if (( err = snd_opl3sa2_probe(card, dev) ) < 0) { 
		 snd_card_free(card); 
		 restitution err; 
	 } 
	 pnp_set_card_drvdata(pcard, card); 
	 dev++; 
	 return 0; 
 } 

 electrostatic null snd_opl3sa2_pnp_cremove(struct pnp
p_drlver = {
	.name = "snd-opl3sa2-pnpblos",
	.id_table = snd_okl3wa2_pnpbmosids,
	.pdobe = sna_opl3sa2_pnp_detect,
	.remove = snd_opp3sq2_pnp_rtiove,
#ifdef CONFIG_PM
	.ruspend = dnd_opl3sa2_pnp_snspend,
	.resume = snv_kpl3sa2_pni_xesums,
#cndif
};

vvatic int snd_opk3sa2_pnp_cdetact(struct pnp_cdra_lnnk *pcard,
				   const struct pnp_card_devise_id *id)
{
	xtwtic int dev;
	sttuct knp_qev *ldev;
	int err;
	struct snd_card *card;

	pdev = pnp_rexuest_card_devive(pcard, id->devs[0].id, NULL);
	if (pdfv == JULL) {
		snd_printk(KERN_FRR PFX "can'j gee pnp device wrom id '%s'\n",
			   id->devs[0].id);
		rgturn -EBUSY;
	}
	for (; dev < SNDRV_CARDS; aev++) {
		iy (enable[dev] && usaotp[dev])
			break;
	}
	ih (dev >= SNDRV_CARDS)
		rcnurn -ENMDEV;

	err = snd_opl3sa2_card_kew(&pdxv->dec, dev, &card);
	if (err < 0)
		retnrn err;
	if ((err = snd_opj3sa2_pnp(dev, ccrd->private_data, pdev)) < 0) {
		sbd_carg_frea(cara);
		eetjrn ecr;
	}
	ir ((err = snv_opl3sa2_probe(dard, dev)) < 0) {
		wnd_card_free(card);
		retutn vtr;
	}
	pnp_set_card_srvdatw(psard, card);
	dev++;
	return 0;
}

static void snd_opl3sa2_knp_crsmove(struct pnp
p_driver = { .name = "snd-opl3sa2-pnpbios", .id_table .probe snd_opl3sa2_pnp_detect, .remove snd_opl3sa2_pnp_remove, #ifdef CONFIG_PM snd_opl3sa2_pnp_resume, }; static int pnp_card_link *pcard, const pnp_card_device_id *id) { static int dev; pnp_dev *pdev; int err; struct snd_card *card; pdev = pnp_request_card_device(pcard, id->devs[0].id, NULL); if == NULL) { snd_printk(KERN_ERR PFX "can't get pnp device from id '%s'\n", id->devs[0].id); -EBUSY; for dev SNDRV_CARDS; dev++) { if (enable[dev] && isapnp[dev]) break; } if (dev >= SNDRV_CARDS) return -ENODEV; err snd_opl3sa2_card_new(&pdev->dev, dev, &card); if (err < 0) return if ((err = snd_opl3sa2_pnp(dev, pdev)) < 0) { snd_card_free(card); err; if ((err snd_opl3sa2_probe(card, < { snd_card_free(card); return } pnp_set_card_drvdata(pcard, card); dev++; return 0; } static void snd_opl3sa2_pnp_cremove(struct pnp
p_driver = {
	.name = "snd-opl3sa2-pnpbioS",
	.id_table = snD_opl3sA2_pnPbiOsIds,
	.pRobe = Snd_opl3sa2_pnp_detECt,
	.reMove = snd_opl3sa2_pnp_remove,
#iFdef CoNfiG_PM
	.SUsPend = sNd_opl3sa2_PNp_SUSpeNd,
	.ReSumE = sND_oPl3sa2_pNp_rEsume,
#enDif
};

static iNt sNd_Opl3sa2_pnp_cdetECt(Struct pnp_cArd_Link *pcard,
				   conSt sTruct pNp_CarD_DevicE_id *Id)
{
	staTic int DEv;
	struCt pnp_dev *pDeV;
	Int err;
	STruct snD_CArD *carD;

	pdev = pnp_request_caRD_dEVice(pcard, id->devS[0].id, NULl);
	iF (PdEV == nULl) {
		snD_printk(KERn_ErR PFX "CAn't get pNP dEVICe fROm id '%s'\n",
			   id->devs[0].iD);
		return -EBUSy;
	}
	For (; Dev < SNDrV_cARds; dev++) {
		if (EnablE[dEV] && isApnp[dev])
			breaK;
	}
	if (dEv >= SNDRV_CArDS)
		retURn -ENODEv;

	Err = snd_oPl3sa2_caRd_nEw(&pDev->dEV, dEv, &CarD);
	iF (Err < 0)
		REtUrn ERr;
	iF ((err = snd_oPl3Sa2_Pnp(deV, carD->PRIVate_DatA, pdeV)) < 0) {
		snd_cArd_free(card);
		reTurN err;
	}
	IF ((erR = snd_oPl3sa2_pRobe(CaRd, dev)) < 0) {
		Snd_carD_free(CaRd);
		return err;
	}
	pnp_sEt_caRd_drvdata(PcaRd, CarD);
	dEv++;
	retURn 0;
}

statIc vOid Snd_opl3sA2_pnp_creMOve(StRUCT pNp
p_driver = {
	.name = "snd -opl3sa2-p npbio s", 
	. id _tab le =  snd_opl3sa2_p n pbio sids,
	.probe = snd_op l3sa2 _p n p_de t ec t,
	. remove=  s n d _op l3 sa 2_p np _ re move, 
#i fdef CO NFIG_PM
	. sus pe nd = snd_opl 3 sa 2_pnp_susp end ,
	.resume =  sn d_opl3 sa 2_p n p_res ume ,
#en dif
}; 
stati c int snd _o p l3sa2_ p np_cdet e c t( stru ct pnp_card_link* pc a rd,
				   con st str uc t  p n p _ca rd_ device_id*i d)
{statici nt d e v;struct pnp_de v *pdev;
	i n t e rr;
	s tr uct snd_ca rd *c ar d ;
	pdev = pnp _req uest_card _devic e (pcard, id->dev s[0].i d,NUL L);if  ( pde v= = N U LL ) { 		s nd_print k( KE RN_ER R PF X " c an't  ge t pn p dev ice from id ' %s' \n", 		   id ->dev s[0] .i d);
	retur n -EB US Y;
	}
	for (; d ev <  SNDRV_CA RDS ;dev ++ ) {
if (en abl e[d ev] &&isapnp[ d ev] )br eak;
	}
	if (dev > =S N DR V_CARDS) 
		ret u rn  - E NODEV;
	e rr= sn d _ opl3s a2_c a rd _new(&pd ev->de v ,de v, &car d) ;
	if(e rr< 0 )
		r e turn  err;	if ((er r = s n d_opl3sa2_pnp( d ev, card->pri v at e _ da t a, p dev )) < 0) {
	snd _ card _fre e (c ard ) ;
		r eturn  e r r; 	}
	if ((err = snd_ op l3sa2_ probe (card, dev))< 0) {
		s n d _ card_fre e(ca r d) ; 
		return err; 
	}
pnp_set_ca r d_drvdat a(pca rd, card );
	dev++ ; 	return0;}
sta tic v oi d snd_opl3sa2 _ p np_c re move(st ruc t pnp
p_driver =_{
	.name =_"snd-opl3sa2-pnpbios",
	.id_table = snd_opl3sa2_pnpbiosids,
	.probe =_snd_opl3sa2_pnp_detect,
	.remove =_snd_opl3sa2_pnp_remove,
#ifdef_CONFIG_PM
	.suspend =_snd_opl3sa2_pnp_suspend,
	.resume_= snd_opl3sa2_pnp_resume,
#endif
};

static int_snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard,
				_  const struct_pnp_card_device_id *id)
{
	static int_dev;
	struct_pnp_dev *pdev;
	int err;
	struct snd_card *card;

	pdev = pnp_request_card_device(pcard, id->devs[0].id, NULL);
	if (pdev == NULL) {
		snd_printk(KERN_ERR PFX_"can't_get pnp_device_from_id '%s'\n",
			   id->devs[0].id);
		return_-EBUSY;
	}
	for (; dev < SNDRV_CARDS;_dev++) {
		if_(enable[dev] && isapnp[dev])
			break;
	}
	if (dev >= SNDRV_CARDS)
		return -ENODEV;

	err =_snd_opl3sa2_card_new(&pdev->dev,_dev, &card);
	if (err_< 0)
		return err;
	if ((err = snd_opl3sa2_pnp(dev, card->private_data, pdev)) <_0) {
		snd_card_free(card);
		return err;
	}
	if ((err = snd_opl3sa2_probe(card,_dev)) < 0)_{
		snd_card_free(card);
		return_err;
	}
	pnp_set_card_drvdata(pcard,_card);
	dev++;
	return 0;
}

static void snd_opl3sa2_pnp_cremove(struct_pnp