aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/amba-pl08x.c
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2011-01-03 17:37:10 -0500
committerDan Williams <dan.j.williams@intel.com>2011-01-04 22:16:12 -0500
commit56b618820c92a5efa2145fbbac373fffbb024a94 (patch)
treec0e046e1be9007d35d436f4577d3272bec6c45f6 /drivers/dma/amba-pl08x.c
parent4c0df6a3ce8eb947647c7ed2640d0172936d8ef3 (diff)
ARM: PL08x: don't try to use llis_bus as a pointer
llis_bus is the DMA address of the LLI array. Casting it to be a pointer just to be able to use pointer arithmetic on it is not nice. We can trivially deal with the places where we do arithmetic on it, and it's actually cleaner this way. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/amba-pl08x.c')
-rw-r--r--drivers/dma/amba-pl08x.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 1081165d01a3..760b71eec84c 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -559,7 +559,7 @@ static int pl08x_fill_lli_for_desc(struct pl08x_driver_data *pl08x,
559 u32 cctl, u32 *remainder) 559 u32 cctl, u32 *remainder)
560{ 560{
561 struct pl08x_lli *llis_va = txd->llis_va; 561 struct pl08x_lli *llis_va = txd->llis_va;
562 struct pl08x_lli *llis_bus = (struct pl08x_lli *) txd->llis_bus; 562 dma_addr_t llis_bus = txd->llis_bus;
563 563
564 BUG_ON(num_llis >= MAX_NUM_TSFR_LLIS); 564 BUG_ON(num_llis >= MAX_NUM_TSFR_LLIS);
565 565
@@ -576,8 +576,7 @@ static int pl08x_fill_lli_for_desc(struct pl08x_driver_data *pl08x,
576 * memory. So we don't manipulate this bit currently. 576 * memory. So we don't manipulate this bit currently.
577 */ 577 */
578 578
579 llis_va[num_llis].next = 579 llis_va[num_llis].next = llis_bus + (num_llis + 1) * sizeof(struct pl08x_lli);
580 (dma_addr_t)((u32) &(llis_bus[num_llis + 1]));
581 580
582 if (cctl & PL080_CONTROL_SRC_INCR) 581 if (cctl & PL080_CONTROL_SRC_INCR)
583 txd->srcbus.addr += len; 582 txd->srcbus.addr += len;
@@ -621,7 +620,6 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x,
621 int max_bytes_per_lli; 620 int max_bytes_per_lli;
622 int total_bytes = 0; 621 int total_bytes = 0;
623 struct pl08x_lli *llis_va; 622 struct pl08x_lli *llis_va;
624 struct pl08x_lli *llis_bus;
625 623
626 txd->llis_va = dma_pool_alloc(pl08x->pool, GFP_NOWAIT, 624 txd->llis_va = dma_pool_alloc(pl08x->pool, GFP_NOWAIT,
627 &txd->llis_bus); 625 &txd->llis_bus);
@@ -971,8 +969,7 @@ static void pl08x_free_txd(struct pl08x_driver_data *pl08x,
971 struct pl08x_txd *txd) 969 struct pl08x_txd *txd)
972{ 970{
973 /* Free the LLI */ 971 /* Free the LLI */
974 dma_pool_free(pl08x->pool, txd->llis_va, 972 dma_pool_free(pl08x->pool, txd->llis_va, txd->llis_bus);
975 txd->llis_bus);
976 973
977 pl08x->pool_ctr--; 974 pl08x->pool_ctr--;
978 975