Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[pandora-kernel.git] / arch / arm / mach-imx / dma.c
index 6d50d85..ee1c6f0 100644 (file)
@@ -54,7 +54,7 @@ static inline int imx_dma_sg_next(imx_dmach_t dma_ch, unsigned int lastcount)
 
        if (!imxdma->name) {
                printk(KERN_CRIT "%s: called for  not allocated channel %d\n",
-                      __FUNCTION__, dma_ch);
+                      __func__, dma_ch);
                return 0;
        }
 
@@ -131,7 +131,7 @@ imx_dma_setup_sg_base(imx_dmach_t dma_ch,
  * The function setups DMA channel source and destination addresses for transfer
  * specified by provided parameters. The scatter-gather emulation is disabled,
  * because linear data block
- * form the physical address range is transfered.
+ * form the physical address range is transferred.
  * Return value: if incorrect parameters are provided -%EINVAL.
  *             Zero indicates success.
  */
@@ -192,7 +192,7 @@ imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address,
  * @dmamode: DMA transfer mode, %DMA_MODE_READ from the device to the memory
  *           or %DMA_MODE_WRITE from memory to the device
  *
- * The function setups DMA channel state and registers to be ready for transfer
+ * The function sets up DMA channel state and registers to be ready for transfer
  * specified by provided parameters. The scatter-gather emulation is set up
  * according to the parameters.
  *
@@ -212,7 +212,7 @@ imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address,
  *
  * %CCR_SMOD_LINEAR | %CCR_SSIZ_32 | %CCR_DMOD_FIFO | %CCR_DSIZ_x
  *
- * Be carefull there and do not mistakenly mix source and target device
+ * Be careful here and do not mistakenly mix source and target device
  * port sizes constants, they are really different:
  * %CCR_SSIZ_8, %CCR_SSIZ_16, %CCR_SSIZ_32,
  * %CCR_DSIZ_8, %CCR_DSIZ_16, %CCR_DSIZ_32
@@ -288,7 +288,7 @@ imx_dma_setup_handlers(imx_dmach_t dma_ch,
 
        if (!imxdma->name) {
                printk(KERN_CRIT "%s: called for  not allocated channel %d\n",
-                      __FUNCTION__, dma_ch);
+                      __func__, dma_ch);
                return -ENODEV;
        }
 
@@ -321,7 +321,7 @@ void imx_dma_enable(imx_dmach_t dma_ch)
 
        if (!imxdma->name) {
                printk(KERN_CRIT "%s: called for  not allocated channel %d\n",
-                      __FUNCTION__, dma_ch);
+                      __func__, dma_ch);
                return;
        }
 
@@ -365,7 +365,7 @@ int imx_dma_request(imx_dmach_t dma_ch, const char *name)
 
        if (dma_ch >= IMX_DMA_CHANNELS) {
                printk(KERN_CRIT "%s: called for  non-existed channel %d\n",
-                      __FUNCTION__, dma_ch);
+                      __func__, dma_ch);
                return -EINVAL;
        }
 
@@ -396,7 +396,7 @@ void imx_dma_free(imx_dmach_t dma_ch)
        if (!imxdma->name) {
                printk(KERN_CRIT
                       "%s: trying to free channel %d which is already freed\n",
-                      __FUNCTION__, dma_ch);
+                      __func__, dma_ch);
                return;
        }
 
@@ -410,7 +410,6 @@ void imx_dma_free(imx_dmach_t dma_ch)
 
 /**
  * imx_dma_request_by_prio - find and request some of free channels best suiting requested priority
- * @dma_ch: i.MX DMA channel number
  * @name: the driver/caller own non-%NULL identification
  * @prio: one of the hardware distinguished priority level:
  *        %DMA_PRIO_HIGH, %DMA_PRIO_MEDIUM, %DMA_PRIO_LOW
@@ -420,11 +419,9 @@ void imx_dma_free(imx_dmach_t dma_ch)
  * in the higher and then even lower priority groups.
  *
  * Return value: If there is no free channel to allocate, -%ENODEV is returned.
- *               Zero value indicates successful channel allocation.
+ *               On successful allocation channel is returned.
  */
-int
-imx_dma_request_by_prio(imx_dmach_t * pdma_ch, const char *name,
-                       imx_dma_prio prio)
+imx_dmach_t imx_dma_request_by_prio(const char *name, imx_dma_prio prio)
 {
        int i;
        int best;
@@ -444,19 +441,17 @@ imx_dma_request_by_prio(imx_dmach_t * pdma_ch, const char *name,
 
        for (i = best; i < IMX_DMA_CHANNELS; i++) {
                if (!imx_dma_request(i, name)) {
-                       *pdma_ch = i;
-                       return 0;
+                       return i;
                }
        }
 
        for (i = best - 1; i >= 0; i--) {
                if (!imx_dma_request(i, name)) {
-                       *pdma_ch = i;
-                       return 0;
+                       return i;
                }
        }
 
-       printk(KERN_ERR "%s: no free DMA channel found\n", __FUNCTION__);
+       printk(KERN_ERR "%s: no free DMA channel found\n", __func__);
 
        return -ENODEV;
 }
@@ -495,7 +490,7 @@ static irqreturn_t dma_err_handler(int irq, void *dev_id)
                /*
                 * The cleaning of @sg field would be questionable
                 * there, because its value can help to compute
-                * remaining/transfered bytes count in the handler
+                * remaining/transferred bytes count in the handler
                 */
                /*imx_dma_channels[i].sg = NULL;*/