diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-04-18 14:34:37 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-19 11:19:54 -0700 |
commit | 3d1fe3f785c80e17f62acf8f92570ae9210bd588 (patch) | |
tree | d20f806696abf44f8504824777feff14cf2c6ae7 /drivers/staging/comedi/drivers/dt2811.c | |
parent | a32c6d0084992d3e58a93120c9ce9527e80c651e (diff) |
staging: comedi: drivers: free_irq() in comedi_legacy_detach()
All the legacy comedi drivers now call comedi_legacy_detach()
either directly or as part of their (*detach). Move the free_irq()
into comedi_legacy_detach() so that the drivers don't have to
deal with it.
For drivers that then only call comedi_legacy_detach() in their
private (*detach), remove the private function and use the helper
directly for the (*detach).
The amplc_pc236 and ni_labpc drivers are hybrid legacy/PCI drivers.
In the detach of a PCI board free_irq() still needs to be handled
by the driver.
The pcl724 and pcl726 drivers currently have the free_irq() #ifdef'ed
out. The comedi_legacy_detach() function sanity checks that the irq
has been requested before freeing it so they are safe to convert.
For aesthetic reasons, move the #ifdef unused chunk in the pcl816
driver up to the previous #ifdef unused block.
The pcmio and pcmuio drivers request multiple irqs and handle the
freeing of them. Remove the 'dev->irq = irq[0]' in those drivers
so that comedi_legacy_detach() does not attempt to free the irq.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/dt2811.c')
-rw-r--r-- | drivers/staging/comedi/drivers/dt2811.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/staging/comedi/drivers/dt2811.c b/drivers/staging/comedi/drivers/dt2811.c index e878059e6a24..8757b54ad4ac 100644 --- a/drivers/staging/comedi/drivers/dt2811.c +++ b/drivers/staging/comedi/drivers/dt2811.c @@ -556,13 +556,6 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it) 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", @@ -581,7 +574,7 @@ static struct comedi_driver dt2811_driver = { .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), |