staging: comedi: drivers: use dev->board_name in request_irq()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Sat, 19 Jul 2014 00:01:24 +0000 (17:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Jul 2014 21:43:01 +0000 (14:43 -0700)
Most of the comedi drivers use the dev->board_name for the id string
passed to request_irq(). Fix the couple that still pass something
else.

Also, propogate the errno from request_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>
drivers/staging/comedi/drivers/cb_pcidas.c
drivers/staging/comedi/drivers/cb_pcidas64.c
drivers/staging/comedi/drivers/ni_660x.c
drivers/staging/comedi/drivers/ni_atmio.c

index 8e82383d2fb85777c46d83d4dae4e301565a9745..4a7bd4e5dd72f387acd48886541a7bffd1e19b63 100644 (file)
@@ -1471,11 +1471,12 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev,
        outl(INTCSR_INBOX_INTR_STATUS,
             devpriv->s5933_config + AMCC_OP_REG_INTCSR);
 
-       if (request_irq(pcidev->irq, cb_pcidas_interrupt,
-                       IRQF_SHARED, dev->driver->driver_name, dev)) {
+       ret = request_irq(pcidev->irq, cb_pcidas_interrupt, IRQF_SHARED,
+                         dev->board_name, dev);
+       if (ret) {
                dev_dbg(dev->class_dev, "unable to allocate irq %d\n",
                        pcidev->irq);
-               return -EINVAL;
+               return ret;
        }
        dev->irq = pcidev->irq;
 
index 4012d8cba121a5ad2cba0673d12ceebf523e98b0..4b332ddec022ebebf2e54246a62d7e30da6ce3a3 100644 (file)
@@ -3989,12 +3989,13 @@ static int auto_attach(struct comedi_device *dev,
                devpriv->hw_revision);
        init_plx9080(dev);
        init_stc_registers(dev);
-       /*  get irq */
-       if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
-                       "cb_pcidas64", dev)) {
+
+       retval = request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
+                            dev->board_name, dev);
+       if (retval) {
                dev_dbg(dev->class_dev, "unable to allocate irq %u\n",
                        pcidev->irq);
-               return -EINVAL;
+               return retval;
        }
        dev->irq = pcidev->irq;
        dev_dbg(dev->class_dev, "irq %u\n", dev->irq);
index f0580568d53a6c57935b33e87565c4a1e7449341..6b8c702f20080ddb4bd9ff9e709c07146a446b22 100644 (file)
@@ -1165,8 +1165,8 @@ static int ni_660x_auto_attach(struct comedi_device *dev,
        for (i = 0; i < board->n_chips; ++i)
                set_tio_counterswap(dev, i);
 
-       ret = request_irq(pcidev->irq, ni_660x_interrupt,
-                         IRQF_SHARED, "ni_660x", dev);
+       ret = request_irq(pcidev->irq, ni_660x_interrupt, IRQF_SHARED,
+                         dev->board_name, dev);
        if (ret < 0) {
                dev_warn(dev->class_dev, " irq not available\n");
                return ret;
index c1292db643c2c355314ccf4630620b6c8d43bbc6..2bd9f692a7ae5bd2b73b022bf3b66fde29eef8ce 100644 (file)
@@ -345,8 +345,7 @@ static int ni_atmio_attach(struct comedi_device *dev,
                if (irq > 15 || ni_irqpin[irq] == -1)
                        return -EINVAL;
                ret = request_irq(irq, ni_E_interrupt, 0,
-                                 "ni_atmio", dev);
-
+                                 dev->board_name, dev);
                if (ret < 0)
                        return -EINVAL;
                dev->irq = irq;