mirror of https://gitee.com/openkylin/linux.git
staging: comedi: mite: pass subdevice to mite_buf_change()
`mite_buf_change()` 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: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a1c0e5fe68
commit
b74e635d1c
|
@ -307,8 +307,9 @@ EXPORT_SYMBOL_GPL(mite_dma_arm);
|
|||
/**************************************/
|
||||
|
||||
int mite_buf_change(struct mite_dma_descriptor_ring *ring,
|
||||
struct comedi_async *async)
|
||||
struct comedi_subdevice *s)
|
||||
{
|
||||
struct comedi_async *async = s->async;
|
||||
unsigned int n_links;
|
||||
int i;
|
||||
|
||||
|
@ -333,7 +334,7 @@ int mite_buf_change(struct mite_dma_descriptor_ring *ring,
|
|||
n_links * sizeof(struct mite_dma_descriptor),
|
||||
&ring->descriptors_dma_addr, GFP_KERNEL);
|
||||
if (!ring->descriptors) {
|
||||
dev_err(async->subdevice->device->class_dev,
|
||||
dev_err(s->device->class_dev,
|
||||
"mite: ring buffer allocation failed\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ int mite_done(struct mite_channel *mite_chan);
|
|||
void mite_prep_dma(struct mite_channel *mite_chan,
|
||||
unsigned int num_device_bits, unsigned int num_memory_bits);
|
||||
int mite_buf_change(struct mite_dma_descriptor_ring *ring,
|
||||
struct comedi_async *async);
|
||||
struct comedi_subdevice *s);
|
||||
|
||||
static inline int CHAN_OFFSET(int channel)
|
||||
{
|
||||
|
|
|
@ -836,7 +836,7 @@ static int ni_660x_buf_change(struct comedi_device *dev,
|
|||
struct ni_gpct *counter = s->private;
|
||||
int ret;
|
||||
|
||||
ret = mite_buf_change(mite_ring(devpriv, counter), s->async);
|
||||
ret = mite_buf_change(mite_ring(devpriv, counter), s);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
|
|
@ -806,7 +806,7 @@ static int ni_pcidio_change(struct comedi_device *dev,
|
|||
struct nidio96_private *devpriv = dev->private;
|
||||
int ret;
|
||||
|
||||
ret = mite_buf_change(devpriv->di_mite_ring, s->async);
|
||||
ret = mite_buf_change(devpriv->di_mite_ring, s);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
|
|
@ -1560,7 +1560,7 @@ static int pcimio_ai_change(struct comedi_device *dev,
|
|||
struct ni_private *devpriv = dev->private;
|
||||
int ret;
|
||||
|
||||
ret = mite_buf_change(devpriv->ai_mite_ring, s->async);
|
||||
ret = mite_buf_change(devpriv->ai_mite_ring, s);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -1573,7 +1573,7 @@ static int pcimio_ao_change(struct comedi_device *dev,
|
|||
struct ni_private *devpriv = dev->private;
|
||||
int ret;
|
||||
|
||||
ret = mite_buf_change(devpriv->ao_mite_ring, s->async);
|
||||
ret = mite_buf_change(devpriv->ao_mite_ring, s);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -1587,7 +1587,7 @@ static int pcimio_gpct0_change(struct comedi_device *dev,
|
|||
struct ni_private *devpriv = dev->private;
|
||||
int ret;
|
||||
|
||||
ret = mite_buf_change(devpriv->gpct_mite_ring[0], s->async);
|
||||
ret = mite_buf_change(devpriv->gpct_mite_ring[0], s);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -1601,7 +1601,7 @@ static int pcimio_gpct1_change(struct comedi_device *dev,
|
|||
struct ni_private *devpriv = dev->private;
|
||||
int ret;
|
||||
|
||||
ret = mite_buf_change(devpriv->gpct_mite_ring[1], s->async);
|
||||
ret = mite_buf_change(devpriv->gpct_mite_ring[1], s);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -1614,7 +1614,7 @@ static int pcimio_dio_change(struct comedi_device *dev,
|
|||
struct ni_private *devpriv = dev->private;
|
||||
int ret;
|
||||
|
||||
ret = mite_buf_change(devpriv->cdo_mite_ring, s->async);
|
||||
ret = mite_buf_change(devpriv->cdo_mite_ring, s);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
|
Loading…
Reference in New Issue