Skip to content

Commit

Permalink
DaVinci: EDMA: Fix bug in edma_free_cont_slots API
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sandeep Paulraj authored and Kevin Hilman committed Nov 25, 2009
1 parent 7761ef6 commit 51c99e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/arm/mach-davinci/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ EXPORT_SYMBOL(edma_alloc_cont_slots);
*/
int edma_free_cont_slots(unsigned slot, int count)
{
unsigned ctlr;
unsigned ctlr, slot_to_free;
int i;

ctlr = EDMA_CTLR(slot);
Expand All @@ -826,11 +826,11 @@ int edma_free_cont_slots(unsigned slot, int count)

for (i = slot; i < slot + count; ++i) {
ctlr = EDMA_CTLR(i);
slot = EDMA_CHAN_SLOT(i);
slot_to_free = EDMA_CHAN_SLOT(i);

memcpy_toio(edmacc_regs_base[ctlr] + PARM_OFFSET(slot),
memcpy_toio(edmacc_regs_base[ctlr] + PARM_OFFSET(slot_to_free),
&dummy_paramset, PARM_SIZE);
clear_bit(slot, edma_info[ctlr]->edma_inuse);
clear_bit(slot_to_free, edma_info[ctlr]->edma_inuse);
}

return 0;
Expand Down

0 comments on commit 51c99e0

Please sign in to comment.