Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756201Ab2BAKwa (ORCPT ); Wed, 1 Feb 2012 05:52:30 -0500 Received: from eu1sys200aog118.obsmtp.com ([207.126.144.145]:49313 "EHLO eu1sys200aog118.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756154Ab2BAKw2 (ORCPT ); Wed, 1 Feb 2012 05:52:28 -0500 From: Viresh Kumar To: , Cc: , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH V3 05/12] dmaengine/dw_dmac: Don't use magic number for total number of channels Date: Wed, 1 Feb 2012 16:12:21 +0530 Message-ID: <42b0936c114afb25ae50b34ecd3302ef86ea4190.1328091915.git.viresh.kumar@st.com> X-Mailer: git-send-email 1.7.8.110.g4cb5d In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 977 Lines: 29 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 --- drivers/dma/dw_dmac.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c index 3a3d7ed..1577394 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; -- 1.7.8.110.g4cb5d -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/