From: Viresh Kumar Date: Wed, 1 Feb 2012 10:42:21 +0000 (+0530) Subject: dmaengine/dw_dmac: Don't use magic number for total number of channels X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e8d9f875c9b02bb56ba3bb44834ae81ba0e8efbc;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git dmaengine/dw_dmac: Don't use magic number for total number of channels Total number of channels is passed in pdata->nr_channels variable, thus we must not use magic number '7' for total number of channels. Signed-off-by: Viresh Kumar Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c index 3a3d7edcd553..157739423734 100644 --- a/drivers/dma/dw_dmac.c +++ b/drivers/dma/dw_dmac.c @@ -1432,7 +1432,7 @@ static int __init dw_probe(struct platform_device *pdev) /* 7 is highest priority & 0 is lowest. */ if (pdata->chan_priority == CHAN_PRIORITY_ASCENDING) - dwc->priority = 7 - i; + dwc->priority = pdata->nr_channels - i - 1; else dwc->priority = i;