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>
This commit is contained in:
Andy Shevchenko 2015-01-13 19:08:14 +02:00 committed by Vinod Koul
commit d8ded50f8b
8 changed files with 13 additions and 10 deletions

View file

@ -13,6 +13,8 @@
#include <linux/device.h>
#define DW_DMA_MAX_NR_MASTERS 4
/**
* struct dw_dma_slave - Controller-specific information about a slave
*
@ -53,7 +55,7 @@ struct dw_dma_platform_data {
unsigned char chan_priority;
unsigned short block_size;
unsigned char nr_masters;
unsigned char data_width[4];
unsigned char data_width[DW_DMA_MAX_NR_MASTERS];
};
#endif /* _PLATFORM_DATA_DMA_DW_H */