On 2014-09-09 00:18, H Hartley Sweeten wrote:
In order for DMA to work we also need an interrupt. Refactor the code
so that the DMA allocation is only done if the interrupt is available.

Signed-off-by: H Hartley Sweeten <hswee...@visionengravers.com>
Cc: Ian Abbott <abbo...@mev.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
  drivers/staging/comedi/drivers/adl_pci9118.c | 19 ++++++++++---------
  1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
b/drivers/staging/comedi/drivers/adl_pci9118.c
index 7a55c9c..f924ad9 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -1775,8 +1775,16 @@ static int pci9118_common_attach(struct comedi_device 
*dev, int disable_irq,

        pci9118_reset(dev);

-       if (master)
-               pci9118_alloc_dma(dev);
+       if (!disable_irq && pcidev->irq) {
+               ret = request_irq(pcidev->irq, pci9118_interrupt, IRQF_SHARED,
+                                 dev->board_name, dev);
+               if (ret == 0) {
+                       dev->irq = pcidev->irq;
+
+                       if (master)
+                               pci9118_alloc_dma(dev);
+               }
+       }

Are we missing a patch series? I can't see when pci9118_alloc_dma() was introduced in previous patch series.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbo...@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to