Combine the sanity checks for valid io addresses into one if().

Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
---
 drivers/staging/comedi/drivers/me4000.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/me4000.c 
b/drivers/staging/comedi/drivers/me4000.c
index f2c8d04..219ad6c 100644
--- a/drivers/staging/comedi/drivers/me4000.c
+++ b/drivers/staging/comedi/drivers/me4000.c
@@ -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;
-- 
1.7.11

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to