comedi vmk80xx: extend rudimentary_check to check both directions
authorJ. Ali Harlow <ali@avrc.city.ac.uk>
Wed, 18 May 2011 18:18:54 +0000 (19:18 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 18 May 2011 21:32:06 +0000 (14:32 -0700)
rudimentary_check() can currently check whether the input or
output direction is currently available (no pending transaction),
but not both at the same time. We need this facility for do_bits().

Signed-off-by: J. Ali Harlow <ali@avrc.city.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/comedi/drivers/vmk80xx.c

index c86c8664101b69de101a3cbd8135bbfabfb6118e..669ebf85f57529a843bcf9f4f7a1561ab8b97d32 100644 (file)
@@ -568,7 +568,8 @@ static int rudimentary_check(struct vmk80xx_usb *dev, int dir)
        if (dir & DIR_IN) {
                if (test_bit(TRANS_IN_BUSY, &dev->flags))
                        return -EBUSY;
-       } else {  /* DIR_OUT */
+       }
+       if (dir & DIR_OUT) {
                if (test_bit(TRANS_OUT_BUSY, &dev->flags))
                        return -EBUSY;
        }