summaryrefslogtreecommitdiffstats
path: root/drivers/dma/ste_dma40.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-05-03 16:31:55 +0200
committerLinus Walleij <linus.walleij@linaro.org>2013-05-23 21:10:56 +0200
commit4f8fc46c797015dddc1d4c76e1b485b57373683b (patch)
tree2671a167f38e94918f0e0dbac5c8b0bd7296bb39 /drivers/dma/ste_dma40.c
parentdmaengine: ste_dma40: Move default memcpy configs into the driver (diff)
downloadlinux-4f8fc46c797015dddc1d4c76e1b485b57373683b.tar.xz
linux-4f8fc46c797015dddc1d4c76e1b485b57373683b.zip
dmaengine: ste_dma40: Rectify incorrect configuration validation checking
If we compare an event's group (dev_type / 16) with STEDMA40_DEV_DST_MEMORY (-1), the only way we'd obtain a positive result is if we passed -16 as a device type, which is unfeasible. Instead, it would be much more sane to compare STEDMA40_DEV_DST_MEMORY against the raw dev_type in order to expect the expected result. Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/dma/ste_dma40.c')
-rw-r--r--drivers/dma/ste_dma40.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index c47139ae8fa8..d481cb8521d9 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1785,19 +1785,19 @@ static int d40_validate_conf(struct d40_chan *d40c,
}
if (conf->dir == STEDMA40_MEM_TO_PERIPH &&
- dst_event_group == STEDMA40_DEV_DST_MEMORY) {
+ conf->dst_dev_type == STEDMA40_DEV_DST_MEMORY) {
chan_err(d40c, "Invalid dst\n");
res = -EINVAL;
}
if (conf->dir == STEDMA40_PERIPH_TO_MEM &&
- src_event_group == STEDMA40_DEV_SRC_MEMORY) {
+ conf->src_dev_type == STEDMA40_DEV_SRC_MEMORY) {
chan_err(d40c, "Invalid src\n");
res = -EINVAL;
}
- if (src_event_group == STEDMA40_DEV_SRC_MEMORY &&
- dst_event_group == STEDMA40_DEV_DST_MEMORY && is_log) {
+ if (conf->src_dev_type == STEDMA40_DEV_SRC_MEMORY &&
+ conf->dst_dev_type == STEDMA40_DEV_DST_MEMORY && is_log) {
chan_err(d40c, "No event line\n");
res = -EINVAL;
}