From: Paul Cercueil Date: Wed, 29 Aug 2018 21:32:44 +0000 (+0200) Subject: dmaengine: dma-jz4780: Return error if not probed from DT X-Git-Tag: v5.4-rc1~2381^2~6^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54f919a04cf221bc1601d1193682d4379dacacbd;p=platform%2Fkernel%2Flinux-rpi.git 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 Tested-by: Mathieu Malaterre Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c index 85820a2..9878996 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) struct resource *res; int i, ret; + if (!dev->of_node) { + dev_err(dev, "This driver must be probed from devicetree\n"); + return -EINVAL; + } + jzdma = devm_kzalloc(dev, sizeof(*jzdma), GFP_KERNEL); if (!jzdma) return -ENOMEM;