]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mtd: nand: pxa3xx_nand: fix dmaengine initialization
authorRobert Jarzmik <robert.jarzmik@free.fr>
Fri, 12 Feb 2016 22:29:04 +0000 (23:29 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Sat, 5 Mar 2016 03:06:41 +0000 (19:06 -0800)
When the driver is initialized in a pure device-tree platform, the
driver's probe fails allocating the dma channel :
[  525.624435] pxa3xx-nand 43100000.nand: no resource defined for data DMA
[  525.632088] pxa3xx-nand 43100000.nand: alloc nand resource failed

The reason is that the DMA IO resource is not acquired through platform
resources but by OF bindings.

Fix this by ensuring that DMA IO resources are only queried in the non
device-tree case.

Fixes: 8f5ba31aa565 ("mtd: nand: pxa3xx-nand: switch to dmaengine")
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/pxa3xx_nand.c

index 56e8954dd02ddfe1609c6aeecd5b9be665424649..f100c4da0423a9efe726bd08ec14c60e3ac0ea49 100644 (file)
@@ -1795,7 +1795,7 @@ static int alloc_nand_resource(struct platform_device *pdev)
        if (ret < 0)
                return ret;
 
-       if (use_dma) {
+       if (!np && use_dma) {
                r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
                if (r == NULL) {
                        dev_err(&pdev->dev,