X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fpcmcia%2Fpcmcia_resource.c;h=89022ad5b5207eeac9b90898478f8e49b4088174;hb=b24fd48a0b9afe9a16bec94ab10d7e83c1b57ce6;hp=184f4f88b2a0b46c9a406fe962104e94513041d3;hpb=327309e899662b482c58cf25f574513d38b5788c;p=powerpc.git diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index 184f4f88b2..89022ad5b5 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -41,6 +41,7 @@ module_param(io_speed, int, 0444); #ifdef CONFIG_PCMCIA_PROBE +#include /* mask of IRQs already reserved by other cards, we should avoid using them */ static u8 pcmcia_used_irq[NR_IRQS]; #endif @@ -446,7 +447,7 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev, (mod->Attributes & CONF_VPP2_CHANGE_VALID)) { if (mod->Vpp1 != mod->Vpp2) return CS_BAD_VPP; - c->Vpp1 = c->Vpp2 = s->socket.Vpp = mod->Vpp1; + s->socket.Vpp = mod->Vpp1; if (s->ops->set_socket(s, &s->socket)) return CS_BAD_VPP; } else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) || @@ -622,8 +623,6 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, if (s->ops->set_socket(s, &s->socket)) return CS_BAD_VPP; - c->Vcc = req->Vcc; c->Vpp1 = c->Vpp2 = req->Vpp1; - /* Pick memory or I/O card, DMA mode, interrupt */ c->IntType = req->IntType; c->Attributes = req->Attributes; @@ -800,7 +799,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) } else { int try; u32 mask = s->irq_mask; - void *data = NULL; + void *data = &p_dev->dev.driver; /* something unique to this device */ for (try = 0; try < 64; try++) { irq = try % 32; @@ -821,7 +820,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) || (s->functions > 1) || (irq == s->pci_irq)) ? SA_SHIRQ : 0, - p_dev->dev.bus_id, + p_dev->devname, (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Instance : data); if (!ret) { if (!(req->Attributes & IRQ_HANDLE_PRESENT)) @@ -831,7 +830,8 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) } } #endif - if (ret) { + /* only assign PCI irq if no IRQ already assigned */ + if (ret && !s->irq.AssignedIRQ) { if (!s->pci_irq) return ret; irq = s->pci_irq; @@ -842,7 +842,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) || (s->functions > 1) || (irq == s->pci_irq)) ? SA_SHIRQ : 0, - p_dev->dev.bus_id, req->Instance)) + p_dev->devname, req->Instance)) return CS_IN_USE; }