staging: comedi: me_daq: pass on the error from comedi_pci_enable()
authorH Hartley Sweeten <hartleys@visionengravers.com>
Thu, 25 Oct 2012 22:06:37 +0000 (15:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Oct 2012 16:20:01 +0000 (09:20 -0700)
Instead of returning -EIO when comedi_pci_enable() fails, pass on
the actual error code. Also, remove the kernel noise when the
function fails.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/me_daq.c

index aedc509280832b1ff24b246c87c39acc987e5bce..95fbecc4929324fad6826d05fd3409d305448303 100644 (file)
@@ -653,12 +653,9 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
                return -ENOMEM;
        dev->private = dev_private;
 
-       /* Enable PCI device and request PCI regions */
-       if (comedi_pci_enable(pcidev, dev->board_name) < 0) {
-               dev_err(dev->class_dev,
-                       "Failed to enable PCI device and request regions\n");
-               return -EIO;
-       }
+       ret = comedi_pci_enable(pcidev, dev->board_name);
+       if (ret)
+               return ret;
        dev->iobase = 1;        /* detach needs this */
 
        /* Read PLX register base address [PCI_BASE_ADDRESS #0]. */