mtd: nand: pxa3xx_nand: fix dmaengine initialization

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Mar 24 11:59:08 PDT 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=9097103f06332d099c5ab06d1e7f22f4bcaca6e2
Commit:     9097103f06332d099c5ab06d1e7f22f4bcaca6e2
Parent:     f671a1f3803428b01272b056d6dc0e09e0df6fd4
Author:     Robert Jarzmik <robert.jarzmik at free.fr>
AuthorDate: Fri Feb 12 23:29:04 2016 +0100
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Fri Mar 4 19:06:41 2016 -0800

    mtd: nand: pxa3xx_nand: fix dmaengine initialization
    
    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 at free.fr>
    Acked-by: Ezequiel Garcia <ezequiel at vanguardiasur.com.ar>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/pxa3xx_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 56e8954..f100c4d 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -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,



More information about the linux-mtd-cvs mailing list