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/ioat_dma.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/ioat_dma.c')
-rw-r--r-- | drivers/dma/ioat_dma.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c index 318e8a22d814..90e5b0a28cbf 100644 --- a/drivers/dma/ioat_dma.c +++ b/drivers/dma/ioat_dma.c | |||
@@ -452,7 +452,8 @@ static void ioat2_dma_massage_chan_desc(struct ioat_dma_chan *ioat_chan) | |||
452 | * ioat_dma_alloc_chan_resources - returns the number of allocated descriptors | 452 | * ioat_dma_alloc_chan_resources - returns the number of allocated descriptors |
453 | * @chan: the channel to be filled out | 453 | * @chan: the channel to be filled out |
454 | */ | 454 | */ |
455 | static int ioat_dma_alloc_chan_resources(struct dma_chan *chan) | 455 | static int ioat_dma_alloc_chan_resources(struct dma_chan *chan, |
456 | struct dma_client *client) | ||
456 | { | 457 | { |
457 | struct ioat_dma_chan *ioat_chan = to_ioat_chan(chan); | 458 | struct ioat_dma_chan *ioat_chan = to_ioat_chan(chan); |
458 | struct ioat_desc_sw *desc; | 459 | struct ioat_desc_sw *desc; |
@@ -1049,7 +1050,7 @@ static int ioat_dma_self_test(struct ioatdma_device *device) | |||
1049 | dma_chan = container_of(device->common.channels.next, | 1050 | dma_chan = container_of(device->common.channels.next, |
1050 | struct dma_chan, | 1051 | struct dma_chan, |
1051 | device_node); | 1052 | device_node); |
1052 | if (device->common.device_alloc_chan_resources(dma_chan) < 1) { | 1053 | if (device->common.device_alloc_chan_resources(dma_chan, NULL) < 1) { |
1053 | dev_err(&device->pdev->dev, | 1054 | dev_err(&device->pdev->dev, |
1054 | "selftest cannot allocate chan resource\n"); | 1055 | "selftest cannot allocate chan resource\n"); |
1055 | err = -ENODEV; | 1056 | err = -ENODEV; |