staging: comedi: ni_tiocmd: introduce ni_tio_acknowledge()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 28 Jul 2014 17:27:04 +0000 (10:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Jul 2014 23:51:01 +0000 (16:51 -0700)
The external callers of ni_tio_acknowledge_and_confirm() only call
this function to ack any pending errors or interrupts before starting
a new async command. Only the internal code in ni_tiocmd uses the
data that is optionally returned by this function.

Remove the export from ni_tio_acknowledge_and_confirm() and introduce
a new exported function that handles passing the NULL params.

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 20fe692fd8f0aff75c5986314f556394f73bd242..ef4a8f0fb29cf4fe9ecfa09ca199ef664a52d2c9 100644 (file)
@@ -749,7 +749,7 @@ static int ni_660x_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
                        "no dma channel available for use by counter\n");
                return retval;
        }
-       ni_tio_acknowledge_and_confirm(counter, NULL, NULL, NULL, NULL);
+       ni_tio_acknowledge(counter);
 
        return ni_tio_cmd(dev, s);
 }
index 4285f071801251eb97fc55a7088d52cae1bf81cc..888ec8ddf63bd657e19f09c341d01b985c641c1f 100644 (file)
@@ -5252,7 +5252,7 @@ static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
                        "no dma channel available for use by counter\n");
                return retval;
        }
-       ni_tio_acknowledge_and_confirm(counter, NULL, NULL, NULL, NULL);
+       ni_tio_acknowledge(counter);
        ni_e_series_enable_second_irq(dev, counter->counter_index, 1);
 
        return ni_tio_cmd(dev, s);
index 1056bf001e5e68e1ed61b6d96f6dba40c46400f6..25aedd0e586781367a59739e75200cc9e271c9f1 100644 (file)
@@ -149,8 +149,6 @@ int ni_tio_cmdtest(struct comedi_device *, struct comedi_subdevice *,
 int ni_tio_cancel(struct ni_gpct *);
 void ni_tio_handle_interrupt(struct ni_gpct *, struct comedi_subdevice *);
 void ni_tio_set_mite_channel(struct ni_gpct *, struct mite_channel *);
-void ni_tio_acknowledge_and_confirm(struct ni_gpct *,
-                                   int *gate_error, int *tc_error,
-                                   int *perm_stale_data, int *stale_data);
+void ni_tio_acknowledge(struct ni_gpct *);
 
 #endif /* _COMEDI_NI_TIO_H */
index c360667b1ba4be260bdfa8ada7bd63fefd6479bd..299ceddfb233b7d13686ef7e5ace674e05a5f4da 100644 (file)
@@ -343,9 +343,11 @@ static int should_ack_gate(struct ni_gpct *counter)
        return retval;
 }
 
-void ni_tio_acknowledge_and_confirm(struct ni_gpct *counter, int *gate_error,
-                                   int *tc_error, int *perm_stale_data,
-                                   int *stale_data)
+static void ni_tio_acknowledge_and_confirm(struct ni_gpct *counter,
+                                          int *gate_error,
+                                          int *tc_error,
+                                          int *perm_stale_data,
+                                          int *stale_data)
 {
        unsigned cidx = counter->counter_index;
        const unsigned short gxx_status = read_register(counter,
@@ -404,7 +406,12 @@ void ni_tio_acknowledge_and_confirm(struct ni_gpct *counter, int *gate_error,
                }
        }
 }
-EXPORT_SYMBOL_GPL(ni_tio_acknowledge_and_confirm);
+
+void ni_tio_acknowledge(struct ni_gpct *counter)
+{
+       ni_tio_acknowledge_and_confirm(counter, NULL, NULL, NULL, NULL);
+}
+EXPORT_SYMBOL_GPL(ni_tio_acknowledge);
 
 void ni_tio_handle_interrupt(struct ni_gpct *counter,
                             struct comedi_subdevice *s)
This page took 0.03172 seconds and 5 git commands to generate.