Skip to content

Commit

Permalink
dmaengine: imx-dma: remove 'resbytes' field of 'internal' structure.
Browse files Browse the repository at this point in the history
Use per-descriptor 'len' field to keep track of the remaining bytes
instead. This goes on the direction of eventually removing the
'internal' structure.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
  • Loading branch information
Javier Martin authored and Vinod Koul committed Mar 26, 2012
1 parent e4756b5 commit 6b0e2f5
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions drivers/dma/imx-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ enum imxdma_prep_type {
*/

struct imxdma_channel_internal {
unsigned int resbytes;

struct timer_list watchdog;

int hw_chaining;
Expand Down Expand Up @@ -233,12 +231,11 @@ static int imxdma_hw_chain(struct imxdma_channel_internal *imxdma)
static inline int imxdma_sg_next(struct imxdma_desc *d, struct scatterlist *sg)
{
struct imxdma_channel *imxdmac = to_imxdma_chan(d->desc.chan);
struct imxdma_channel_internal *imxdma = &imxdmac->internal;
unsigned long now;

now = min(imxdma->resbytes, sg->length);
if (imxdma->resbytes != IMX_DMA_LENGTH_LOOP)
imxdma->resbytes -= now;
now = min(d->len, sg->length);
if (d->len != IMX_DMA_LENGTH_LOOP)
d->len -= now;

if (d->direction == DMA_DEV_TO_MEM)
imx_dmav1_writel(sg->dma_address, DMA_DAR(imxdmac->channel));
Expand Down Expand Up @@ -480,8 +477,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
/* Cyclic transfer is the same as slave_sg with special sg configuration. */
case IMXDMA_DESC_CYCLIC:
case IMXDMA_DESC_SLAVE_SG:
imxdmac->internal.resbytes = d->len;

if (d->direction == DMA_DEV_TO_MEM) {
imx_dmav1_writel(imxdmac->per_address,
DMA_SAR(imxdmac->channel));
Expand Down

0 comments on commit 6b0e2f5

Please sign in to comment.