Skip to content

Commit

Permalink
ARM: OMAP: Fix the use of uninitialized dma_lch_count
Browse files Browse the repository at this point in the history
  'omap_dma_reserve_channels' when used is suppose to be from command.
    so, it alreay has value before 1st call of omap_system_dma_probe.
    and it will never be changed again during running (not from ioctl).

  but 'dma_lch_count' is zero before 1st call of omap_system_dma_probe.
    so it will be failed for omap_dma_reserve_channels, when 1st call.

  so, need use 'd->lch_count' instead of 'dma_lch_count' for judging.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Chen Gang authored and Tony Lindgren committed Feb 1, 2013
1 parent aecb9e1 commit e78f960
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/plat-omap/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -2019,7 +2019,7 @@ static int omap_system_dma_probe(struct platform_device *pdev)
errata = p->errata;

if ((d->dev_caps & RESERVE_CHANNEL) && omap_dma_reserve_channels
&& (omap_dma_reserve_channels <= dma_lch_count))
&& (omap_dma_reserve_channels < d->lch_count))
d->lch_count = omap_dma_reserve_channels;

dma_lch_count = d->lch_count;
Expand Down

0 comments on commit e78f960

Please sign in to comment.