Skip to content

Commit

Permalink
dmaengine: omap-dma: Use defines for dma channels and request count
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Ujfalusi authored and Vinod Koul committed May 9, 2015
1 parent 73f67d3 commit 341ce71
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/dma/omap-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 341ce71

Please sign in to comment.