aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-05-03 13:49:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-05-03 13:49:04 -0400
commit3333222484dc7e46fd17cc1d394088fb0d963e6c (patch)
tree0b2c74327cf0ae200030c9892e6b267fd9a26bb1
parent180d89f6ef9c22d088e324eb5e7d030ef3f84df0 (diff)
parent63f89caad0e32dcfa17b2d17919816253de48996 (diff)
Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave dmaengine fixes from Vinod Koul: "Here are the fixes in dmaengine subsystem for rc2: - privatecnt fix for slave dma request API by Christopher - warn fix for PM ifdef in usb-dmac by Geert - fix hardware dependency for xgene by Jean" * 'next' of git://git.infradead.org/users/vkoul/slave-dma: dmaengine: increment privatecnt when using dma_get_any_slave_channel dmaengine: xgene: Set hardware dependency dmaengine: usb-dmac: Protect PM-only functions to kill warning
-rw-r--r--drivers/dma/Kconfig1
-rw-r--r--drivers/dma/dmaengine.c4
-rw-r--r--drivers/dma/sh/usb-dmac.c2
3 files changed, 7 insertions, 0 deletions
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index fd7ac13f2574..bda2cb06dc7a 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -437,6 +437,7 @@ config IMG_MDC_DMA
437 437
438config XGENE_DMA 438config XGENE_DMA
439 tristate "APM X-Gene DMA support" 439 tristate "APM X-Gene DMA support"
440 depends on ARCH_XGENE || COMPILE_TEST
440 select DMA_ENGINE 441 select DMA_ENGINE
441 select DMA_ENGINE_RAID 442 select DMA_ENGINE_RAID
442 select ASYNC_TX_ENABLE_CHANNEL_SWITCH 443 select ASYNC_TX_ENABLE_CHANNEL_SWITCH
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 0e035a8cf401..2890d744bb1b 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -571,11 +571,15 @@ struct dma_chan *dma_get_any_slave_channel(struct dma_device *device)
571 571
572 chan = private_candidate(&mask, device, NULL, NULL); 572 chan = private_candidate(&mask, device, NULL, NULL);
573 if (chan) { 573 if (chan) {
574 dma_cap_set(DMA_PRIVATE, device->cap_mask);
575 device->privatecnt++;
574 err = dma_chan_get(chan); 576 err = dma_chan_get(chan);
575 if (err) { 577 if (err) {
576 pr_debug("%s: failed to get %s: (%d)\n", 578 pr_debug("%s: failed to get %s: (%d)\n",
577 __func__, dma_chan_name(chan), err); 579 __func__, dma_chan_name(chan), err);
578 chan = NULL; 580 chan = NULL;
581 if (--device->privatecnt == 0)
582 dma_cap_clear(DMA_PRIVATE, device->cap_mask);
579 } 583 }
580 } 584 }
581 585
diff --git a/drivers/dma/sh/usb-dmac.c b/drivers/dma/sh/usb-dmac.c
index f705798ce3eb..ebd8a5f398b0 100644
--- a/drivers/dma/sh/usb-dmac.c
+++ b/drivers/dma/sh/usb-dmac.c
@@ -673,6 +673,7 @@ static struct dma_chan *usb_dmac_of_xlate(struct of_phandle_args *dma_spec,
673 * Power management 673 * Power management
674 */ 674 */
675 675
676#ifdef CONFIG_PM
676static int usb_dmac_runtime_suspend(struct device *dev) 677static int usb_dmac_runtime_suspend(struct device *dev)
677{ 678{
678 struct usb_dmac *dmac = dev_get_drvdata(dev); 679 struct usb_dmac *dmac = dev_get_drvdata(dev);
@@ -690,6 +691,7 @@ static int usb_dmac_runtime_resume(struct device *dev)
690 691
691 return usb_dmac_init(dmac); 692 return usb_dmac_init(dmac);
692} 693}
694#endif /* CONFIG_PM */
693 695
694static const struct dev_pm_ops usb_dmac_pm = { 696static const struct dev_pm_ops usb_dmac_pm = {
695 SET_RUNTIME_PM_OPS(usb_dmac_runtime_suspend, usb_dmac_runtime_resume, 697 SET_RUNTIME_PM_OPS(usb_dmac_runtime_suspend, usb_dmac_runtime_resume,