#endif /* CONFIG_PM */ 
#endif /* CONFIG_PM_LEGACY */ 
static int __init init_opl3sa2(void){	int card, max;	/* Sanitize isapnp and multiple settings */	isapnp = isapnp != 0 ? 1 : 0;	multiple = multiple != 0 ? 1 : 0;	max = (multiple && isapnp) ? OPL3SA2_CARDS_MAX : 1;#ifdef CONFIG_PNP	if (isapnp){		pnp_register_driver(&opl3sa2_driver);		if(!opl3sa2_cards_num){			printk(KERN_INFO PFX "No PnP cards found\n");			isapnp = 0;		}		max = opl3sa2_cards_num;	}#endif	for (card = 0; card < max; card++) {		/* If a user wants an I/O then assume they meant it */		struct resource *ports;		int base;				if (!isapnp) {			if (io == -1 || irq == -1 || dma == -1 ||			    dma2 == -1 || mss_io == -1) {				printk(KERN_ERR				       PFX "io, mss_io, irq, dma, and dma2 must be set\n");				return -EINVAL;			}			opl3sa2_cards_num++;			/*			 * Our own config:			 * (NOTE: IRQ and DMA aren't used, so they're set to			 *  give pretty output from conf_printf. :)			 */			opl3sa2_state[card].cfg.io_base = io;			opl3sa2_state[card].cfg.irq     = irq;			opl3sa2_state[card].cfg.dma     = dma;			opl3sa2_state[card].cfg.dma2    = dma2;				/* The MSS config: */			opl3sa2_state[card].cfg_mss.io_base      = mss_io;			opl3sa2_state[card].cfg_mss.irq          = irq;			opl3sa2_state[card].cfg_mss.dma          = dma;			opl3sa2_state[card].cfg_mss.dma2         = dma2;			opl3sa2_state[card].cfg_mss.card_subtype = 1; /* No IRQ or DMA setup */			opl3sa2_state[card].cfg_mpu.io_base       = mpu_io;			opl3sa2_state[card].cfg_mpu.irq           = irq;			opl3sa2_state[card].cfg_mpu.dma           = -1;			opl3sa2_state[card].cfg_mpu.always_detect = 1; /* Use shared IRQs */			/* Call me paranoid: */			opl3sa2_clear_slots(&opl3sa2_state[card].cfg);			opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mss);			opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mpu);		}		/* FIXME: leak */		if (probe_opl3sa2(&opl3sa2_state[card].cfg, card))			return -ENODEV;		base = opl3sa2_state[card].cfg_mss.io_base;		if (!request_region(base, 4, "WSS config"))			goto failed;		ports = request_region(base + 4, 4, "ad1848");		if (!ports)			goto failed2;		if (!probe_ms_sound(&opl3sa2_state[card].cfg_mss, ports)) {			/*			 * If one or more cards are already registered, don't			 * return an error but print a warning.  Note, this			 * should never really happen unless the hardware or			 * ISA PnP screwed up.			 */			release_region(base + 4, 4);		failed2:			release_region(base, 4);		failed:			release_region(opl3sa2_state[card].cfg.io_base, 2);			if (opl3sa2_cards_num) {				printk(KERN_WARNING				       PFX "There was a problem probing one "				       " of the ISA PNP cards, continuing\n");				opl3sa2_cards_num--;				continue;			} else				return -ENODEV;		}		attach_opl3sa2(&opl3sa2_state[card].cfg, card);		conf_printf(opl3sa2_state[card].chipset_name, &opl3sa2_state[card].cfg);		attach_opl3sa2_mixer(&opl3sa2_state[card].cfg, card);		attach_opl3sa2_mss(&opl3sa2_state[card].cfg_mss, ports);		/* ewww =) */		opl3sa2_state[card].card = card;#ifdef CONFIG_PM		/* register our power management capabilities */		opl3sa2_state[card].pmdev = pm_register(PM_ISA_DEV, card, opl3sa2_pm_callback);		if (opl3sa2_state[card].pmdev)			opl3sa2_state[card].pmdev->data = &opl3sa2_state[card];#endif /* CONFIG_PM */		/*		 * Set the Yamaha 3D enhancement mode (aka Ymersion) if asked to and		 * it's supported.		 */		if (ymode != -1) {			if (opl3sa2_state[card].chipset == CHIPSET_OPL3SA2) {				printk(KERN_ERR				       PFX "ymode not supported on OPL3-SA2\n");			}			else {				opl3sa2_set_ymode(&opl3sa2_state[card].cfg, ymode);			}		}		/* Set A/D input to Mono loopback if asked to. */		if (loopback != -1) {			opl3sa2_set_loopback(&opl3sa2_state[card].cfg, loopback);		}				/* Attach MPU if we've been asked to do so, failure isn't fatal */		if (opl3sa2_state[card].cfg_mpu.io_base != -1) {			int base = opl3sa2_state[card].cfg_mpu.io_base;			struct resource *ports;			ports = request_region(base, 2, "mpu401");			if (!ports)				goto out;			if (!probe_mpu401(&opl3sa2_state[card].cfg_mpu, ports)) {				release_region(base, 2);				goto out;			}			if (attach_mpu401(&opl3sa2_state[card].cfg_mpu, THIS_MODULE)) {				printk(KERN_ERR PFX "failed to attach MPU401\n");				opl3sa2_state[card].cfg_mpu.slots[1] = -1;			}		}	}out:	if (isapnp) {		printk(KERN_NOTICE PFX "%d PnP card(s) found.\n", opl3sa2_cards_num);	}	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/bca73e4bf8563d83f7856164caa44d5f42e44cca/opl3sa2.c/buggy/sound/oss/opl3sa2.c