diff options
Diffstat (limited to 'drivers/dma/shdma.c')
-rw-r--r-- | drivers/dma/shdma.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c index 5d17e09cb625..7a18b580f626 100644 --- a/drivers/dma/shdma.c +++ b/drivers/dma/shdma.c | |||
@@ -25,8 +25,7 @@ | |||
25 | #include <linux/dma-mapping.h> | 25 | #include <linux/dma-mapping.h> |
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | #include <linux/pm_runtime.h> | 27 | #include <linux/pm_runtime.h> |
28 | 28 | #include <linux/sh_dma.h> | |
29 | #include <asm/dmaengine.h> | ||
30 | 29 | ||
31 | #include "shdma.h" | 30 | #include "shdma.h" |
32 | 31 | ||
@@ -44,7 +43,7 @@ enum sh_dmae_desc_status { | |||
44 | #define LOG2_DEFAULT_XFER_SIZE 2 | 43 | #define LOG2_DEFAULT_XFER_SIZE 2 |
45 | 44 | ||
46 | /* A bitmask with bits enough for enum sh_dmae_slave_chan_id */ | 45 | /* A bitmask with bits enough for enum sh_dmae_slave_chan_id */ |
47 | static unsigned long sh_dmae_slave_used[BITS_TO_LONGS(SHDMA_SLAVE_NUMBER)]; | 46 | static unsigned long sh_dmae_slave_used[BITS_TO_LONGS(SH_DMA_SLAVE_NUMBER)]; |
48 | 47 | ||
49 | static void sh_dmae_chan_ld_cleanup(struct sh_dmae_chan *sh_chan, bool all); | 48 | static void sh_dmae_chan_ld_cleanup(struct sh_dmae_chan *sh_chan, bool all); |
50 | 49 | ||
@@ -266,7 +265,7 @@ static struct sh_desc *sh_dmae_get_desc(struct sh_dmae_chan *sh_chan) | |||
266 | } | 265 | } |
267 | 266 | ||
268 | static struct sh_dmae_slave_config *sh_dmae_find_slave( | 267 | static struct sh_dmae_slave_config *sh_dmae_find_slave( |
269 | struct sh_dmae_chan *sh_chan, enum sh_dmae_slave_chan_id slave_id) | 268 | struct sh_dmae_chan *sh_chan, struct sh_dmae_slave *param) |
270 | { | 269 | { |
271 | struct dma_device *dma_dev = sh_chan->common.device; | 270 | struct dma_device *dma_dev = sh_chan->common.device; |
272 | struct sh_dmae_device *shdev = container_of(dma_dev, | 271 | struct sh_dmae_device *shdev = container_of(dma_dev, |
@@ -274,11 +273,11 @@ static struct sh_dmae_slave_config *sh_dmae_find_slave( | |||
274 | struct sh_dmae_pdata *pdata = shdev->pdata; | 273 | struct sh_dmae_pdata *pdata = shdev->pdata; |
275 | int i; | 274 | int i; |
276 | 275 | ||
277 | if ((unsigned)slave_id >= SHDMA_SLAVE_NUMBER) | 276 | if (param->slave_id >= SH_DMA_SLAVE_NUMBER) |
278 | return NULL; | 277 | return NULL; |
279 | 278 | ||
280 | for (i = 0; i < pdata->slave_num; i++) | 279 | for (i = 0; i < pdata->slave_num; i++) |
281 | if (pdata->slave[i].slave_id == slave_id) | 280 | if (pdata->slave[i].slave_id == param->slave_id) |
282 | return pdata->slave + i; | 281 | return pdata->slave + i; |
283 | 282 | ||
284 | return NULL; | 283 | return NULL; |
@@ -299,7 +298,7 @@ static int sh_dmae_alloc_chan_resources(struct dma_chan *chan) | |||
299 | if (param) { | 298 | if (param) { |
300 | struct sh_dmae_slave_config *cfg; | 299 | struct sh_dmae_slave_config *cfg; |
301 | 300 | ||
302 | cfg = sh_dmae_find_slave(sh_chan, param->slave_id); | 301 | cfg = sh_dmae_find_slave(sh_chan, param); |
303 | if (!cfg) | 302 | if (!cfg) |
304 | return -EINVAL; | 303 | return -EINVAL; |
305 | 304 | ||