]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: mite: pass subdevice to mite_buf_change()
authorIan Abbott <abbotti@mev.co.uk>
Tue, 6 May 2014 12:12:15 +0000 (13:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 May 2014 12:25:50 +0000 (21:25 +0900)
`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>
drivers/staging/comedi/drivers/mite.c
drivers/staging/comedi/drivers/mite.h
drivers/staging/comedi/drivers/ni_660x.c
drivers/staging/comedi/drivers/ni_pcidio.c
drivers/staging/comedi/drivers/ni_pcimio.c

index 6c8bd7c33082a1c8814b579ccc1871e2f83b0c65..2d224cfe72e375fe8ffcfc9691e09152322526b4 100644 (file)
@@ -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;
        }
index 78f2357479913e054e084bb4ced30e670327fb2c..929b9bb3fcedecfa9e3902ffd105b72d45ae125b 100644 (file)
@@ -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)
 {
index 2858b3d559c1fe1b492bb74d0f69252606d4432f..3901e3b5ba5115c1c3929eec2430ef251e363772 100644 (file)
@@ -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;
 
index d0ad82a3b4b9b44c3d968bc896d7017f77eeb033..1f8423504031b15afd3c5539ea232ce5b0f3f7ab 100644 (file)
@@ -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;
 
index d40df072583cba425d5d84b71bfd291d295d0a47..89300dc78e3529d7daa1a57700c405d6d307fea7 100644 (file)
@@ -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;