aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/dma.c
diff options
context:
space:
mode:
authorSandeep Paulraj <s-paulraj@ti.com>2009-09-16 18:09:59 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-11-25 13:21:24 -0500
commit51c99e0498c637bf43fb3be786d121d8dceef337 (patch)
tree3cdaeeb6bf68cc78b8f6bb4a9e15a8cdc2ba1793 /arch/arm/mach-davinci/dma.c
parent7761ef67930dac37f90aaf0ffcd6b1f473c07dfc (diff)
DaVinci: EDMA: Fix bug in edma_free_cont_slots API
In the edma_free_cont_slots API, the variable slot was being modified and then used in the for loop. This results in incorrect behaviour when the API is used. Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/dma.c')
-rw-r--r--arch/arm/mach-davinci/dma.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/mach-davinci/dma.c
index f2e57d272958..89ce3e1a7ab1 100644
--- a/arch/arm/mach-davinci/dma.c
+++ b/arch/arm/mach-davinci/dma.c
@@ -813,7 +813,7 @@ EXPORT_SYMBOL(edma_alloc_cont_slots);
813 */ 813 */
814int edma_free_cont_slots(unsigned slot, int count) 814int edma_free_cont_slots(unsigned slot, int count)
815{ 815{
816 unsigned ctlr; 816 unsigned ctlr, slot_to_free;
817 int i; 817 int i;
818 818
819 ctlr = EDMA_CTLR(slot); 819 ctlr = EDMA_CTLR(slot);
@@ -826,11 +826,11 @@ int edma_free_cont_slots(unsigned slot, int count)
826 826
827 for (i = slot; i < slot + count; ++i) { 827 for (i = slot; i < slot + count; ++i) {
828 ctlr = EDMA_CTLR(i); 828 ctlr = EDMA_CTLR(i);
829 slot = EDMA_CHAN_SLOT(i); 829 slot_to_free = EDMA_CHAN_SLOT(i);
830 830
831 memcpy_toio(edmacc_regs_base[ctlr] + PARM_OFFSET(slot), 831 memcpy_toio(edmacc_regs_base[ctlr] + PARM_OFFSET(slot_to_free),
832 &dummy_paramset, PARM_SIZE); 832 &dummy_paramset, PARM_SIZE);
833 clear_bit(slot, edma_info[ctlr]->edma_inuse); 833 clear_bit(slot_to_free, edma_info[ctlr]->edma_inuse);
834 } 834 }
835 835
836 return 0; 836 return 0;