From f8cfd0eb3c11337844215c5e93937c561858eb13 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Mon, 28 Jul 2014 10:27:04 -0700 Subject: [PATCH] staging: comedi: ni_tiocmd: introduce ni_tio_acknowledge() 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_660x.c | 2 +- drivers/staging/comedi/drivers/ni_mio_common.c | 2 +- drivers/staging/comedi/drivers/ni_tio.h | 4 +--- drivers/staging/comedi/drivers/ni_tiocmd.c | 15 +++++++++++---- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index 20fe692fd8f0..ef4a8f0fb29c 100644 --- a/drivers/staging/comedi/drivers/ni_660x.c +++ b/drivers/staging/comedi/drivers/ni_660x.c @@ -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); } diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 4285f0718012..888ec8ddf63b 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -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); diff --git a/drivers/staging/comedi/drivers/ni_tio.h b/drivers/staging/comedi/drivers/ni_tio.h index 1056bf001e5e..25aedd0e5867 100644 --- a/drivers/staging/comedi/drivers/ni_tio.h +++ b/drivers/staging/comedi/drivers/ni_tio.h @@ -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 */ diff --git a/drivers/staging/comedi/drivers/ni_tiocmd.c b/drivers/staging/comedi/drivers/ni_tiocmd.c index c360667b1ba4..299ceddfb233 100644 --- a/drivers/staging/comedi/drivers/ni_tiocmd.c +++ b/drivers/staging/comedi/drivers/ni_tiocmd.c @@ -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) -- 2.20.1