From b2d8984f3e7c84303e4d1cbd40d9e8cefd3c9737 Mon Sep 17 00:00:00 2001 From: Vinod Koul Date: Tue, 5 Apr 2016 15:31:33 -0700 Subject: dmaengine: add DMA_CYCLIC to dma_get_slave_caps dma_get_slave_caps() API only checked for slave capability where we use slave capabilities for cyclic dma operations as well, so we should add the cyclic case here too. Signed-off-by: Vinod Koul --- drivers/dma/dmaengine.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/dma/dmaengine.c') diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 0cb259c59916..3e55755e0ff1 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -482,7 +482,8 @@ int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps) device = chan->device; /* check if the channel supports slave transactions */ - if (!test_bit(DMA_SLAVE, device->cap_mask.bits)) + if ((!test_bit(DMA_SLAVE, device->cap_mask.bits)) || + (!test_bit(DMA_CYCLIC, device->cap_mask.bits))) return -ENXIO; /* -- cgit v1.2.3 From dd4e91d538b3d16d5241575a3fb654a9aa50392c Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 10 May 2016 20:43:34 +0300 Subject: dmaengine: slave means at least one of DMA_SLAVE, DMA_CYCLIC When check for capabilities recognize slave support by either DMA_SLAVE or DMA_CYCLIC bit set. If we don't do that the user can't get a normally worked DMA support for engines that doesn't have one of the mentioned bits set. Signed-off-by: Andy Shevchenko Signed-off-by: Vinod Koul --- drivers/dma/dmaengine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/dma/dmaengine.c') diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 3e55755e0ff1..42ef3457f39e 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -482,8 +482,8 @@ int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps) device = chan->device; /* check if the channel supports slave transactions */ - if ((!test_bit(DMA_SLAVE, device->cap_mask.bits)) || - (!test_bit(DMA_CYCLIC, device->cap_mask.bits))) + if (!(test_bit(DMA_SLAVE, device->cap_mask.bits) || + test_bit(DMA_CYCLIC, device->cap_mask.bits))) return -ENXIO; /* -- cgit v1.2.3 From d57d3a48ca784615e839475d8bdf8f3cecf77c8d Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Wed, 11 May 2016 13:39:27 -0400 Subject: dmaengine: core: Use IS_ENABLED() instead of checking for built-in or module The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either built-in or as a module, use that macro instead of open coding the same. Signed-off-by: Javier Martinez Canillas Signed-off-by: Vinod Koul --- drivers/dma/dmaengine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/dma/dmaengine.c') diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 42ef3457f39e..2432c2a55570 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -863,12 +863,12 @@ static bool device_has_all_tx_types(struct dma_device *device) return false; #endif - #if defined(CONFIG_ASYNC_MEMCPY) || defined(CONFIG_ASYNC_MEMCPY_MODULE) + #if IS_ENABLED(CONFIG_ASYNC_MEMCPY) if (!dma_has_cap(DMA_MEMCPY, device->cap_mask)) return false; #endif - #if defined(CONFIG_ASYNC_XOR) || defined(CONFIG_ASYNC_XOR_MODULE) + #if IS_ENABLED(CONFIG_ASYNC_XOR) if (!dma_has_cap(DMA_XOR, device->cap_mask)) return false; @@ -878,7 +878,7 @@ static bool device_has_all_tx_types(struct dma_device *device) #endif #endif - #if defined(CONFIG_ASYNC_PQ) || defined(CONFIG_ASYNC_PQ_MODULE) + #if IS_ENABLED(CONFIG_ASYNC_PQ) if (!dma_has_cap(DMA_PQ, device->cap_mask)) return false; -- cgit v1.2.3