aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/dmaengine.c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2014-11-17 14:42:53 +0100
committerVinod Koul <vinod.koul@intel.com>2014-12-22 12:34:21 +0530
commitecc19d17868be9c9f8f00ed928791533c420f3e0 (patch)
tree936edd52f9a45f70f7aac10ffd5793bebf55ece8 /drivers/dma/dmaengine.c
parentdmaengine: sun6i: Declare slave capabilities for the generic code (diff)
downloadlinux-dev-ecc19d17868be9c9f8f00ed928791533c420f3e0.tar.xz
linux-dev-ecc19d17868be9c9f8f00ed928791533c420f3e0.zip
dmaengine: Add a warning for drivers not using the generic slave caps retrieval
For the slave caps retrieval to be really useful, most drivers need to implement it. Hence, we need to be slightly more aggressive, and trigger a warning at registration time for drivers that don't fill their caps infos in order to encourage them to implement it. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/dmaengine.c')
-rw-r--r--drivers/dma/dmaengine.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index cae120994d8f..30211f9791b7 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -826,6 +826,9 @@ int dma_async_device_register(struct dma_device *device)
BUG_ON(!device->device_issue_pending);
BUG_ON(!device->dev);
+ WARN(dma_has_cap(DMA_SLAVE, device->cap_mask) && !device->directions,
+ "this driver doesn't support generic slave capabilities reporting\n");
+
/* note: this only matters in the
* CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=n case
*/