From patchwork Wed Mar 30 08:26:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3/3] MTD/atmel_nand: Fix support for CPUs that do not support DMA access Date: Tue, 29 Mar 2011 22:26:41 -0000 From: Xu, Hong X-Patchwork-Id: 88884 Message-Id: <1301473601-29570-3-git-send-email-hong.xu@atmel.com> To: linux-arm-kernel@lists.infradead.org, linux-mtd@lists.infradead.org Cc: Hong Xu , nicolas.ferre@atmel.com 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 Signed-off-by: Hong Xu --- 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 c36ea50..1b43654 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);