aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Cercueil <paul@crapouillou.net>2018-08-29 17:32:44 -0400
committerVinod Koul <vkoul@kernel.org>2018-09-11 03:29:25 -0400
commit54f919a04cf221bc1601d1193682d4379dacacbd (patch)
treeaeff276c81569990269b367c9399cc50e3c7e237
parent77da5d19af223f5a93254c38db44a0eca63e461a (diff)
dmaengine: dma-jz4780: Return error if not probed from DT
The driver calls clk_get() with the clock name set to NULL, which means that the driver could only work when probed from devicetree. From now on, we explicitly require the driver to be probed from devicetree. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Tested-by: Mathieu Malaterre <malat@debian.org> Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/dma/dma-jz4780.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c
index 85820a2d69d4..987899610b46 100644
--- a/drivers/dma/dma-jz4780.c
+++ b/drivers/dma/dma-jz4780.c
@@ -761,6 +761,11 @@ static int jz4780_dma_probe(struct platform_device *pdev)
761 struct resource *res; 761 struct resource *res;
762 int i, ret; 762 int i, ret;
763 763
764 if (!dev->of_node) {
765 dev_err(dev, "This driver must be probed from devicetree\n");
766 return -EINVAL;
767 }
768
764 jzdma = devm_kzalloc(dev, sizeof(*jzdma), GFP_KERNEL); 769 jzdma = devm_kzalloc(dev, sizeof(*jzdma), GFP_KERNEL);
765 if (!jzdma) 770 if (!jzdma)
766 return -ENOMEM; 771 return -ENOMEM;