[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1394194576-23741-2-git-send-email-r.sricharan@ti.com>
Date: Fri, 7 Mar 2014 17:46:08 +0530
From: Sricharan R <r.sricharan@...com>
To: <r.sricharan@...com>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-omap@...r.kernel.org>, <dmaengine@...r.kernel.org>
CC: <santosh.shilimkar@...com>, <rnayak@...com>, <nsekhar@...com>,
<tony@...mide.com>, <linux@....linux.org.uk>,
<vinod.koul@...el.com>, <dan.j.williams@...el.com>, <nm@...com>
Subject: [RFC PATCH 1/9] drivers: dma: omap-dma: Avoid hard-coding of the dma-request channels
The total number of dma-request channels is hard-coded. Instead read the
data from DT.
Signed-off-by: Sricharan R <r.sricharan@...com>
---
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);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists