From 51d430056c2a695ff7ffc62ae917c413616ec6b2 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Wed, 20 Apr 2016 10:36:39 -0700 Subject: staging: comedi: mite: introduce mite_sync_dma() The struct mite_channel 'dir' member specifies if the dma is input or output. Wrap the mite_sync_input_dma() and mite_sync_output_dma() functions with a single mite_sync_dma() so that the drivers don't have to worry about the sync direction. The functions that actually sync the input/output dma currently return -1 if an overflow/underrun is detected otherwise they return 0. If an overflow/underrun is detected the async->event COMEDI_CB_OVERFLOW is also set. The callers never check the return value anyway so just make the functions return void. The async->event can be checked if necessary to detect any errors. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/mite.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers/staging/comedi/drivers/mite.h') diff --git a/drivers/staging/comedi/drivers/mite.h b/drivers/staging/comedi/drivers/mite.h index 8d203851defb..998253993232 100644 --- a/drivers/staging/comedi/drivers/mite.h +++ b/drivers/staging/comedi/drivers/mite.h @@ -90,10 +90,7 @@ void mite_release_channel(struct mite_channel *mite_chan); void mite_dma_arm(struct mite_channel *mite_chan); void mite_dma_disarm(struct mite_channel *mite_chan); -int mite_sync_input_dma(struct mite_channel *mite_chan, - struct comedi_subdevice *s); -int mite_sync_output_dma(struct mite_channel *mite_chan, - struct comedi_subdevice *s); +void mite_sync_dma(struct mite_channel *mite_chan, struct comedi_subdevice *s); u32 mite_bytes_in_transit(struct mite_channel *mite_chan); unsigned int mite_ack_linkc(struct mite_channel *mite_chan); int mite_done(struct mite_channel *mite_chan); -- cgit v1.2.3