Module: xenomai-abe Branch: experimental Commit: f26620cb08a9bf979bd3977988de5d2a7f7ff5ab URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=f26620cb08a9bf979bd3977988de5d2a7f7ff5ab
Author: Alexis Berlemont <alexis.berlem...@gmail.com> Date: Thu Jun 10 22:44:21 2010 +0200 analogy: prettify some subdevice tests (broken) --- include/analogy/subdevice.h | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/analogy/subdevice.h b/include/analogy/subdevice.h index 0337092..8649c8a 100644 --- a/include/analogy/subdevice.h +++ b/include/analogy/subdevice.h @@ -277,21 +277,19 @@ typedef struct a4l_rng_info_arg a4l_rnginfo_arg_t; #ifdef __KERNEL__ -/* --- Subdevice related functions --- */ +/* --- Subdevice related functions and macros --- */ + a4l_chan_t *a4l_get_chfeat(a4l_subd_t * sb, int idx); -a4l_rng_t *a4l_get_rngfeat(a4l_subd_t * sb, - int chidx, int rngidx); +a4l_rng_t *a4l_get_rngfeat(a4l_subd_t * sb, int chidx, int rngidx); int a4l_check_chanlist(a4l_subd_t * subd, unsigned char nb_chan, unsigned int *chans); -/* --- Upper layer functions --- */ - static inline int a4l_reserve_subd(a4l_subd_t *subd) { return test_and_set_bit(A4L_SUBD_BUSY, &subd->status) ? -EBUSY : 0; } -#define a4l_release_subd(x) clear_bit(A4L_SUBD_BUSY, &(x)->status)) -#define a4l_subd_is_busy(x) test_bit(A4L_SUBD_BUSY, &(x)->status)) +#define a4l_release_subd(x) clear_bit(A4L_SUBD_BUSY, &((x)->status)) +#define a4l_subd_is_busy(x) (test_bit(A4L_SUBD_BUSY, &((x)->status))) #define a4l_subd_is_input(x) ((A4L_SUBD_MASK_READ & (x)->flags) != 0) /* The following macro considers that a DIO subdevice is firstly an @@ -300,6 +298,8 @@ static inline int a4l_reserve_subd(a4l_subd_t *subd) ((A4L_SUBD_MASK_WRITE & (x)->flags) != 0 || \ (A4L_SUBD_DIO & (x)->flags) != 0) +/* --- Upper layer functions --- */ + a4l_subd_t * a4l_get_subd(struct a4l_device *dev, int idx); a4l_subd_t * a4l_alloc_subd(int sizeof_priv, void (*setup)(a4l_subd_t *)); _______________________________________________ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git