pcl816: In pcl816_ai_cmdtest(), correct step 1 test for valid convert_src
authorIan Abbott <abbotti@mev.co.uk>
Thu, 19 Nov 2009 11:21:51 +0000 (11:21 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Thu, 19 Nov 2009 11:21:51 +0000 (11:21 +0000)
(operator precedence error).

comedi/drivers/pcl816.c

index 3d1b1bd063825bf6a54b040a20734d9cf007cca7..bd62f653209e67b369ebc9c8603131e18ded6a7f 100644 (file)
@@ -478,7 +478,9 @@ static int pcl816_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
        if (!cmd->scan_begin_src || tmp != cmd->scan_begin_src)
                err++;
 
-       if (!cmd->convert_src & (TRIG_EXT | TRIG_TIMER))
+       tmp = cmd->convert_src;
+       cmd->convert_src &= TRIG_EXT | TRIG_TIMER;
+       if (!cmd->convert_src || tmp != cmd->convert_src)
                err++;
 
        tmp = cmd->scan_end_src;