client_reg.EventMask = CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL #ifdef CONFIG_PM | CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME #endif ; client_reg.event_handler = &pdacf_event; 
static dev_link_t *snd_pdacf_attach(void){	client_reg_t client_reg;	/* Register with cardmgr */	dev_link_t *link;		/* Info for cardmgr */	int i, ret;	pdacf_t *pdacf;	snd_card_t *card;	static snd_device_ops_t ops = {		.dev_free =	snd_pdacf_dev_free,	};	snd_printdd(KERN_DEBUG "pdacf_attach called\n");	/* find an empty slot from the card list */	for (i = 0; i < SNDRV_CARDS; i++) {		if (! card_list[i])			break;	}	if (i >= SNDRV_CARDS) {		snd_printk(KERN_ERR "pdacf: too many cards found\n");		return NULL;	}	if (! enable[i])		return NULL; /* disabled explicitly */	/* ok, create a card instance */	card = snd_card_new(index[i], id[i], THIS_MODULE, 0);	if (card == NULL) {		snd_printk(KERN_ERR "pdacf: cannot create a card instance\n");		return NULL;	}	pdacf = snd_pdacf_create(card);	if (! pdacf)		return NULL;	if (snd_device_new(card, SNDRV_DEV_LOWLEVEL, pdacf, &ops) < 0) {		kfree(pdacf);		snd_card_free(card);		return NULL;	}	pdacf->index = i;	card_list[i] = card;	link = &pdacf->link;	link->priv = pdacf;	link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;	link->io.NumPorts1 = 16;	link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT | IRQ_FORCED_PULSE;	// link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;	link->irq.IRQInfo1 = 0 /* | IRQ_LEVEL_ID */;	link->irq.Handler = pdacf_interrupt;	link->irq.Instance = pdacf;	link->conf.Attributes = CONF_ENABLE_IRQ;	link->conf.IntType = INT_MEMORY_AND_IO;	link->conf.ConfigIndex = 1;	link->conf.Present = PRESENT_OPTION;	/* Chain drivers */	link->next = dev_list;	dev_list = link;	/* Register with Card Services */	client_reg.dev_info = &dev_info;	client_reg.EventMask = 		CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL#ifdef CONFIG_PM		| CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET		| CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME#endif		;	client_reg.event_handler = &pdacf_event;	client_reg.Version = 0x0210;	client_reg.event_callback_args.client_data = link;	ret = pcmcia_register_client(&link->handle, &client_reg);	if (ret != CS_SUCCESS) {		cs_error(link->handle, RegisterClient, ret);		snd_pdacf_detach(link);		return NULL;	}	return link;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/1e212f3645a6b355de8c43a23376bc0e2ac49a63/pdaudiocf.c/clean/sound/pcmcia/pdaudiocf/pdaudiocf.c