diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2015-01-13 12:08:14 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-02-05 01:39:44 -0500 |
commit | d8ded50f8b26a224df48f9f93e49440c6a39b77f (patch) | |
tree | 7c7620107180b0a2c3ea77770ef8fb9bccfa8341 /drivers/dma/dw/core.c | |
parent | cfd8fef322305bbe9955817464f0d2054ce545c0 (diff) |
dmaengine: dw: define DW_DMA_MAX_NR_MASTERS
Instead of using magic number in the code the patch provides
DW_DMA_MAX_NR_MASTERS constant.
While here, restrict the reading of data width array by amount of the actual
number of AHB masters.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/dw/core.c')
-rw-r--r-- | drivers/dma/dw/core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index fcb9a916e6f6..0469d8eda253 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c | |||
@@ -1562,7 +1562,8 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata) | |||
1562 | } | 1562 | } |
1563 | } else { | 1563 | } else { |
1564 | dw->nr_masters = pdata->nr_masters; | 1564 | dw->nr_masters = pdata->nr_masters; |
1565 | memcpy(dw->data_width, pdata->data_width, 4); | 1565 | for (i = 0; i < dw->nr_masters; i++) |
1566 | dw->data_width[i] = pdata->data_width[i]; | ||
1566 | } | 1567 | } |
1567 | 1568 | ||
1568 | /* Calculate all channel mask before DMA setup */ | 1569 | /* Calculate all channel mask before DMA setup */ |