Staging: comedi: pcl816: update convert_src mask for AI cmdtest
authorIan Abbott <abbotti@mev.co.uk>
Fri, 20 Nov 2009 11:32:38 +0000 (11:32 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Dec 2009 20:23:04 +0000 (12:23 -0800)
The COMEDI_CMDTEST ioctl needs to clear unsupported bits in the
struct comedi_cmd's convert_src and other *_src members.  This
needs fixing in the pcl816 driver's AI cmdtest.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/comedi/drivers/pcl816.c

index f9a0dac79eca40531490416ec89566c41d6257e6..1b1708a58b677c265fe3c0684e20210bf44d0a07 100644 (file)
@@ -488,7 +488,9 @@ static int pcl816_ai_cmdtest(struct comedi_device *dev,
        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;