diff options
| author | Javier Martin <javier.martin@vista-silicon.com> | 2012-03-22 09:54:09 -0400 |
|---|---|---|
| committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-03-26 02:01:31 -0400 |
| commit | 6b0e2f55e3ebc7089abf5e4770f03fb264b6d2ea (patch) | |
| tree | 689c8a182a49d11f5f86fef9e2914e789692bbdf | |
| parent | e4756b5e068d866239b6880a7030c9d31400b254 (diff) | |
dmaengine: imx-dma: remove 'resbytes' field of 'internal' structure.
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>
| -rw-r--r-- | drivers/dma/imx-dma.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index d7309e44c0df..6e03f928ca81 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c | |||
| @@ -129,8 +129,6 @@ enum imxdma_prep_type { | |||
| 129 | */ | 129 | */ |
| 130 | 130 | ||
| 131 | struct imxdma_channel_internal { | 131 | struct imxdma_channel_internal { |
| 132 | unsigned int resbytes; | ||
| 133 | |||
| 134 | struct timer_list watchdog; | 132 | struct timer_list watchdog; |
| 135 | 133 | ||
| 136 | int hw_chaining; | 134 | int hw_chaining; |
| @@ -233,12 +231,11 @@ static int imxdma_hw_chain(struct imxdma_channel_internal *imxdma) | |||
| 233 | static inline int imxdma_sg_next(struct imxdma_desc *d, struct scatterlist *sg) | 231 | static inline int imxdma_sg_next(struct imxdma_desc *d, struct scatterlist *sg) |
| 234 | { | 232 | { |
| 235 | struct imxdma_channel *imxdmac = to_imxdma_chan(d->desc.chan); | 233 | struct imxdma_channel *imxdmac = to_imxdma_chan(d->desc.chan); |
| 236 | struct imxdma_channel_internal *imxdma = &imxdmac->internal; | ||
| 237 | unsigned long now; | 234 | unsigned long now; |
| 238 | 235 | ||
| 239 | now = min(imxdma->resbytes, sg->length); | 236 | now = min(d->len, sg->length); |
| 240 | if (imxdma->resbytes != IMX_DMA_LENGTH_LOOP) | 237 | if (d->len != IMX_DMA_LENGTH_LOOP) |
| 241 | imxdma->resbytes -= now; | 238 | d->len -= now; |
| 242 | 239 | ||
| 243 | if (d->direction == DMA_DEV_TO_MEM) | 240 | if (d->direction == DMA_DEV_TO_MEM) |
| 244 | imx_dmav1_writel(sg->dma_address, DMA_DAR(imxdmac->channel)); | 241 | imx_dmav1_writel(sg->dma_address, DMA_DAR(imxdmac->channel)); |
| @@ -480,8 +477,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) | |||
| 480 | /* Cyclic transfer is the same as slave_sg with special sg configuration. */ | 477 | /* Cyclic transfer is the same as slave_sg with special sg configuration. */ |
| 481 | case IMXDMA_DESC_CYCLIC: | 478 | case IMXDMA_DESC_CYCLIC: |
| 482 | case IMXDMA_DESC_SLAVE_SG: | 479 | case IMXDMA_DESC_SLAVE_SG: |
| 483 | imxdmac->internal.resbytes = d->len; | ||
| 484 | |||
| 485 | if (d->direction == DMA_DEV_TO_MEM) { | 480 | if (d->direction == DMA_DEV_TO_MEM) { |
| 486 | imx_dmav1_writel(imxdmac->per_address, | 481 | imx_dmav1_writel(imxdmac->per_address, |
| 487 | DMA_SAR(imxdmac->channel)); | 482 | DMA_SAR(imxdmac->channel)); |
