summaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/pcmcia_resource.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-03-07 10:51:23 +0100
committerDominik Brodowski <linux@dominikbrodowski.net>2010-05-10 10:23:12 +0200
commit6f840afb416748c15cf55c19b45c4870554c3af1 (patch)
tree3d162fe121b35e2c7392c201226c9599f068517b /drivers/pcmcia/pcmcia_resource.c
parentpcmcia: setup IRQ to be used by PCMCIA drivers at card insert (diff)
downloadlinux-6f840afb416748c15cf55c19b45c4870554c3af1.tar.xz
linux-6f840afb416748c15cf55c19b45c4870554c3af1.zip
pcmcia: replace struct irq with uint pcmcia_irq in struct pcmcia_socket
As we don't need the "Config" counter any more, we can simplify struct pcmcia_socket. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/pcmcia_resource.c')
-rw-r--r--drivers/pcmcia/pcmcia_resource.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index ff9c0bcb7e3a..cefc4cda9d3e 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -430,13 +430,10 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
dev_dbg(&s->dev, "IRQ attributes must match assigned ones\n");
goto out;
}
- if (s->irq.AssignedIRQ != req->AssignedIRQ) {
+ if (s->pcmcia_irq != req->AssignedIRQ) {
dev_dbg(&s->dev, "IRQ must match assigned one\n");
goto out;
}
- if (--s->irq.Config == 0) {
- c->state &= ~CONFIG_IRQ_REQ;
- }
if (req->Handler)
free_irq(req->AssignedIRQ, p_dev->priv);
@@ -533,7 +530,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
if (req->Attributes & CONF_ENABLE_SPKR)
s->socket.flags |= SS_SPKR_ENA;
if (req->Attributes & CONF_ENABLE_IRQ)
- s->socket.io_irq = s->irq.AssignedIRQ;
+ s->socket.io_irq = s->pcmcia_irq;
else
s->socket.io_irq = 0;
s->ops->set_socket(s, &s->socket);
@@ -556,7 +553,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
if (req->Present & PRESENT_IOBASE_0)
c->Option |= COR_ADDR_DECODE;
}
- if (c->state & CONFIG_IRQ_REQ)
+ if (req->Attributes & CONF_ENABLE_IRQ)
if (!(c->irq.Attributes & IRQ_FORCED_PULSE))
c->Option |= COR_LEVEL_REQ;
pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option);
@@ -711,10 +708,6 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
dev_dbg(&s->dev, "Configuration is locked\n");
goto out;
}
- if (c->state & CONFIG_IRQ_REQ) {
- dev_dbg(&s->dev, "IRQ already configured\n");
- goto out;
- }
if (!irq) {
dev_dbg(&s->dev, "no IRQ available\n");
@@ -723,8 +716,6 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
if (!(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) {
req->Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
- dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: "
- "request for exclusive IRQ could not be fulfilled.\n");
dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: the driver "
"needs updating to supported shared IRQ lines.\n");
}
@@ -741,9 +732,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
c->irq.Attributes = req->Attributes;
req->AssignedIRQ = irq;
- s->irq.Config++;
- c->state |= CONFIG_IRQ_REQ;
p_dev->_irq = 1;
ret = 0;
@@ -795,7 +784,7 @@ static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
p_dev);
if (!ret) {
free_irq(irq, p_dev);
- p_dev->irq_v = s->irq.AssignedIRQ = irq;
+ p_dev->irq_v = s->pcmcia_irq = irq;
pcmcia_used_irq[irq]++;
break;
}
@@ -806,8 +795,8 @@ static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
void pcmcia_cleanup_irq(struct pcmcia_socket *s)
{
- pcmcia_used_irq[s->irq.AssignedIRQ]--;
- s->irq.AssignedIRQ = 0;
+ pcmcia_used_irq[s->pcmcia_irq]--;
+ s->pcmcia_irq = 0;
}
#else /* CONFIG_PCMCIA_PROBE */
@@ -819,7 +808,7 @@ static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
void pcmcia_cleanup_irq(struct pcmcia_socket *s)
{
- s->irq.AssignedIRQ = 0;
+ s->pcmcia_irq = 0;
return;
}
@@ -840,8 +829,8 @@ int pcmcia_setup_irq(struct pcmcia_device *p_dev)
return 0;
/* already assigned? */
- if (s->irq.AssignedIRQ) {
- p_dev->irq_v = s->irq.AssignedIRQ;
+ if (s->pcmcia_irq) {
+ p_dev->irq_v = s->pcmcia_irq;
return 0;
}
@@ -855,7 +844,7 @@ int pcmcia_setup_irq(struct pcmcia_device *p_dev)
/* but use the PCI irq otherwise */
if (s->pci_irq) {
- p_dev->irq_v = s->irq.AssignedIRQ = s->pci_irq;
+ p_dev->irq_v = s->pcmcia_irq = s->pci_irq;
return 0;
}