Module: xenomai-3
Branch: master
Commit: 9d5eda59702de396d6bb20158357e4ed2162fefe
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=9d5eda59702de396d6bb20158357e4ed2162fefe

Author: Jorge Ramirez-Ortiz <j...@xenomai.org>
Date:   Tue Aug 19 14:13:08 2014 -0400

drivers/analogy: NI_M - retrieve the sampling period via A4L_CMD_SIMUL

---

 kernel/drivers/analogy/national_instruments/mio_common.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/kernel/drivers/analogy/national_instruments/mio_common.c 
b/kernel/drivers/analogy/national_instruments/mio_common.c
index f0f2abf..e5ccf7a 100644
--- a/kernel/drivers/analogy/national_instruments/mio_common.c
+++ b/kernel/drivers/analogy/national_instruments/mio_common.c
@@ -2067,12 +2067,14 @@ static int ni_ai_cmdtest(struct a4l_subdevice *subd, 
struct a4l_cmd_desc * cmd)
                                                                   
cmd->nb_chan)) {
                        cmd->scan_begin_arg =
                                ni_min_ai_scan_period_ns(dev, cmd->nb_chan);
-                       return -EINVAL;
-               }
-               if (cmd->scan_begin_arg > devpriv->clock_ns * 0xffffff) {
+
+               if (cmd->scan_begin_arg > devpriv->clock_ns * 0xffffff)
                        cmd->scan_begin_arg = devpriv->clock_ns * 0xffffff;
-                       return -EINVAL;
+
+               /* required for calibration */
+               return 0;
                }
+
        } else if (cmd->scan_begin_src == TRIG_EXT) {
                /* external trigger */
                unsigned int tmp = CR_CHAN(cmd->scan_begin_arg);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to