client_reg.EventMask = CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME; client_reg.event_handler = &avma1cs_event;
static dev_link_t *avma1cs_attach(void){    client_reg_t client_reg;    dev_link_t *link;    local_info_t *local;    int ret;        DEBUG(0, "avma1cs_attach()\n");    /* Initialize the dev_link_t structure */    link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);    if (!link)	return NULL;    memset(link, 0, sizeof(struct dev_link_t));    /* Allocate space for private device-specific data */    local = kmalloc(sizeof(local_info_t), GFP_KERNEL);    if (!local) {	kfree(link);	return NULL;    }    memset(local, 0, sizeof(local_info_t));    link->priv = local;    /* The io structure describes IO port mapping */    link->io.NumPorts1 = 16;    link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;    link->io.NumPorts2 = 16;    link->io.Attributes2 = IO_DATA_PATH_WIDTH_16;    link->io.IOAddrLines = 5;    /* Interrupt setup */    link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;    link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;    link->irq.IRQInfo1 = IRQ_LEVEL_ID;    /* General socket configuration */    link->conf.Attributes = CONF_ENABLE_IRQ;    link->conf.Vcc = 50;    link->conf.IntType = INT_MEMORY_AND_IO;    link->conf.ConfigIndex = 1;    link->conf.Present = PRESENT_OPTION;    /* Register with Card Services */    link->next = dev_list;    dev_list = link;    client_reg.dev_info = &dev_info;    client_reg.EventMask =	CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |	CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |	CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;    client_reg.event_handler = &avma1cs_event;    client_reg.Version = 0x0210;    client_reg.event_callback_args.client_data = link;    ret = pcmcia_register_client(&link->handle, &client_reg);    if (ret != 0) {	cs_error(link->handle, RegisterClient, ret);	avma1cs_detach(link);	return NULL;    }    return link;} /* avma1cs_attach */