#include <linux/cdev.h>
#include <linux/dma-mapping.h>
#include <linux/io.h>
+#include <linux/interrupt.h>
#include "comedidev.h"
#include "comedi_internal.h"
*/
void comedi_legacy_detach(struct comedi_device *dev)
{
+ if (dev->irq) {
+ free_irq(dev->irq, dev);
+ dev->irq = 0;
+ }
if (dev->iobase && dev->iolen) {
release_region(dev->iobase, dev->iolen);
dev->iobase = 0;
return;
if (dev->iobase)
pc236_intr_disable(dev);
- if (dev->irq)
- free_irq(dev->irq, dev);
comedi_spriv_free(dev, 0);
if (is_isa_board(thisboard)) {
comedi_legacy_detach(dev);
} else if (is_pci_board(thisboard)) {
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
+ if (dev->irq)
+ free_irq(dev->irq, dev);
comedi_pci_disable(dev);
if (pcidev)
pci_dev_put(pcidev);
return 0;
}
-static void parport_detach(struct comedi_device *dev)
-{
- if (dev->irq)
- free_irq(dev->irq, dev);
- comedi_legacy_detach(dev);
-}
-
static struct comedi_driver parport_driver = {
.driver_name = "comedi_parport",
.module = THIS_MODULE,
.attach = parport_attach,
- .detach = parport_detach,
+ .detach = comedi_legacy_detach,
};
module_comedi_driver(parport_driver);
kfree(devpriv->user_ai_range_table);
kfree(devpriv->user_ao_range_table);
}
- if (dev->irq)
- free_irq(dev->irq, dev);
if (devpriv->extra_iobase)
release_region(devpriv->extra_iobase, board->size & 0x3ff);
comedi_legacy_detach(dev);
struct das16m1_private_struct *devpriv = dev->private;
comedi_spriv_free(dev, 3);
- if (dev->irq)
- free_irq(dev->irq, dev);
if (devpriv && devpriv->extra_iobase)
release_region(devpriv->extra_iobase, DAS16M1_SIZE2);
comedi_legacy_detach(dev);
{
struct das1800_private *devpriv = dev->private;
- if (dev->irq)
- free_irq(dev->irq, dev);
if (devpriv) {
if (devpriv->dma0)
free_dma(devpriv->dma0);
return 0;
}
-static void das6402_detach(struct comedi_device *dev)
-{
- if (dev->irq)
- free_irq(dev->irq, dev);
- comedi_legacy_detach(dev);
-}
-
static struct comedi_driver das6402_driver = {
.driver_name = "das6402",
.module = THIS_MODULE,
.attach = das6402_attach,
- .detach = das6402_detach,
+ .detach = comedi_legacy_detach,
};
module_comedi_driver(das6402_driver)
static int das800_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
-static void das800_detach(struct comedi_device *dev);
static int das800_cancel(struct comedi_device *dev, struct comedi_subdevice *s);
static struct comedi_driver driver_das800 = {
.driver_name = "das800",
.module = THIS_MODULE,
.attach = das800_attach,
- .detach = das800_detach,
+ .detach = comedi_legacy_detach,
.num_names = ARRAY_SIZE(das800_boards),
.board_name = &das800_boards[0].name,
.offset = sizeof(struct das800_board),
return 0;
};
-static void das800_detach(struct comedi_device *dev)
-{
- if (dev->irq)
- free_irq(dev->irq, dev);
- comedi_legacy_detach(dev);
-}
-
static int das800_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
{
struct das800_private *devpriv = dev->private;
}
-static void dmm32at_detach(struct comedi_device *dev)
-{
- if (dev->irq)
- free_irq(dev->irq, dev);
- comedi_legacy_detach(dev);
-}
-
static struct comedi_driver dmm32at_driver = {
.driver_name = "dmm32at",
.module = THIS_MODULE,
.attach = dmm32at_attach,
- .detach = dmm32at_detach,
+ .detach = comedi_legacy_detach,
};
module_comedi_driver(dmm32at_driver);
return 0;
}
-static void dt2811_detach(struct comedi_device *dev)
-{
- if (dev->irq)
- free_irq(dev->irq, dev);
- comedi_legacy_detach(dev);
-}
-
static const struct dt2811_board boardtypes[] = {
{
.name = "dt2811-pgh",
.driver_name = "dt2811",
.module = THIS_MODULE,
.attach = dt2811_attach,
- .detach = dt2811_detach,
+ .detach = comedi_legacy_detach,
.board_name = &boardtypes[0].name,
.num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct dt2811_board),
return 0;
}
-static void dt2814_detach(struct comedi_device *dev)
-{
- if (dev->irq)
- free_irq(dev->irq, dev);
- comedi_legacy_detach(dev);
-}
-
static struct comedi_driver dt2814_driver = {
.driver_name = "dt2814",
.module = THIS_MODULE,
.attach = dt2814_attach,
- .detach = dt2814_detach,
+ .detach = comedi_legacy_detach,
};
module_comedi_driver(dt2814_driver);
{
struct dt282x_private *devpriv = dev->private;
- if (dev->irq)
- free_irq(dev->irq, dev);
if (dev->private) {
if (devpriv->dma[0].chan)
free_dma(devpriv->dma[0].chan);
if (dev->iobase)
outw(APD_BIT | DPD_BIT, dev->iobase + CONFIG_REG);
- if (dev->irq)
- free_irq(dev->irq, dev);
if (devpriv) {
if (devpriv->dma)
free_dma(devpriv->dma);
struct ni_private *devpriv = dev->private;
mio_common_detach(dev);
- if (dev->irq)
- free_irq(dev->irq, dev);
comedi_legacy_detach(dev);
if (devpriv->isapnp_dev)
pnp_device_detach(devpriv->isapnp_dev);
static void atmio16d_detach(struct comedi_device *dev)
{
comedi_spriv_free(dev, 3);
- if (dev->irq)
- free_irq(dev->irq, dev);
reset_atmio16d(dev);
comedi_legacy_detach(dev);
}
if (devpriv->dma_chan)
free_dma(devpriv->dma_chan);
#endif
- if (dev->irq)
- free_irq(dev->irq, dev);
if (board->bustype == isa_bustype)
comedi_legacy_detach(dev);
#ifdef CONFIG_COMEDI_PCI_DRIVERS
mite_unsetup(devpriv->mite);
mite_free(devpriv->mite);
}
- if (board->bustype == pci_bustype)
+ if (board->bustype == pci_bustype) {
+ if (dev->irq)
+ free_irq(dev->irq, dev);
comedi_pci_disable(dev);
+ }
#endif
}
EXPORT_SYMBOL_GPL(labpc_common_detach);
return 0;
}
-static void pcl711_detach(struct comedi_device *dev)
-{
- if (dev->irq)
- free_irq(dev->irq, dev);
- comedi_legacy_detach(dev);
-}
-
static const struct pcl711_board boardtypes[] = {
{ "pcl711", 0, 0, 0, 5, 8, 1, 0, &range_bipolar5 },
{ "pcl711b", 1, 0, 0, 5, 8, 1, 7, &range_pcl711b_ai },
.driver_name = "pcl711",
.module = THIS_MODULE,
.attach = pcl711_attach,
- .detach = pcl711_detach,
+ .detach = comedi_legacy_detach,
.board_name = &boardtypes[0].name,
.num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct pcl711_board),
for (i = 0; i < dev->n_subdevices; i++)
comedi_spriv_free(dev, i);
-#ifdef PCL724_IRQ
- if (dev->irq)
- free_irq(dev->irq, dev);
-#endif
comedi_legacy_detach(dev);
}
return 0;
}
-static void pcl726_detach(struct comedi_device *dev)
-{
-#ifdef ACL6126_IRQ
- if (dev->irq)
- free_irq(dev->irq, dev);
-#endif
- comedi_legacy_detach(dev);
-}
-
static struct comedi_driver pcl726_driver = {
.driver_name = "pcl726",
.module = THIS_MODULE,
.attach = pcl726_attach,
- .detach = pcl726_detach,
+ .detach = comedi_legacy_detach,
.board_name = &boardtypes[0].name,
.num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct pcl726_board),
if (devpriv->dma)
free_dma(devpriv->dma);
}
- if (dev->irq)
- free_irq(dev->irq, dev);
comedi_legacy_detach(dev);
}
release_region(devpriv->rtc_iobase,
devpriv->rtc_iosize);
}
+ if (devpriv->dma_rtc)
+ RTC_lock--;
#endif
}
- if (dev->irq)
- free_irq(dev->irq, dev);
-#ifdef unused
- if (devpriv->dma_rtc)
- RTC_lock--;
-#endif
comedi_legacy_detach(dev);
}
RTC_lock--;
#endif
}
- if (dev->irq)
- free_irq(dev->irq, dev);
comedi_legacy_detach(dev);
}
return 0;
}
-static void pcmad_detach(struct comedi_device *dev)
-{
- if (dev->irq)
- free_irq(dev->irq, dev);
- comedi_legacy_detach(dev);
-}
-
static const struct pcmad_board_struct pcmad_boards[] = {
{
.name = "pcmad12",
.driver_name = "pcmad",
.module = THIS_MODULE,
.attach = pcmad_attach,
- .detach = pcmad_detach,
+ .detach = comedi_legacy_detach,
.board_name = &pcmad_boards[0].name,
.num_names = ARRAY_SIZE(pcmad_boards),
.offset = sizeof(pcmad_boards[0]),
devpriv->asics[asic].irq = irq[asic];
}
- dev->irq = irq[0]; /*
- * grr.. wish comedi dev struct supported
- * multiple irqs..
- */
-
return 1;
}
devpriv->asics[asic].irq = irq[asic];
}
- dev->irq = irq[0]; /* grr.. wish comedi dev struct supported multiple
- irqs.. */
-
if (irq[0]) {
dev_dbg(dev->class_dev, "irq: %u\n", irq[0]);
if (irq[1] && board->num_asics == 2)