Commit 74f63db7 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

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

`mite_sync_input_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 b74e635d
...@@ -526,9 +526,9 @@ void mite_dma_disarm(struct mite_channel *mite_chan) ...@@ -526,9 +526,9 @@ void mite_dma_disarm(struct mite_channel *mite_chan)
EXPORT_SYMBOL_GPL(mite_dma_disarm); EXPORT_SYMBOL_GPL(mite_dma_disarm);
int mite_sync_input_dma(struct mite_channel *mite_chan, int mite_sync_input_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;
unsigned int nbytes, old_alloc_count; unsigned int nbytes, old_alloc_count;
......
...@@ -106,7 +106,7 @@ unsigned mite_dma_tcr(struct mite_channel *mite_chan); ...@@ -106,7 +106,7 @@ unsigned mite_dma_tcr(struct mite_channel *mite_chan);
void mite_dma_arm(struct mite_channel *mite_chan); void mite_dma_arm(struct mite_channel *mite_chan);
void mite_dma_disarm(struct mite_channel *mite_chan); 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_async *async); 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_async *async);
u32 mite_bytes_written_to_memory_lb(struct mite_channel *mite_chan); u32 mite_bytes_written_to_memory_lb(struct mite_channel *mite_chan);
......
...@@ -823,7 +823,7 @@ static int ni_660x_input_poll(struct comedi_device *dev, ...@@ -823,7 +823,7 @@ static int ni_660x_input_poll(struct comedi_device *dev,
/* lock to avoid race with comedi_poll */ /* lock to avoid race with comedi_poll */
spin_lock_irqsave(&devpriv->interrupt_lock, flags); spin_lock_irqsave(&devpriv->interrupt_lock, flags);
mite_sync_input_dma(counter->mite_chan, s->async); mite_sync_input_dma(counter->mite_chan, s);
spin_unlock_irqrestore(&devpriv->interrupt_lock, flags); spin_unlock_irqrestore(&devpriv->interrupt_lock, flags);
return comedi_buf_read_n_available(s); return comedi_buf_read_n_available(s);
} }
......
...@@ -864,7 +864,7 @@ static void ni_sync_ai_dma(struct comedi_device *dev) ...@@ -864,7 +864,7 @@ static void ni_sync_ai_dma(struct comedi_device *dev)
spin_lock_irqsave(&devpriv->mite_channel_lock, flags); spin_lock_irqsave(&devpriv->mite_channel_lock, flags);
if (devpriv->ai_mite_chan) if (devpriv->ai_mite_chan)
mite_sync_input_dma(devpriv->ai_mite_chan, s->async); mite_sync_input_dma(devpriv->ai_mite_chan, s);
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
} }
......
...@@ -359,7 +359,7 @@ static int ni_pcidio_poll(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -359,7 +359,7 @@ static int ni_pcidio_poll(struct comedi_device *dev, struct comedi_subdevice *s)
spin_lock_irqsave(&dev->spinlock, irq_flags); spin_lock_irqsave(&dev->spinlock, irq_flags);
spin_lock(&devpriv->mite_channel_lock); spin_lock(&devpriv->mite_channel_lock);
if (devpriv->di_mite_chan) if (devpriv->di_mite_chan)
mite_sync_input_dma(devpriv->di_mite_chan, s->async); mite_sync_input_dma(devpriv->di_mite_chan, s);
spin_unlock(&devpriv->mite_channel_lock); spin_unlock(&devpriv->mite_channel_lock);
count = s->async->buf_write_count - s->async->buf_read_count; count = s->async->buf_write_count - s->async->buf_read_count;
spin_unlock_irqrestore(&dev->spinlock, irq_flags); spin_unlock_irqrestore(&dev->spinlock, irq_flags);
...@@ -405,7 +405,7 @@ static irqreturn_t nidio_interrupt(int irq, void *d) ...@@ -405,7 +405,7 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
writel(CHOR_CLRLC, writel(CHOR_CLRLC,
mite->mite_io_addr + mite->mite_io_addr +
MITE_CHOR(devpriv->di_mite_chan->channel)); MITE_CHOR(devpriv->di_mite_chan->channel));
mite_sync_input_dma(devpriv->di_mite_chan, s->async); mite_sync_input_dma(devpriv->di_mite_chan, s);
/* XXX need to byteswap */ /* XXX need to byteswap */
} }
if (m_status & ~(CHSR_INT | CHSR_LINKC | CHSR_DONE | CHSR_DRDY | if (m_status & ~(CHSR_INT | CHSR_LINKC | CHSR_DONE | CHSR_DRDY |
......
...@@ -464,7 +464,7 @@ void ni_tio_handle_interrupt(struct ni_gpct *counter, ...@@ -464,7 +464,7 @@ void ni_tio_handle_interrupt(struct ni_gpct *counter,
counter->mite_chan->mite->mite_io_addr + counter->mite_chan->mite->mite_io_addr +
MITE_CHOR(counter->mite_chan->channel)); MITE_CHOR(counter->mite_chan->channel));
} }
mite_sync_input_dma(counter->mite_chan, s->async); mite_sync_input_dma(counter->mite_chan, s);
spin_unlock_irqrestore(&counter->lock, flags); spin_unlock_irqrestore(&counter->lock, flags);
} }
EXPORT_SYMBOL_GPL(ni_tio_handle_interrupt); EXPORT_SYMBOL_GPL(ni_tio_handle_interrupt);
......
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