mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-04 04:04:19 +00:00
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>
This commit is contained in:
parent
6f0f38c45a
commit
6f840afb41
@ -113,7 +113,7 @@ static int bfin_cf_get_status(struct pcmcia_socket *s, u_int *sp)
|
|||||||
|
|
||||||
if (bfin_cf_present(cf->cd_pfx)) {
|
if (bfin_cf_present(cf->cd_pfx)) {
|
||||||
*sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD;
|
*sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD;
|
||||||
s->irq.AssignedIRQ = 0;
|
s->pcmcia_irq = 0;
|
||||||
s->pci_irq = cf->irq;
|
s->pci_irq = cf->irq;
|
||||||
|
|
||||||
} else
|
} else
|
||||||
|
@ -94,7 +94,6 @@ int __ref cb_alloc(struct pcmcia_socket *s)
|
|||||||
pci_enable_bridges(bus);
|
pci_enable_bridges(bus);
|
||||||
pci_bus_add_devices(bus);
|
pci_bus_add_devices(bus);
|
||||||
|
|
||||||
s->irq.AssignedIRQ = s->pci_irq;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,7 +337,6 @@ static void socket_shutdown(struct pcmcia_socket *s)
|
|||||||
s->socket = dead_socket;
|
s->socket = dead_socket;
|
||||||
s->ops->init(s);
|
s->ops->init(s);
|
||||||
s->ops->set_socket(s, &s->socket);
|
s->ops->set_socket(s, &s->socket);
|
||||||
s->irq.AssignedIRQ = s->irq.Config = 0;
|
|
||||||
s->lock_count = 0;
|
s->lock_count = 0;
|
||||||
kfree(s->fake_cis);
|
kfree(s->fake_cis);
|
||||||
s->fake_cis = NULL;
|
s->fake_cis = NULL;
|
||||||
|
@ -117,7 +117,7 @@ static int omap_cf_get_status(struct pcmcia_socket *s, u_int *sp)
|
|||||||
|
|
||||||
*sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD;
|
*sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD;
|
||||||
cf = container_of(s, struct omap_cf_socket, socket);
|
cf = container_of(s, struct omap_cf_socket, socket);
|
||||||
s->irq.AssignedIRQ = 0;
|
s->pcmcia_irq = 0;
|
||||||
s->pci_irq = cf->irq;
|
s->pci_irq = cf->irq;
|
||||||
} else
|
} else
|
||||||
*sp = 0;
|
*sp = 0;
|
||||||
|
@ -351,7 +351,7 @@ static int pccard_get_configuration_info(struct pcmcia_socket *s,
|
|||||||
if (s->state & SOCKET_CARDBUS_CONFIG) {
|
if (s->state & SOCKET_CARDBUS_CONFIG) {
|
||||||
config->Attributes = CONF_VALID_CLIENT;
|
config->Attributes = CONF_VALID_CLIENT;
|
||||||
config->IntType = INT_CARDBUS;
|
config->IntType = INT_CARDBUS;
|
||||||
config->AssignedIRQ = s->irq.AssignedIRQ;
|
config->AssignedIRQ = s->pcmcia_irq;
|
||||||
if (config->AssignedIRQ)
|
if (config->AssignedIRQ)
|
||||||
config->Attributes |= CONF_ENABLE_IRQ;
|
config->Attributes |= CONF_ENABLE_IRQ;
|
||||||
if (s->io[0].res) {
|
if (s->io[0].res) {
|
||||||
@ -391,7 +391,7 @@ static int pccard_get_configuration_info(struct pcmcia_socket *s,
|
|||||||
config->ExtStatus = c->ExtStatus;
|
config->ExtStatus = c->ExtStatus;
|
||||||
config->Present = config->CardValues = c->CardValues;
|
config->Present = config->CardValues = c->CardValues;
|
||||||
config->IRQAttributes = c->irq.Attributes;
|
config->IRQAttributes = c->irq.Attributes;
|
||||||
config->AssignedIRQ = s->irq.AssignedIRQ;
|
config->AssignedIRQ = s->pcmcia_irq;
|
||||||
config->BasePort1 = c->io.BasePort1;
|
config->BasePort1 = c->io.BasePort1;
|
||||||
config->NumPorts1 = c->io.NumPorts1;
|
config->NumPorts1 = c->io.NumPorts1;
|
||||||
config->Attributes1 = c->io.Attributes1;
|
config->Attributes1 = c->io.Attributes1;
|
||||||
|
@ -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");
|
dev_dbg(&s->dev, "IRQ attributes must match assigned ones\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (s->irq.AssignedIRQ != req->AssignedIRQ) {
|
if (s->pcmcia_irq != req->AssignedIRQ) {
|
||||||
dev_dbg(&s->dev, "IRQ must match assigned one\n");
|
dev_dbg(&s->dev, "IRQ must match assigned one\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (--s->irq.Config == 0) {
|
|
||||||
c->state &= ~CONFIG_IRQ_REQ;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (req->Handler)
|
if (req->Handler)
|
||||||
free_irq(req->AssignedIRQ, p_dev->priv);
|
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)
|
if (req->Attributes & CONF_ENABLE_SPKR)
|
||||||
s->socket.flags |= SS_SPKR_ENA;
|
s->socket.flags |= SS_SPKR_ENA;
|
||||||
if (req->Attributes & CONF_ENABLE_IRQ)
|
if (req->Attributes & CONF_ENABLE_IRQ)
|
||||||
s->socket.io_irq = s->irq.AssignedIRQ;
|
s->socket.io_irq = s->pcmcia_irq;
|
||||||
else
|
else
|
||||||
s->socket.io_irq = 0;
|
s->socket.io_irq = 0;
|
||||||
s->ops->set_socket(s, &s->socket);
|
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)
|
if (req->Present & PRESENT_IOBASE_0)
|
||||||
c->Option |= COR_ADDR_DECODE;
|
c->Option |= COR_ADDR_DECODE;
|
||||||
}
|
}
|
||||||
if (c->state & CONFIG_IRQ_REQ)
|
if (req->Attributes & CONF_ENABLE_IRQ)
|
||||||
if (!(c->irq.Attributes & IRQ_FORCED_PULSE))
|
if (!(c->irq.Attributes & IRQ_FORCED_PULSE))
|
||||||
c->Option |= COR_LEVEL_REQ;
|
c->Option |= COR_LEVEL_REQ;
|
||||||
pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &c->Option);
|
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");
|
dev_dbg(&s->dev, "Configuration is locked\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (c->state & CONFIG_IRQ_REQ) {
|
|
||||||
dev_dbg(&s->dev, "IRQ already configured\n");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!irq) {
|
if (!irq) {
|
||||||
dev_dbg(&s->dev, "no IRQ available\n");
|
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)) {
|
if (!(req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)) {
|
||||||
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 "
|
dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: the driver "
|
||||||
"needs updating to supported shared IRQ lines.\n");
|
"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;
|
c->irq.Attributes = req->Attributes;
|
||||||
req->AssignedIRQ = irq;
|
req->AssignedIRQ = irq;
|
||||||
s->irq.Config++;
|
|
||||||
|
|
||||||
c->state |= CONFIG_IRQ_REQ;
|
|
||||||
p_dev->_irq = 1;
|
p_dev->_irq = 1;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -795,7 +784,7 @@ static int pcmcia_setup_isa_irq(struct pcmcia_device *p_dev, int type)
|
|||||||
p_dev);
|
p_dev);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
free_irq(irq, p_dev);
|
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]++;
|
pcmcia_used_irq[irq]++;
|
||||||
break;
|
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)
|
void pcmcia_cleanup_irq(struct pcmcia_socket *s)
|
||||||
{
|
{
|
||||||
pcmcia_used_irq[s->irq.AssignedIRQ]--;
|
pcmcia_used_irq[s->pcmcia_irq]--;
|
||||||
s->irq.AssignedIRQ = 0;
|
s->pcmcia_irq = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* CONFIG_PCMCIA_PROBE */
|
#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)
|
void pcmcia_cleanup_irq(struct pcmcia_socket *s)
|
||||||
{
|
{
|
||||||
s->irq.AssignedIRQ = 0;
|
s->pcmcia_irq = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -840,8 +829,8 @@ int pcmcia_setup_irq(struct pcmcia_device *p_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* already assigned? */
|
/* already assigned? */
|
||||||
if (s->irq.AssignedIRQ) {
|
if (s->pcmcia_irq) {
|
||||||
p_dev->irq_v = s->irq.AssignedIRQ;
|
p_dev->irq_v = s->pcmcia_irq;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -855,7 +844,7 @@ int pcmcia_setup_irq(struct pcmcia_device *p_dev)
|
|||||||
|
|
||||||
/* but use the PCI irq otherwise */
|
/* but use the PCI irq otherwise */
|
||||||
if (s->pci_irq) {
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,10 +141,6 @@ struct pcmcia_socket {
|
|||||||
u_short lock_count;
|
u_short lock_count;
|
||||||
pccard_mem_map cis_mem;
|
pccard_mem_map cis_mem;
|
||||||
void __iomem *cis_virt;
|
void __iomem *cis_virt;
|
||||||
struct {
|
|
||||||
u_int AssignedIRQ;
|
|
||||||
u_int Config;
|
|
||||||
} irq;
|
|
||||||
io_window_t io[MAX_IO_WIN];
|
io_window_t io[MAX_IO_WIN];
|
||||||
pccard_mem_map win[MAX_WIN];
|
pccard_mem_map win[MAX_WIN];
|
||||||
struct list_head cis_cache;
|
struct list_head cis_cache;
|
||||||
@ -235,6 +231,9 @@ struct pcmcia_socket {
|
|||||||
/* non-zero if PCMCIA card is present */
|
/* non-zero if PCMCIA card is present */
|
||||||
atomic_t present;
|
atomic_t present;
|
||||||
|
|
||||||
|
/* IRQ to be used by PCMCIA devices. May not be IRQ 0. */
|
||||||
|
unsigned int pcmcia_irq;
|
||||||
|
|
||||||
#ifdef CONFIG_PCMCIA_IOCTL
|
#ifdef CONFIG_PCMCIA_IOCTL
|
||||||
struct user_info_t *user;
|
struct user_info_t *user;
|
||||||
wait_queue_head_t queue;
|
wait_queue_head_t queue;
|
||||||
|
Loading…
Reference in New Issue
Block a user