Merge tag 'dmaengine-4.18-rc1' of git://git.infradead.org/users/vkoul/slave-dma
[linux-2.6-block.git] / drivers / dma / qcom / bam_dma.c
index 4a828c18099a6e411ff928256992c836f93ebdcb..1617715aa6e072616374bfbb45089f4b119ad9c6 100644 (file)
@@ -451,6 +451,7 @@ static void bam_reset_channel(struct bam_chan *bchan)
 /**
  * bam_chan_init_hw - Initialize channel hardware
  * @bchan: bam channel
+ * @dir: DMA transfer direction
  *
  * This function resets and initializes the BAM channel
  */
@@ -673,7 +674,7 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan,
                                remainder = 0;
                        }
 
-                       async_desc->length += desc->size;
+                       async_desc->length += le16_to_cpu(desc->size);
                        desc++;
                } while (remainder > 0);
        }
@@ -687,7 +688,7 @@ err_out:
 
 /**
  * bam_dma_terminate_all - terminate all transactions on a channel
- * @bchan: bam dma channel
+ * @chan: bam dma channel
  *
  * Dequeues and frees all transactions
  * No callbacks are done
@@ -918,7 +919,8 @@ static enum dma_status bam_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
                                continue;
 
                        for (i = 0; i < async_desc->num_desc; i++)
-                               residue += async_desc->curr_desc[i].size;
+                               residue += le16_to_cpu(
+                                               async_desc->curr_desc[i].size);
                }
        }
 
@@ -958,7 +960,7 @@ static void bam_apply_new_config(struct bam_chan *bchan,
 
 /**
  * bam_start_dma - start next transaction
- * @bchan - bam dma channel
+ * @bchan: bam dma channel
  */
 static void bam_start_dma(struct bam_chan *bchan)
 {