]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: mite: rename 'struct mite_dma_descriptor_ring'
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 2 May 2016 17:11:36 +0000 (10:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 May 2016 21:11:15 +0000 (14:11 -0700)
Rename this name to 'mite_ring' to help shorten the long lines.

In the ni_660x driver, also shorten the private data member 'mite_rings'
to simply 'ring'.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
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_mio_common.c
drivers/staging/comedi/drivers/ni_pcidio.c
drivers/staging/comedi/drivers/ni_stc.h

index 127a86e651b8ad66a7d3ea1d07868d775759fd1e..c6165871ec62819def92c660388ff983a2ae6f4a 100644 (file)
@@ -355,11 +355,11 @@ void mite_detach(struct mite *mite)
 }
 EXPORT_SYMBOL_GPL(mite_detach);
 
-struct mite_dma_descriptor_ring *mite_alloc_ring(struct mite *mite)
+struct mite_ring *mite_alloc_ring(struct mite *mite)
 {
-       struct mite_dma_descriptor_ring *ring =
-           kmalloc(sizeof(struct mite_dma_descriptor_ring), GFP_KERNEL);
+       struct mite_ring *ring;
 
+       ring = kmalloc(sizeof(*ring), GFP_KERNEL);
        if (!ring)
                return NULL;
        ring->hw_dev = get_device(&mite->pcidev->dev);
@@ -374,7 +374,7 @@ struct mite_dma_descriptor_ring *mite_alloc_ring(struct mite *mite)
 };
 EXPORT_SYMBOL_GPL(mite_alloc_ring);
 
-void mite_free_ring(struct mite_dma_descriptor_ring *ring)
+void mite_free_ring(struct mite_ring *ring)
 {
        if (ring) {
                if (ring->descriptors) {
@@ -390,11 +390,10 @@ void mite_free_ring(struct mite_dma_descriptor_ring *ring)
 };
 EXPORT_SYMBOL_GPL(mite_free_ring);
 
-struct mite_channel *
-mite_request_channel_in_range(struct mite *mite,
-                             struct mite_dma_descriptor_ring *ring,
-                             unsigned int min_channel,
-                             unsigned int max_channel)
+struct mite_channel *mite_request_channel_in_range(struct mite *mite,
+                                                  struct mite_ring *ring,
+                                                  unsigned int min_channel,
+                                                  unsigned int max_channel)
 {
        int i;
        unsigned long flags;
@@ -468,7 +467,7 @@ EXPORT_SYMBOL_GPL(mite_dma_arm);
 
 /**************************************/
 
-int mite_buf_change(struct mite_dma_descriptor_ring *ring,
+int mite_buf_change(struct mite_ring *ring,
                    struct comedi_subdevice *s)
 {
        struct comedi_async *async = s->async;
@@ -512,7 +511,7 @@ EXPORT_SYMBOL_GPL(mite_buf_change);
  * DMA data buffer.  A command may call this function later to re-initialize and
  * shorten the amount of memory that will be transferred.
  */
-int mite_init_ring_descriptors(struct mite_dma_descriptor_ring *ring,
+int mite_init_ring_descriptors(struct mite_ring *ring,
                               struct comedi_subdevice *s,
                               unsigned int nbytes)
 {
index c42438fbae32cbec3f05dfbf71af2ef469a913a6..5317d157e1f92ced7af46e69beb5a130c794f4eb 100644 (file)
@@ -35,7 +35,7 @@ struct mite_dma_desc {
        u32 dar;
 };
 
-struct mite_dma_descriptor_ring {
+struct mite_ring {
        struct device *hw_dev;
        unsigned int n_links;
        struct mite_dma_desc *descriptors;
@@ -47,7 +47,7 @@ struct mite_channel {
        unsigned int channel;
        int dir;
        int done;
-       struct mite_dma_descriptor_ring *ring;
+       struct mite_ring *ring;
 };
 
 struct mite {
@@ -72,16 +72,15 @@ static inline int mite_setup(struct comedi_device *dev,
 }
 
 void mite_detach(struct mite *);
-struct mite_dma_descriptor_ring *mite_alloc_ring(struct mite *);
-void mite_free_ring(struct mite_dma_descriptor_ring *ring);
-struct mite_channel *
-mite_request_channel_in_range(struct mite *,
-                             struct mite_dma_descriptor_ring *ring,
-                             unsigned int min_channel,
-                             unsigned int max_channel);
-static inline struct mite_channel *
-mite_request_channel(struct mite *mite,
-                    struct mite_dma_descriptor_ring *ring)
+struct mite_ring *mite_alloc_ring(struct mite *);
+void mite_free_ring(struct mite_ring *ring);
+struct mite_channel *mite_request_channel_in_range(struct mite *,
+                                                  struct mite_ring *,
+                                                  unsigned int min_channel,
+                                                  unsigned int max_channel);
+
+static inline struct mite_channel *mite_request_channel(struct mite *mite,
+                                                       struct mite_ring *ring)
 {
        return mite_request_channel_in_range(mite, ring, 0,
                                             mite->num_channels - 1);
@@ -99,10 +98,8 @@ 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_subdevice *s);
-int mite_init_ring_descriptors(struct mite_dma_descriptor_ring *ring,
-                              struct comedi_subdevice *s,
+int mite_buf_change(struct mite_ring *, struct comedi_subdevice *);
+int mite_init_ring_descriptors(struct mite_ring *, struct comedi_subdevice *,
                               unsigned int nbytes);
 
 /*
index 7cc7e28baf92c93840e8d8422cda03b17b1dd917..041ea67a913b773d26f570255790bf8c44988876 100644 (file)
@@ -255,8 +255,7 @@ static const struct ni_660x_board ni_660x_boards[] = {
 struct ni_660x_private {
        struct mite *mite;
        struct ni_gpct_device *counter_dev;
-       struct mite_dma_descriptor_ring
-       *mite_rings[NI660X_MAX_CHIPS][NI660X_COUNTERS_PER_CHIP];
+       struct mite_ring *ring[NI660X_MAX_CHIPS][NI660X_COUNTERS_PER_CHIP];
        /* protects mite channel request/release */
        spinlock_t mite_channel_lock;
        /* prevents races between interrupt and comedi_poll */
@@ -339,12 +338,12 @@ static int ni_660x_request_mite_channel(struct comedi_device *dev,
                                        enum comedi_io_direction direction)
 {
        struct ni_660x_private *devpriv = dev->private;
-       struct mite_dma_descriptor_ring *ring;
+       struct mite_ring *ring;
        struct mite_channel *mite_chan;
        unsigned long flags;
 
        spin_lock_irqsave(&devpriv->mite_channel_lock, flags);
-       ring = devpriv->mite_rings[counter->chip_index][counter->counter_index];
+       ring = devpriv->ring[counter->chip_index][counter->counter_index];
        mite_chan = mite_request_channel(devpriv->mite, ring);
        if (!mite_chan) {
                spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
@@ -470,10 +469,10 @@ static int ni_660x_buf_change(struct comedi_device *dev,
 {
        struct ni_660x_private *devpriv = dev->private;
        struct ni_gpct *counter = s->private;
-       struct mite_dma_descriptor_ring *ring;
+       struct mite_ring *ring;
        int ret;
 
-       ring = devpriv->mite_rings[counter->chip_index][counter->counter_index];
+       ring = devpriv->ring[counter->chip_index][counter->counter_index];
        ret = mite_buf_change(ring, s);
        if (ret < 0)
                return ret;
@@ -507,9 +506,8 @@ static int ni_660x_alloc_mite_rings(struct comedi_device *dev)
 
        for (i = 0; i < board->n_chips; ++i) {
                for (j = 0; j < NI660X_COUNTERS_PER_CHIP; ++j) {
-                       devpriv->mite_rings[i][j] =
-                           mite_alloc_ring(devpriv->mite);
-                       if (!devpriv->mite_rings[i][j])
+                       devpriv->ring[i][j] = mite_alloc_ring(devpriv->mite);
+                       if (!devpriv->ring[i][j])
                                return -ENOMEM;
                }
        }
@@ -525,7 +523,7 @@ static void ni_660x_free_mite_rings(struct comedi_device *dev)
 
        for (i = 0; i < board->n_chips; ++i) {
                for (j = 0; j < NI660X_COUNTERS_PER_CHIP; ++j)
-                       mite_free_ring(devpriv->mite_rings[i][j]);
+                       mite_free_ring(devpriv->ring[i][j]);
        }
 }
 
index dc024f27cc48417c3f4bef63ab809d90e87c48b2..8dabb19519a5ac6475e13dcf30c058842312c11a 100644 (file)
@@ -1961,7 +1961,7 @@ static unsigned int ni_timer_to_ns(const struct comedi_device *dev, int timer)
        return devpriv->clock_ns * (timer + 1);
 }
 
-static void ni_cmd_set_mite_transfer(struct mite_dma_descriptor_ring *ring,
+static void ni_cmd_set_mite_transfer(struct mite_ring *ring,
                                     struct comedi_subdevice *sdev,
                                     const struct comedi_cmd *cmd,
                                     unsigned int max_count) {
index 9ed8bb819f7401334898df20703bd9e24d115010..e176b60ff3d1f5f4c2b98625a916705792dd5dcc 100644 (file)
@@ -289,7 +289,7 @@ struct nidio96_private {
        int dio;
        unsigned short OpModeBits;
        struct mite_channel *di_mite_chan;
-       struct mite_dma_descriptor_ring *di_mite_ring;
+       struct mite_ring *di_mite_ring;
        spinlock_t mite_channel_lock;
 };
 
index 6b46a192091e4e286efe47bf257d4e6544ed8d63..1966519cb6e54337d2a0a1464ec6a5d758138226 100644 (file)
@@ -1037,10 +1037,10 @@ struct ni_private {
        struct mite_channel *ai_mite_chan;
        struct mite_channel *ao_mite_chan;
        struct mite_channel *cdo_mite_chan;
-       struct mite_dma_descriptor_ring *ai_mite_ring;
-       struct mite_dma_descriptor_ring *ao_mite_ring;
-       struct mite_dma_descriptor_ring *cdo_mite_ring;
-       struct mite_dma_descriptor_ring *gpct_mite_ring[NUM_GPCT];
+       struct mite_ring *ai_mite_ring;
+       struct mite_ring *ao_mite_ring;
+       struct mite_ring *cdo_mite_ring;
+       struct mite_ring *gpct_mite_ring[NUM_GPCT];
 
        /* ni_pcimio board type flags (based on the boardinfo reg_type) */
        unsigned int is_m_series:1;