dma: mv_xor: Add a device_control function
authorAndrew Lunn <andrew@lunn.ch>
Sun, 18 Nov 2012 10:44:56 +0000 (11:44 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 20 Nov 2012 14:59:01 +0000 (15:59 +0100)
The dmatest module for DMA engines calls

device_control(dtc->chan, DMA_TERMINATE_ALL, 0);

after completing the tests. The documentation in
include/linux/dmaengine.h suggests this function is optional and
dma_async_device_register() also does not BUG_ON() when not passed a
function. However, dmatest is not the only code in the kernel
unconditionally calling device_control. So add an implementation
indicating all operations are not implemented.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
drivers/dma/mv_xor.c

index 97c8611f5ffbcde3adf3cfd64b9e2ffa6f82c216..f450fe8cbd6136729c25658c48b52c96068d0c9b 100644 (file)
@@ -1070,6 +1070,14 @@ out:
        return err;
 }
 
+/* This driver does not implement any of the optional DMA operations. */
+static int
+mv_xor_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
+              unsigned long arg)
+{
+       return -ENOSYS;
+}
+
 static int mv_xor_channel_remove(struct mv_xor_chan *mv_chan)
 {
        struct dma_chan *chan, *_chan;
@@ -1130,6 +1138,7 @@ mv_xor_channel_add(struct mv_xor_device *xordev,
        dma_dev->device_free_chan_resources = mv_xor_free_chan_resources;
        dma_dev->device_tx_status = mv_xor_status;
        dma_dev->device_issue_pending = mv_xor_issue_pending;
+       dma_dev->device_control = mv_xor_control;
        dma_dev->dev = &pdev->dev;
 
        /* set prep routines based on capability */