pcmcia: re-work pcmcia_request_irq()
Instead of the old pcmcia_request_irq() interface, drivers may now choose between: - calling request_irq/free_irq directly. Use the IRQ from *p_dev->irq. - use pcmcia_request_irq(p_dev, handler_t); the PCMCIA core will clean up automatically on calls to pcmcia_disable_device() or device ejection. - drivers still not capable of IRQF_SHARED (or not telling us so) may use the deprecated pcmcia_request_exclusive_irq() for the time being; they might receive a shared IRQ nonetheless. CC: linux-bluetooth@vger.kernel.org CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-serial@vger.kernel.org CC: alsa-devel@alsa-project.org CC: linux-usb@vger.kernel.org CC: linux-ide@vger.kernel.org Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
@@ -777,7 +777,7 @@ static void if_cs_release(struct pcmcia_device *p_dev)
|
||||
|
||||
lbs_deb_enter(LBS_DEB_CS);
|
||||
|
||||
free_irq(p_dev->irq.AssignedIRQ, card);
|
||||
free_irq(p_dev->irq, card);
|
||||
pcmcia_disable_device(p_dev);
|
||||
if (card->iobase)
|
||||
ioport_unmap(card->iobase);
|
||||
@@ -807,8 +807,7 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev,
|
||||
p_dev->io.NumPorts1 = cfg->io.win[0].len;
|
||||
|
||||
/* Do we need to allocate an interrupt? */
|
||||
if (cfg->irq.IRQInfo1)
|
||||
p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
|
||||
p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
|
||||
|
||||
/* IO window settings */
|
||||
if (cfg->io.nwin != 1) {
|
||||
@@ -837,9 +836,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
|
||||
card->p_dev = p_dev;
|
||||
p_dev->priv = card;
|
||||
|
||||
p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
|
||||
p_dev->irq.Handler = NULL;
|
||||
|
||||
p_dev->conf.Attributes = 0;
|
||||
p_dev->conf.IntType = INT_MEMORY_AND_IO;
|
||||
|
||||
@@ -854,13 +850,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
|
||||
* a handler to the interrupt, unless the 'Handler' member of
|
||||
* the irq structure is initialized.
|
||||
*/
|
||||
if (p_dev->conf.Attributes & CONF_ENABLE_IRQ) {
|
||||
ret = pcmcia_request_irq(p_dev, &p_dev->irq);
|
||||
if (ret) {
|
||||
lbs_pr_err("error in pcmcia_request_irq\n");
|
||||
goto out1;
|
||||
}
|
||||
}
|
||||
if (!p_dev->irq)
|
||||
goto out1;
|
||||
|
||||
/* Initialize io access */
|
||||
card->iobase = ioport_map(p_dev->io.BasePort1, p_dev->io.NumPorts1);
|
||||
@@ -883,7 +874,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
|
||||
|
||||
/* Finally, report what we've done */
|
||||
lbs_deb_cs("irq %d, io 0x%04x-0x%04x\n",
|
||||
p_dev->irq.AssignedIRQ, p_dev->io.BasePort1,
|
||||
p_dev->irq, p_dev->io.BasePort1,
|
||||
p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1);
|
||||
|
||||
/*
|
||||
@@ -940,7 +931,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
|
||||
priv->fw_ready = 1;
|
||||
|
||||
/* Now actually get the IRQ */
|
||||
ret = request_irq(p_dev->irq.AssignedIRQ, if_cs_interrupt,
|
||||
ret = request_irq(p_dev->irq, if_cs_interrupt,
|
||||
IRQF_SHARED, DRV_NAME, card);
|
||||
if (ret) {
|
||||
lbs_pr_err("error in request_irq\n");
|
||||
|
Reference in New Issue
Block a user