diff options
author | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-07-08 14:58:58 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2008-07-08 14:58:58 -0400 |
commit | 848c536a37b8db4e461f14ca15fe29850151c822 (patch) | |
tree | f4a88e92e31de28511e3a3de99200a77d2613dae /drivers/dma/fsldma.c | |
parent | 4a776f0aa922a552460192c07b56f4fe9cd82632 (diff) |
dmaengine: Add dma_client parameter to device_alloc_chan_resources
A DMA controller capable of doing slave transfers may need to know a
few things about the slave when preparing the channel. We don't want
to add this information to struct dma_channel since the channel hasn't
yet been bound to a client at this point.
Instead, pass a reference to the client requesting the channel to the
driver's device_alloc_chan_resources hook so that it can pick the
necessary information from the dma_client struct by itself.
[dan.j.williams@intel.com: fixed up fsldma and mv_xor]
Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/fsldma.c')
-rw-r--r-- | drivers/dma/fsldma.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 724f6fdd0af6..c0059ca58340 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c | |||
@@ -366,7 +366,8 @@ static struct fsl_desc_sw *fsl_dma_alloc_descriptor( | |||
366 | * | 366 | * |
367 | * Return - The number of descriptors allocated. | 367 | * Return - The number of descriptors allocated. |
368 | */ | 368 | */ |
369 | static int fsl_dma_alloc_chan_resources(struct dma_chan *chan) | 369 | static int fsl_dma_alloc_chan_resources(struct dma_chan *chan, |
370 | struct dma_client *client) | ||
370 | { | 371 | { |
371 | struct fsl_dma_chan *fsl_chan = to_fsl_chan(chan); | 372 | struct fsl_dma_chan *fsl_chan = to_fsl_chan(chan); |
372 | LIST_HEAD(tmp_list); | 373 | LIST_HEAD(tmp_list); |
@@ -819,7 +820,7 @@ static int fsl_dma_self_test(struct fsl_dma_chan *fsl_chan) | |||
819 | 820 | ||
820 | chan = &fsl_chan->common; | 821 | chan = &fsl_chan->common; |
821 | 822 | ||
822 | if (fsl_dma_alloc_chan_resources(chan) < 1) { | 823 | if (fsl_dma_alloc_chan_resources(chan, NULL) < 1) { |
823 | dev_err(fsl_chan->dev, | 824 | dev_err(fsl_chan->dev, |
824 | "selftest: Cannot alloc resources for DMA\n"); | 825 | "selftest: Cannot alloc resources for DMA\n"); |
825 | err = -ENODEV; | 826 | err = -ENODEV; |
@@ -847,7 +848,7 @@ static int fsl_dma_self_test(struct fsl_dma_chan *fsl_chan) | |||
847 | /* Test free and re-alloc channel resources */ | 848 | /* Test free and re-alloc channel resources */ |
848 | fsl_dma_free_chan_resources(chan); | 849 | fsl_dma_free_chan_resources(chan); |
849 | 850 | ||
850 | if (fsl_dma_alloc_chan_resources(chan) < 1) { | 851 | if (fsl_dma_alloc_chan_resources(chan, NULL) < 1) { |
851 | dev_err(fsl_chan->dev, | 852 | dev_err(fsl_chan->dev, |
852 | "selftest: Cannot alloc resources for DMA\n"); | 853 | "selftest: Cannot alloc resources for DMA\n"); |
853 | err = -ENODEV; | 854 | err = -ENODEV; |