]> err.no Git - linux-2.6/blobdiff - drivers/dma/iop-adma.c
dmaengine: Add dma_client parameter to device_alloc_chan_resources
[linux-2.6] / drivers / dma / iop-adma.c
index 762b729672e02bbe530c580f13cbe6395b53ccc3..b57564dd023275fc71a03044c0a2e6110bc6b72e 100644 (file)
@@ -444,7 +444,8 @@ static void iop_chan_start_null_memcpy(struct iop_adma_chan *iop_chan);
 static void iop_chan_start_null_xor(struct iop_adma_chan *iop_chan);
 
 /* returns the number of allocated descriptors */
-static int iop_adma_alloc_chan_resources(struct dma_chan *chan)
+static int iop_adma_alloc_chan_resources(struct dma_chan *chan,
+                                        struct dma_client *client)
 {
        char *hw_desc;
        int idx;
@@ -821,10 +822,10 @@ static int __devinit iop_adma_memcpy_self_test(struct iop_adma_device *device)
 
        dev_dbg(device->common.dev, "%s\n", __func__);
 
-       src = kzalloc(sizeof(u8) * IOP_ADMA_TEST_SIZE, GFP_KERNEL);
+       src = kmalloc(IOP_ADMA_TEST_SIZE, GFP_KERNEL);
        if (!src)
                return -ENOMEM;
-       dest = kzalloc(sizeof(u8) * IOP_ADMA_TEST_SIZE, GFP_KERNEL);
+       dest = kzalloc(IOP_ADMA_TEST_SIZE, GFP_KERNEL);
        if (!dest) {
                kfree(src);
                return -ENOMEM;
@@ -834,13 +835,11 @@ static int __devinit iop_adma_memcpy_self_test(struct iop_adma_device *device)
        for (i = 0; i < IOP_ADMA_TEST_SIZE; i++)
                ((u8 *) src)[i] = (u8)i;
 
-       memset(dest, 0, IOP_ADMA_TEST_SIZE);
-
        /* Start copy, using first DMA channel */
        dma_chan = container_of(device->common.channels.next,
                                struct dma_chan,
                                device_node);
-       if (iop_adma_alloc_chan_resources(dma_chan) < 1) {
+       if (iop_adma_alloc_chan_resources(dma_chan, NULL) < 1) {
                err = -ENODEV;
                goto out;
        }
@@ -938,7 +937,7 @@ iop_adma_xor_zero_sum_self_test(struct iop_adma_device *device)
        dma_chan = container_of(device->common.channels.next,
                                struct dma_chan,
                                device_node);
-       if (iop_adma_alloc_chan_resources(dma_chan) < 1) {
+       if (iop_adma_alloc_chan_resources(dma_chan, NULL) < 1) {
                err = -ENODEV;
                goto out;
        }
@@ -1389,6 +1388,8 @@ static void iop_chan_start_null_xor(struct iop_adma_chan *iop_chan)
        spin_unlock_bh(&iop_chan->lock);
 }
 
+MODULE_ALIAS("platform:iop-adma");
+
 static struct platform_driver iop_adma_driver = {
        .probe          = iop_adma_probe,
        .remove         = iop_adma_remove,