From patchwork Fri Mar 7 12:16:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: R Sricharan X-Patchwork-Id: 3790211 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 03A77BF549 for ; Fri, 7 Mar 2014 12:17:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3426F2024C for ; Fri, 7 Mar 2014 12:17:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F7AD20274 for ; Fri, 7 Mar 2014 12:17:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752770AbaCGMRa (ORCPT ); Fri, 7 Mar 2014 07:17:30 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:54029 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751840AbaCGMR2 (ORCPT ); Fri, 7 Mar 2014 07:17:28 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s27CGrIf002985; Fri, 7 Mar 2014 06:16:53 -0600 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s27CGrKQ001004; Fri, 7 Mar 2014 06:16:53 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 7 Mar 2014 06:16:52 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s27CGhvw003967; Fri, 7 Mar 2014 06:16:48 -0600 From: Sricharan R To: , , , , , CC: , , , , , , , Subject: [RFC PATCH 1/9] drivers: dma: omap-dma: Avoid hard-coding of the dma-request channels Date: Fri, 7 Mar 2014 17:46:08 +0530 Message-ID: <1394194576-23741-2-git-send-email-r.sricharan@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1394194576-23741-1-git-send-email-r.sricharan@ti.com> References: <1394194576-23741-1-git-send-email-r.sricharan@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The total number of dma-request channels is hard-coded. Instead read the data from DT. Signed-off-by: Sricharan R --- drivers/dma/omap-dma.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index 64ceca2..a0d6639 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c @@ -1093,6 +1093,7 @@ static int omap_dma_probe(struct platform_device *pdev) struct omap_dmadev *od; struct resource *res; int rc, i, irq; + u32 reqs; od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL); if (!od) @@ -1126,7 +1127,9 @@ static int omap_dma_probe(struct platform_device *pdev) tasklet_init(&od->task, omap_dma_sched, (unsigned long)od); - for (i = 0; i < 127; i++) { + of_property_read_u32(pdev->dev.of_node, "#dma-requests", &reqs); + + for (i = 0; i < reqs; i++) { rc = omap_dma_chan_init(od, i); if (rc) { omap_dma_free(od);