mtd: atmel_nand: fix support for CPUs that do not support DMA access

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Apr 7 05:59:02 EDT 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=cb457a4ddd4eeac9c81792a1e6a5d59b1b44abe1
Commit:     cb457a4ddd4eeac9c81792a1e6a5d59b1b44abe1
Parent:     042bc9c0c434b61241ceda1d332e3076e2571859
Author:     Hong Xu <hong.xu at atmel.com>
AuthorDate: Wed Mar 30 16:26:41 2011 +0800
Committer:  Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
CommitDate: Fri Apr 1 16:44:32 2011 +0300

    mtd: atmel_nand: fix support for CPUs that do not support DMA access
    
    use_dma was always "1" even if the CPU does not support DMA
    
    Tested on AT91SAM9261EK by Jean-Christophe PLAGNIOL-VILLARD
    
    Reported-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
    Signed-off-by: Hong Xu <hong.xu at atmel.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
---
 drivers/mtd/nand/atmel_nand.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 7e88a80..f254fa6 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -599,7 +599,10 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
 		nand_chip->options |= NAND_USE_FLASH_BBT;
 	}
 
-	if (cpu_has_dma() && use_dma) {
+	if (!cpu_has_dma())
+		use_dma = 0;
+
+	if (use_dma) {
 		dma_cap_mask_t mask;
 
 		dma_cap_zero(mask);



More information about the linux-mtd-cvs mailing list