Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb83abed authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: amplc_dio200: remove dio200_common_detach()



This exported function just does a free_irq() to release the interrupt
handler for the legacy and PCI dio200 drivers.

The legacy driver also calls comedi_legacy_detach() which would also
do the free_irq(). For that driver the just use comedi_legacy_detach()
directly for the (*detach).

For the PCI driver, add the free_irq() to the private (*datach) function.

Remove the, then unused, dio200_common_detach() function.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 294de579
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -257,17 +257,11 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
	return amplc_dio200_common_attach(dev, it->options[1], 0);
}

static void dio200_detach(struct comedi_device *dev)
{
	amplc_dio200_common_detach(dev);
	comedi_legacy_detach(dev);
}

static struct comedi_driver amplc_dio200_driver = {
	.driver_name	= "amplc_dio200",
	.module		= THIS_MODULE,
	.attach		= dio200_attach,
	.detach		= dio200_detach,
	.detach		= comedi_legacy_detach,
	.board_name	= &dio200_isa_boards[0].name,
	.offset		= sizeof(struct dio200_board),
	.num_names	= ARRAY_SIZE(dio200_isa_boards),
+0 −2
Original line number Diff line number Diff line
@@ -45,8 +45,6 @@ struct dio200_board {
int amplc_dio200_common_attach(struct comedi_device *dev, unsigned int irq,
			       unsigned long req_irq_flags);

void amplc_dio200_common_detach(struct comedi_device *dev);

/* Used by initialization of PCIe boards. */
void amplc_dio200_set_enhance(struct comedi_device *dev, unsigned char val);

+0 −9
Original line number Diff line number Diff line
@@ -1055,15 +1055,6 @@ int amplc_dio200_common_attach(struct comedi_device *dev, unsigned int irq,
}
EXPORT_SYMBOL_GPL(amplc_dio200_common_attach);

void amplc_dio200_common_detach(struct comedi_device *dev)
{
	if (dev->irq) {
		free_irq(dev->irq, dev);
		dev->irq = 0;
	}
}
EXPORT_SYMBOL_GPL(amplc_dio200_common_detach);

static int __init amplc_dio200_common_init(void)
{
	return 0;
+2 −1
Original line number Diff line number Diff line
@@ -389,7 +389,8 @@ static int dio200_pci_auto_attach(struct comedi_device *dev,

static void dio200_pci_detach(struct comedi_device *dev)
{
	amplc_dio200_common_detach(dev);
	if (dev->irq)
		free_irq(dev->irq, dev);
	if (dev->mmio)
		iounmap(dev->mmio);
	comedi_pci_disable(dev);