staging: comedi: me4000: combine the checks for valid io addresses
authorH Hartley Sweeten <hartleys@visionengravers.com>
Sat, 8 Sep 2012 00:48:26 +0000 (17:48 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Sep 2012 04:54:42 +0000 (21:54 -0700)
Combine the sanity checks for valid io addresses into one if().

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/me4000.c

index f2c8d040f1f8c867a104072c48702f073bd952d6..219ad6c5a174149a3cfdc347bfa4c253c5c26b60 100644 (file)
@@ -1776,15 +1776,9 @@ static int me4000_attach_pci(struct comedi_device *dev,
                return result;
 
        info->plx_regbase = pci_resource_start(pcidev, 1);
-       if (!info->plx_regbase)
-               return -ENODEV;
-
        dev->iobase = pci_resource_start(pcidev, 2);
-       if (!dev->iobase)
-               return -ENODEV;
-
        info->timer_regbase = pci_resource_start(pcidev, 3);
-       if (!info->timer_regbase)
+       if (!info->plx_regbase || !dev->iobase || !info->timer_regbase)
                return -ENODEV;
 
        dev->irq = pcidev->irq;