socket[i].socket.features |= SS_CAP_PCCARD; 
socket[i].socket.features |= SS_CAP_PAGE_REGS | SS_CAP_PCCARD; 
static int __devinit pd6729_pci_probe(struct pci_dev *dev,				      const struct pci_device_id *id){	int i, j, ret;	u_int mask;	char configbyte;	struct pd6729_socket *socket;	socket = kmalloc(sizeof(struct pd6729_socket) * MAX_SOCKETS,			 GFP_KERNEL);	if (!socket)		return -ENOMEM;	memset(socket, 0, sizeof(struct pd6729_socket) * MAX_SOCKETS);	if ((ret = pci_enable_device(dev)))		goto err_out_free_mem;	printk(KERN_INFO "pd6729: Cirrus PD6729 PCI to PCMCIA Bridge "		"at 0x%lx on irq %d\n",	pci_resource_start(dev, 0), dev->irq); 	/*	 * Since we have no memory BARs some firmware may not	 * have had PCI_COMMAND_MEMORY enabled, yet the device needs it.	 */	pci_read_config_byte(dev, PCI_COMMAND, &configbyte);	if (!(configbyte & PCI_COMMAND_MEMORY)) {		printk(KERN_DEBUG "pd6729: Enabling PCI_COMMAND_MEMORY.\n");		configbyte |= PCI_COMMAND_MEMORY;		pci_write_config_byte(dev, PCI_COMMAND, configbyte);	}	ret = pci_request_regions(dev, "pd6729");	if (ret) {		printk(KERN_INFO "pd6729: pci request region failed.\n");		goto err_out_disable;	}	if (dev->irq == NO_IRQ)		irq_mode = 0;	/* fall back to ISA interrupt mode */	mask = pd6729_isa_scan();	if (irq_mode == 0 && mask == 0) {		printk(KERN_INFO "pd6729: no ISA interrupt is available.\n");		goto err_out_free_res;	}	for (i = 0; i < MAX_SOCKETS; i++) {		socket[i].io_base = pci_resource_start(dev, 0);		socket[i].socket.features |= SS_CAP_PCCARD;		socket[i].socket.map_size = 0x1000;		socket[i].socket.irq_mask = mask;		socket[i].socket.pci_irq  = dev->irq;		socket[i].socket.owner = THIS_MODULE;		socket[i].number = i;		socket[i].socket.ops = &pd6729_operations;		socket[i].socket.resource_ops = &pccard_nonstatic_ops;		socket[i].socket.dev.dev = &dev->dev;		socket[i].socket.driver_data = &socket[i];	}	pci_set_drvdata(dev, socket);	if (irq_mode == 1) {		/* Register the interrupt handler */		if ((ret = request_irq(dev->irq, pd6729_interrupt, SA_SHIRQ,							"pd6729", socket))) {			printk(KERN_ERR "pd6729: Failed to register irq %d, "							"aborting\n", dev->irq);			goto err_out_free_res;		}	} else {		/* poll Card status change */		init_timer(&socket->poll_timer);		socket->poll_timer.function = pd6729_interrupt_wrapper;		socket->poll_timer.data = (unsigned long)socket;		socket->poll_timer.expires = jiffies + HZ;		add_timer(&socket->poll_timer);	}	for (i = 0; i < MAX_SOCKETS; i++) {		ret = pcmcia_register_socket(&socket[i].socket);		if (ret) {			printk(KERN_INFO "pd6729: pcmcia_register_socket "					       "failed.\n");			for (j = 0; j < i ; j++)				pcmcia_unregister_socket(&socket[j].socket);			goto err_out_free_res2;		}	}	return 0; err_out_free_res2:	if (irq_mode == 1)		free_irq(dev->irq, socket);	else		del_timer_sync(&socket->poll_timer); err_out_free_res:	pci_release_regions(dev); err_out_disable:	pci_disable_device(dev); err_out_free_mem:	kfree(socket);	return ret;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/c35e66a4216c99fe94868ed3f714bd2708d0032a/pd6729.c/buggy/drivers/pcmcia/pd6729.c