]> Pileus Git - ~andy/linux/commitdiff
staging: comedi: ni_tiocmd: make ni_tio_cmd() a proper comedi (*do_cmd)
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 19 Dec 2013 23:32:04 +0000 (16:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Dec 2013 19:49:33 +0000 (11:49 -0800)
Change the parameters to ni_tio_cmd() to make it a proper comedi
(*do_cmd) function.

The wrappers in the ni_660x and ni_mio_common modules are still needed
to request the mite channel and setup the device before actually doing
the command.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_660x.c
drivers/staging/comedi/drivers/ni_mio_common.c
drivers/staging/comedi/drivers/ni_tio.h
drivers/staging/comedi/drivers/ni_tiocmd.c

index 46b6904f750f844be79bda4afcaf6b055f8ac61b..3de2467c90add97265205a9889c474d2e4b64ab7 100644 (file)
@@ -825,9 +825,8 @@ static int ni_660x_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
                return retval;
        }
        ni_tio_acknowledge_and_confirm(counter, NULL, NULL, NULL, NULL);
-       retval = ni_tio_cmd(counter, s->async);
 
-       return retval;
+       return ni_tio_cmd(dev, s);
 }
 
 static int ni_660x_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
index a2cfcce1b6a2771c692f81752db6cf8b233c8543..eb9f517584355bfab041645e3600715208aa2863 100644 (file)
@@ -5007,9 +5007,8 @@ static void GPCT_Reset(struct comedi_device *dev, int chan)
 #ifdef PCIDMA
 static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 {
-       int retval;
        struct ni_gpct *counter = s->private;
-/* const struct comedi_cmd *cmd = &s->async->cmd; */
+       int retval;
 
        retval = ni_request_gpct_mite_channel(dev, counter->counter_index,
                                              COMEDI_INPUT);
@@ -5020,8 +5019,8 @@ static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
        }
        ni_tio_acknowledge_and_confirm(counter, NULL, NULL, NULL, NULL);
        ni_e_series_enable_second_irq(dev, counter->counter_index, 1);
-       retval = ni_tio_cmd(counter, s->async);
-       return retval;
+
+       return ni_tio_cmd(dev, s);
 }
 #endif
 
index 9eaa0eee9947b41e653aa96e037b4aca6450aac5..68378dab4e70e3a07e7d7c8ee21c64d64548bd21 100644 (file)
@@ -143,7 +143,7 @@ int ni_tio_insn_config(struct comedi_device *, struct comedi_subdevice *,
                       struct comedi_insn *, unsigned int *data);
 int ni_tio_insn_write(struct comedi_device *, struct comedi_subdevice *,
                      struct comedi_insn *, unsigned int *data);
-int ni_tio_cmd(struct ni_gpct *, struct comedi_async *);
+int ni_tio_cmd(struct comedi_device *, struct comedi_subdevice *);
 int ni_tio_cmdtest(struct comedi_device *, struct comedi_subdevice *,
                   struct comedi_cmd *);
 int ni_tio_cancel(struct ni_gpct *);
index 98be76496334ea632678f8ed30acb6fea7287bff..7d64f8892f0819efb4b27148f5b66360dd4a1b6a 100644 (file)
@@ -201,8 +201,10 @@ static int ni_tio_cmd_setup(struct ni_gpct *counter, struct comedi_async *async)
        return retval;
 }
 
-int ni_tio_cmd(struct ni_gpct *counter, struct comedi_async *async)
+int ni_tio_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 {
+       struct ni_gpct *counter = s->private;
+       struct comedi_async *async = s->async;
        struct comedi_cmd *cmd = &async->cmd;
        int retval = 0;
        unsigned long flags;