Module: xenomai-abe
Branch: analogy
Commit: ca7c7a978ccc0cc67b1a17006fcaf98b77d19b12
URL:    
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=ca7c7a978ccc0cc67b1a17006fcaf98b77d19b12

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Sun Nov 22 16:42:37 2009 +0100

analogy: add error codes descriptions for descriptor routines

---

 src/drvlib/analogy/async.c      |    4 +-
 src/drvlib/analogy/descriptor.c |   56 ++++++++++++++++++++++++++++++--------
 2 files changed, 46 insertions(+), 14 deletions(-)

diff --git a/src/drvlib/analogy/async.c b/src/drvlib/analogy/async.c
index d83b032..f342af3 100644
--- a/src/drvlib/analogy/async.c
+++ b/src/drvlib/analogy/async.c
@@ -208,9 +208,9 @@ int a4l_get_bufsize(a4l_desc_t * dsc,
  *
  * @return 0 on success. Otherwise:
  *
- * - -EINVAL is returned if some argument is missing or wrong, the
+ * - -EINVAL is returned if some argument is missing or wrong; the
  *    descriptor and the new pointer should be checked; check also the
- *    kernel log
+ *    kernel log ("dmesg")
  * - -EFAULT is returned if a user <-> kernel transfer went wrong
  *
  */
diff --git a/src/drvlib/analogy/descriptor.c b/src/drvlib/analogy/descriptor.c
index dcfd6a3..a85d878 100644
--- a/src/drvlib/analogy/descriptor.c
+++ b/src/drvlib/analogy/descriptor.c
@@ -110,14 +110,12 @@ static int __a4l_get_sbsize(int fd, a4l_desc_t * dsc)
                if ((ret = a4l_sys_nbchaninfo(fd, i, &nb_chan)) < 0)
                        return ret;
 
-               res +=
-                       nb_chan * (sizeof(a4l_chinfo_t) + sizeof(a4l_leaf_t));
+               res += nb_chan * (sizeof(a4l_chinfo_t) + sizeof(a4l_leaf_t));
                for (j = 0; j < nb_chan; j++) {
                        if ((ret = a4l_sys_nbrnginfo(fd, i, j, &nb_rng)) < 0)
                                return ret;
-                       res +=
-                               nb_rng * (sizeof(a4l_rnginfo_t) +
-                                         sizeof(a4l_leaf_t));
+                       res += nb_rng * (sizeof(a4l_rnginfo_t) + 
+                                        sizeof(a4l_leaf_t));
                }
        }
 
@@ -218,9 +216,15 @@ static int __a4l_fill_desc(int fd, a4l_desc_t * dsc)
  *   is filled with characteristics about the subdevices, the channels
  *   and the ranges.
  *
- * @return 0 on success, otherwise negative error code.
+ * @return 0 on success. Otherwise:
+ *
+ * - -EINVAL is returned if some argument is missing or wrong; the
+ *    pass argument should be checked; check also the kernel log
+ *    ("dmesg")
+ * - -EFAULT is returned if a user <-> kernel transfer went wrong
  *
  */
+
 int a4l_sys_desc(int fd, a4l_desc_t * dsc, int pass)
 {
        int ret = 0;
@@ -267,7 +271,12 @@ out_a4l_sys_desc:
  * @param[out] dsc Device descriptor
  * @param[in] fname Device name
  *
- * @return 0 on success, otherwise negative error code.
+ * @return 0 on success. Otherwise:
+ *
+ * - -EINVAL is returned if some argument is missing or wrong; the
+ *    fname and the dsc pointer should be checked; check also the
+ *    kernel log ("dmesg")
+ * - -EFAULT is returned if a user <-> kernel transfer went wrong
  *
  */
 int a4l_open(a4l_desc_t * dsc, const char *fname)
@@ -300,7 +309,11 @@ int a4l_open(a4l_desc_t * dsc, const char *fname)
  *
  * @param[in] dsc Device descriptor
  *
- * @return 0 on success, otherwise negative error code.
+ * @return 0 on success. Otherwise:
+ *
+ * - -EINVAL is returned if some argument is missing or wrong; the
+ *    the dsc pointer should be checked; check also the kernel log
+ *    ("dmesg")
  *
  */
 int a4l_close(a4l_desc_t * dsc)
@@ -318,7 +331,11 @@ int a4l_close(a4l_desc_t * dsc)
  *
  * @param[in] dsc Device descriptor partly filled by a4l_open().
  *
- * @return 0 on success, otherwise negative error code.
+ * @return 0 on success. Otherwise:
+ *
+ * - -EINVAL is returned if some argument is missing or wrong; the
+ *    the dsc pointer should be checked; check also the kernel log
+ *    ("dmesg")
  *
  */
 int a4l_fill_desc(a4l_desc_t * dsc)
@@ -342,7 +359,12 @@ int a4l_fill_desc(a4l_desc_t * dsc)
  * @param[in] subd Subdevice index
  * @param[out] info Subdevice information structure
  *
- * @return 0 on success, otherwise negative error code.
+ * @return 0 on success. Otherwise:
+ *
+ * - -EINVAL is returned if some argument is missing or wrong; subd
+ *    and the dsc pointer should be checked; check also the kernel log
+ *    ("dmesg")
+ * - -EFAULT is returned if a user <-> kernel transfer went wrong
  *
  */
 int a4l_get_subdinfo(a4l_desc_t * dsc,
@@ -374,7 +396,12 @@ int a4l_get_subdinfo(a4l_desc_t * dsc,
  * @param[in] chan Channel index
  * @param[out] info Channel information structure
  *
- * @return 0 on success, otherwise negative error code.
+ * @return 0 on success. Otherwise:
+ *
+ * - -EINVAL is returned if some argument is missing or wrong; subd,
+ *    chan and the dsc pointer should be checked; check also the
+ *    kernel log ("dmesg")
+ * - -EFAULT is returned if a user <-> kernel transfer went wrong
  *
  */
 int a4l_get_chinfo(a4l_desc_t * dsc,
@@ -413,7 +440,12 @@ int a4l_get_chinfo(a4l_desc_t * dsc,
  * @param[in] rng Range index
  * @param[out] info Range information structure
  *
- * @return 0 on success, otherwise negative error code.
+ * @return 0 on success. Otherwise:
+ *
+ * - -EINVAL is returned if some argument is missing or wrong; subd,
+ *    chan, rng and the dsc pointer should be checked; check also the
+ *    kernel log ("dmesg")
+ * - -EFAULT is returned if a user <-> kernel transfer went wrong
  *
  */
 int a4l_get_rnginfo(a4l_desc_t * dsc,


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to