diff options
author | Sekhar Nori <nsekhar@ti.com> | 2010-06-29 08:05:12 +0200 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-08-05 18:58:24 +0200 |
commit | bc3ac9f31642fb4697b313c2eb575c5286f35c2a (patch) | |
tree | abeeaa649da9d69713bf876575b5ba95befb1731 /arch/arm/mach-davinci/devices-tnetv107x.c | |
parent | davinci: da8xx: sparse cleanup: remove duplicate entries in irq priorities (diff) | |
download | linux-bc3ac9f31642fb4697b313c2eb575c5286f35c2a.tar.xz linux-bc3ac9f31642fb4697b313c2eb575c5286f35c2a.zip |
davinci: edma: provide ability to detect insufficient CC info data
This patch modifies the EDMA driver to expect the channel
controller (CC) infomation passed on by the platform as a fixed
size (EDMA_MAX_CC) array of pointers to structures.
Doing so helps catch errors of the sort where the resource
structure has information for more channel controllers than
the number channel controller info structures defined.
Such insufficient platform data would lead to illegal memory
accesses.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/devices-tnetv107x.c')
-rw-r--r-- | arch/arm/mach-davinci/devices-tnetv107x.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c index 4eef6ccdc73e..2718a3a90dff 100644 --- a/arch/arm/mach-davinci/devices-tnetv107x.c +++ b/arch/arm/mach-davinci/devices-tnetv107x.c @@ -69,16 +69,18 @@ static const s8 edma_priority_mapping[][2] = { { -1, -1 } }; -static struct edma_soc_info edma_info[] = { - { - .n_channel = EDMA_TNETV107X_NUM_DMACH, - .n_region = EDMA_TNETV107X_NUM_REGIONS, - .n_slot = EDMA_TNETV107X_NUM_PARAMENTRY, - .n_tc = EDMA_TNETV107X_NUM_TC, - .n_cc = 1, - .queue_tc_mapping = edma_tc_mapping, - .queue_priority_mapping = edma_priority_mapping, - }, +static struct edma_soc_info edma_cc0_info = { + .n_channel = EDMA_TNETV107X_NUM_DMACH, + .n_region = EDMA_TNETV107X_NUM_REGIONS, + .n_slot = EDMA_TNETV107X_NUM_PARAMENTRY, + .n_tc = EDMA_TNETV107X_NUM_TC, + .n_cc = 1, + .queue_tc_mapping = edma_tc_mapping, + .queue_priority_mapping = edma_priority_mapping, +}; + +static struct edma_soc_info *tnetv107x_edma_info[EDMA_MAX_CC] = { + &edma_cc0_info, }; static struct resource edma_resources[] = { @@ -117,7 +119,7 @@ static struct platform_device edma_device = { .id = -1, .num_resources = ARRAY_SIZE(edma_resources), .resource = edma_resources, - .dev.platform_data = edma_info, + .dev.platform_data = tnetv107x_edma_info, }; static struct plat_serial8250_port serial_data[] = { |