Module: xenomai-abe Branch: analogy Commit: 97c1a4a04d032dffaf92b9507aa305e18cc514d5 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=97c1a4a04d032dffaf92b9507aa305e18cc514d5
Author: Alexis Berlemont <[email protected]> Date: Tue Jan 5 01:26:02 2010 +0100 analogy: fix the tests of the subdevice flags in the basic checks --- ksrc/drivers/analogy/command.c | 3 ++- ksrc/drivers/analogy/instruction.c | 2 +- ksrc/drivers/analogy/transfer.c | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ksrc/drivers/analogy/command.c b/ksrc/drivers/analogy/command.c index 509d73d..d58f05f 100644 --- a/ksrc/drivers/analogy/command.c +++ b/ksrc/drivers/analogy/command.c @@ -103,7 +103,8 @@ int a4l_check_cmddesc(a4l_cxt_t * cxt, a4l_cmd_t * desc) return -EINVAL; } - if (dev->transfer.subds[desc->idx_subd]->flags & A4L_SUBD_UNUSED) { + if ((dev->transfer.subds[desc->idx_subd]->flags & A4L_SUBD_TYPES) == + A4L_SUBD_UNUSED) { __a4l_err("a4l_check_cmddesc: " "subdevice type incoherent\n"); return -EIO; diff --git a/ksrc/drivers/analogy/instruction.c b/ksrc/drivers/analogy/instruction.c index ed56367..0bb1c18 100644 --- a/ksrc/drivers/analogy/instruction.c +++ b/ksrc/drivers/analogy/instruction.c @@ -221,7 +221,7 @@ int a4l_do_insn(a4l_cxt_t * cxt, a4l_kinsn_t * dsc) subd = dev->transfer.subds[dsc->idx_subd]; /* Checks the subdevice's characteristics */ - if ((subd->flags & A4L_SUBD_UNUSED) != 0) { + if ((subd->flags & A4L_SUBD_TYPES) == A4L_SUBD_UNUSED) { __a4l_err("a4l_do_insn: wrong subdevice selected\n"); return -EINVAL; } diff --git a/ksrc/drivers/analogy/transfer.c b/ksrc/drivers/analogy/transfer.c index 598cb9e..6345589 100644 --- a/ksrc/drivers/analogy/transfer.c +++ b/ksrc/drivers/analogy/transfer.c @@ -461,7 +461,8 @@ int a4l_ioctl_cancel(a4l_cxt_t * cxt, void *arg) return -EINVAL; } - if (dev->transfer.subds[idx_subd]->flags & A4L_SUBD_UNUSED) { + if ((dev->transfer.subds[idx_subd]->flags & A4L_SUBD_TYPES) == + A4L_SUBD_UNUSED) { __a4l_err("a4l_ioctl_cancel: non functional subdevice\n"); return -EIO; } _______________________________________________ Xenomai-git mailing list [email protected] https://mail.gna.org/listinfo/xenomai-git
