dmaengine: omap-dma: Use defines for dma channels and request count
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Thu, 9 Apr 2015 09:35:50 +0000 (12:35 +0300)
committerVinod Koul <vinod.koul@intel.com>
Sat, 9 May 2015 11:41:25 +0000 (17:11 +0530)
Instead of magic numbers in the code, use define for number of logical DMA
channels and DMA requests.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/omap-dma.c

index 167dbaf6574275a0fffd5590b7a169e811320b39..4065963fbffbea3197d1cf0cf59df90fef2f818f 100644 (file)
@@ -22,6 +22,9 @@
 
 #include "virt-dma.h"
 
+#define OMAP_SDMA_REQUESTS     127
+#define OMAP_SDMA_CHANNELS     32
+
 struct omap_dmadev {
        struct dma_device ddev;
        spinlock_t lock;
@@ -33,7 +36,7 @@ struct omap_dmadev {
        bool legacy;
        spinlock_t irq_lock;
        uint32_t irq_enable_mask;
-       struct omap_chan *lch_map[32];
+       struct omap_chan *lch_map[OMAP_SDMA_CHANNELS];
 };
 
 struct omap_chan {
@@ -1116,7 +1119,7 @@ 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++) {
+       for (i = 0; i < OMAP_SDMA_REQUESTS; i++) {
                rc = omap_dma_chan_init(od, i);
                if (rc) {
                        omap_dma_free(od);
This page took 0.026546 seconds and 5 git commands to generate.