staging: comedi: addi_apci_3120: reset the board before hooking up the interrupt
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 20 Oct 2014 18:34:27 +0000 (11:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2014 07:58:37 +0000 (15:58 +0800)
Move the apci3120_reset() call in the (*auto_attach) to ensure that the board
is reset before hooking up the interrupt.

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>
drivers/staging/comedi/drivers/addi_apci_3120.c

index ec6f89b9e99c0925022c5e5d9532ed9a8fcf6569..3b4fa2ebbc85d3ca98f74a884dc746aea362812d 100644 (file)
@@ -154,6 +154,8 @@ static int apci3120_auto_attach(struct comedi_device *dev,
        devpriv->amcc = pci_resource_start(pcidev, 0);
        devpriv->addon = pci_resource_start(pcidev, 2);
 
+       apci3120_reset(dev);
+
        if (pcidev->irq > 0) {
                ret = request_irq(pcidev->irq, apci3120_interrupt, IRQF_SHARED,
                                  dev->board_name, dev);
@@ -232,7 +234,6 @@ static int apci3120_auto_attach(struct comedi_device *dev,
        s->insn_read    = apci3120_read_insn_timer;
        s->insn_config  = apci3120_config_insn_timer;
 
-       apci3120_reset(dev);
        return 0;
 }