s = SOCKET(handle); 
int pcmcia_request_irq(client_handle_t handle, irq_req_t *req){	struct pcmcia_socket *s;	config_t *c;	int ret = CS_IN_USE, irq = 0;	struct pcmcia_device *p_dev = handle_to_pdev(handle);	s = SOCKET(handle);	if (!(s->state & SOCKET_PRESENT))		return CS_NO_CARD;	c = CONFIG(handle);	if (c->state & CONFIG_LOCKED)		return CS_CONFIGURATION_LOCKED;	if (c->state & CONFIG_IRQ_REQ)		return CS_IN_USE;#ifdef CONFIG_PCMCIA_PROBE	if (s->irq.AssignedIRQ != 0) {		/* If the interrupt is already assigned, it must be the same */		irq = s->irq.AssignedIRQ;	} else {		int try;		u32 mask = s->irq_mask;		void *data = NULL;		for (try = 0; try < 64; try++) {			irq = try % 32;			/* marked as available by driver, and not blocked by userspace? */			if (!((mask >> irq) & 1))				continue;			/* avoid an IRQ which is already used by a PCMCIA card */			if ((try < 32) && pcmcia_used_irq[irq])				continue;			/* register the correct driver, if possible, of check whether			 * registering a dummy handle works, i.e. if the IRQ isn't			 * marked as used by the kernel resource management core */			ret = request_irq(irq,					  (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Handler : test_action,					  ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) ||					   (s->functions > 1) ||					   (irq == s->pci_irq)) ? SA_SHIRQ : 0,					  p_dev->dev.bus_id,					  (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Instance : data);			if (!ret) {				if (!(req->Attributes & IRQ_HANDLE_PRESENT))					free_irq(irq, data);				break;			}		}	}#endif	if (ret) {		if (!s->pci_irq)			return ret;		irq = s->pci_irq;	}	if (ret && req->Attributes & IRQ_HANDLE_PRESENT) {		if (request_irq(irq, req->Handler,				((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) ||				 (s->functions > 1) ||				 (irq == s->pci_irq)) ? SA_SHIRQ : 0,				p_dev->dev.bus_id, req->Instance))			return CS_IN_USE;	}	c->irq.Attributes = req->Attributes;	s->irq.AssignedIRQ = req->AssignedIRQ = irq;	s->irq.Config++;	c->state |= CONFIG_IRQ_REQ;	handle->state |= CLIENT_IRQ_REQ;#ifdef CONFIG_PCMCIA_PROBE	pcmcia_used_irq[irq]++;#endif	return CS_SUCCESS;} /* pcmcia_request_irq */
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/2bc5a9bdc56fac6f7cbf95b89443e3809141c247/pcmcia_resource.c/buggy/drivers/pcmcia/pcmcia_resource.c