Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325150
b: refs/heads/master
c: 43b9778
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 11, 2012
1 parent 1f6d508 commit 4c85807
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 13b2663c95f6f30f835ef92ef51c9aff0b3f09d6
refs/heads/master: 43b9778eeb789fbfad3ce66da3bbb3440440fbb8
20 changes: 20 additions & 0 deletions trunk/drivers/staging/comedi/drivers/comedi_fc.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,24 @@ static inline unsigned int cfc_bytes_per_scan(struct comedi_subdevice *subd)
return num_samples * bytes_per_sample(subd);
}

/**
* cfc_check_trigger_src() - trivially validate a comedi_cmd trigger source
* @src: pointer to the trigger source to validate
* @flags: bitmask of valid TRIG_* for the trigger
*
* This is used in "step 1" of the do_cmdtest functions of comedi drivers
* to vaildate the comedi_cmd triggers. The mask of the @src against the
* @flags allows the userspace comedilib to pass all the comedi_cmd
* triggers as TRIG_ANY and get back a bitmask of the valid trigger sources.
*/
static inline int cfc_check_trigger_src(unsigned int *src, unsigned int flags)
{
unsigned int orig_src = *src;

*src = orig_src & flags;
if (*src == TRIG_INVALID || *src != orig_src)
return -EINVAL;
return 0;
}

#endif /* _COMEDI_FC_H */

0 comments on commit 4c85807

Please sign in to comment.