Commit 1e575a9c authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: mite: pass subdevice to mite_sync_output_dma()

`mite_sync_output_dma()` in the "mite" module currently takes a pointer
to a `struct comedi_async` and gets a pointer to the owning `struct
comedi_subdevice` from the `subdevice` member.  Change it to take a
pointer to a `struct comedi_subdevice` and use the `async` member.

The motivation for this is to eliminate the `subdevice` member of
`struct comedi_async`.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 74f63db7
...@@ -559,9 +559,9 @@ int mite_sync_input_dma(struct mite_channel *mite_chan, ...@@ -559,9 +559,9 @@ int mite_sync_input_dma(struct mite_channel *mite_chan,
EXPORT_SYMBOL_GPL(mite_sync_input_dma); EXPORT_SYMBOL_GPL(mite_sync_input_dma);
int mite_sync_output_dma(struct mite_channel *mite_chan, int mite_sync_output_dma(struct mite_channel *mite_chan,
struct comedi_async *async) struct comedi_subdevice *s)
{ {
struct comedi_subdevice *s = async->subdevice; struct comedi_async *async = s->async;
int count; int count;
u32 nbytes_ub, nbytes_lb; u32 nbytes_ub, nbytes_lb;
unsigned int old_alloc_count; unsigned int old_alloc_count;
...@@ -579,8 +579,7 @@ int mite_sync_output_dma(struct mite_channel *mite_chan, ...@@ -579,8 +579,7 @@ int mite_sync_output_dma(struct mite_channel *mite_chan,
(int)(nbytes_ub - stop_count) > 0) (int)(nbytes_ub - stop_count) > 0)
nbytes_ub = stop_count; nbytes_ub = stop_count;
if ((int)(nbytes_ub - old_alloc_count) > 0) { if ((int)(nbytes_ub - old_alloc_count) > 0) {
dev_warn(async->subdevice->device->class_dev, dev_warn(s->device->class_dev, "mite: DMA underrun\n");
"mite: DMA underrun\n");
async->events |= COMEDI_CB_OVERFLOW; async->events |= COMEDI_CB_OVERFLOW;
return -1; return -1;
} }
......
...@@ -108,7 +108,7 @@ void mite_dma_disarm(struct mite_channel *mite_chan); ...@@ -108,7 +108,7 @@ void mite_dma_disarm(struct mite_channel *mite_chan);
int mite_sync_input_dma(struct mite_channel *mite_chan, int mite_sync_input_dma(struct mite_channel *mite_chan,
struct comedi_subdevice *s); struct comedi_subdevice *s);
int mite_sync_output_dma(struct mite_channel *mite_chan, int mite_sync_output_dma(struct mite_channel *mite_chan,
struct comedi_async *async); struct comedi_subdevice *s);
u32 mite_bytes_written_to_memory_lb(struct mite_channel *mite_chan); u32 mite_bytes_written_to_memory_lb(struct mite_channel *mite_chan);
u32 mite_bytes_written_to_memory_ub(struct mite_channel *mite_chan); u32 mite_bytes_written_to_memory_ub(struct mite_channel *mite_chan);
u32 mite_bytes_read_from_memory_lb(struct mite_channel *mite_chan); u32 mite_bytes_read_from_memory_lb(struct mite_channel *mite_chan);
......
...@@ -877,7 +877,7 @@ static void mite_handle_b_linkc(struct mite_struct *mite, ...@@ -877,7 +877,7 @@ static void mite_handle_b_linkc(struct mite_struct *mite,
spin_lock_irqsave(&devpriv->mite_channel_lock, flags); spin_lock_irqsave(&devpriv->mite_channel_lock, flags);
if (devpriv->ao_mite_chan) if (devpriv->ao_mite_chan)
mite_sync_output_dma(devpriv->ao_mite_chan, s->async); mite_sync_output_dma(devpriv->ao_mite_chan, s);
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
} }
...@@ -3640,7 +3640,7 @@ static void handle_cdio_interrupt(struct comedi_device *dev) ...@@ -3640,7 +3640,7 @@ static void handle_cdio_interrupt(struct comedi_device *dev)
devpriv->mite->mite_io_addr + devpriv->mite->mite_io_addr +
MITE_CHOR(devpriv->cdo_mite_chan->channel)); MITE_CHOR(devpriv->cdo_mite_chan->channel));
} }
mite_sync_output_dma(devpriv->cdo_mite_chan, s->async); mite_sync_output_dma(devpriv->cdo_mite_chan, s);
} }
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment