aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/iop-adma.c
diff options
context:
space:
mode:
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-07-08 14:58:58 -0400
committerDan Williams <dan.j.williams@intel.com>2008-07-08 14:58:58 -0400
commit848c536a37b8db4e461f14ca15fe29850151c822 (patch)
treef4a88e92e31de28511e3a3de99200a77d2613dae /drivers/dma/iop-adma.c
parent4a776f0aa922a552460192c07b56f4fe9cd82632 (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/iop-adma.c')
-rw-r--r--drivers/dma/iop-adma.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c
index 4e6b052c0654..b57564dd0232 100644
--- a/drivers/dma/iop-adma.c
+++ b/drivers/dma/iop-adma.c
@@ -444,7 +444,8 @@ static void iop_chan_start_null_memcpy(struct iop_adma_chan *iop_chan);
444static void iop_chan_start_null_xor(struct iop_adma_chan *iop_chan); 444static void iop_chan_start_null_xor(struct iop_adma_chan *iop_chan);
445 445
446/* returns the number of allocated descriptors */ 446/* returns the number of allocated descriptors */
447static int iop_adma_alloc_chan_resources(struct dma_chan *chan) 447static int iop_adma_alloc_chan_resources(struct dma_chan *chan,
448 struct dma_client *client)
448{ 449{
449 char *hw_desc; 450 char *hw_desc;
450 int idx; 451 int idx;
@@ -838,7 +839,7 @@ static int __devinit iop_adma_memcpy_self_test(struct iop_adma_device *device)
838 dma_chan = container_of(device->common.channels.next, 839 dma_chan = container_of(device->common.channels.next,
839 struct dma_chan, 840 struct dma_chan,
840 device_node); 841 device_node);
841 if (iop_adma_alloc_chan_resources(dma_chan) < 1) { 842 if (iop_adma_alloc_chan_resources(dma_chan, NULL) < 1) {
842 err = -ENODEV; 843 err = -ENODEV;
843 goto out; 844 goto out;
844 } 845 }
@@ -936,7 +937,7 @@ iop_adma_xor_zero_sum_self_test(struct iop_adma_device *device)
936 dma_chan = container_of(device->common.channels.next, 937 dma_chan = container_of(device->common.channels.next,
937 struct dma_chan, 938 struct dma_chan,
938 device_node); 939 device_node);
939 if (iop_adma_alloc_chan_resources(dma_chan) < 1) { 940 if (iop_adma_alloc_chan_resources(dma_chan, NULL) < 1) {
940 err = -ENODEV; 941 err = -ENODEV;
941 goto out; 942 goto out;
942 } 943 }