[MTD] [NAND] Blackfin NFC Driver: do not clobber DMAC1_PERIMUX

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Mar 20 14:59:05 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=08d2503ecc2337275942c1f52822b7a464c0c0a3
Commit:     08d2503ecc2337275942c1f52822b7a464c0c0a3
Parent:     65c24491b4fef017c64e39ec64384fde5e05e0a0
Author:     Mike Frysinger <vapier.adi at gmail.com>
AuthorDate: Wed Mar 4 12:01:29 2009 -0800
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Mar 20 12:16:24 2009 +0000

    [MTD] [NAND] Blackfin NFC Driver: do not clobber DMAC1_PERIMUX
    
    Only set DMAC1_PERIMUX once we have requested and been granted the dma
    channel to prevent breaking other peripherals in the error case
    
    Signed-off-by: Mike Frysinger <vapier.adi at gmail.com>
    Signed-off-by: Bryan Wu <cooloney at kernel.org>
    Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/bf5xx_nand.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c
index 9af2a2c..5c6056e 100644
--- a/drivers/mtd/nand/bf5xx_nand.c
+++ b/drivers/mtd/nand/bf5xx_nand.c
@@ -552,7 +552,6 @@ static void bf5xx_nand_dma_write_buf(struct mtd_info *mtd,
 static int bf5xx_nand_dma_init(struct bf5xx_nand_info *info)
 {
 	int ret;
-	unsigned short val;
 
 	/* Do not use dma */
 	if (!hardware_ecc)
@@ -560,13 +559,6 @@ static int bf5xx_nand_dma_init(struct bf5xx_nand_info *info)
 
 	init_completion(&info->dma_completion);
 
-#ifdef CONFIG_BF54x
-	/* Setup DMAC1 channel mux for NFC which shared with SDH */
-	val = bfin_read_DMAC1_PERIMUX();
-	val &= 0xFFFE;
-	bfin_write_DMAC1_PERIMUX(val);
-	SSYNC();
-#endif
 	/* Request NFC DMA channel */
 	ret = request_dma(CH_NFC, "BF5XX NFC driver");
 	if (ret < 0) {
@@ -574,6 +566,12 @@ static int bf5xx_nand_dma_init(struct bf5xx_nand_info *info)
 		return ret;
 	}
 
+#ifdef CONFIG_BF54x
+	/* Setup DMAC1 channel mux for NFC which shared with SDH */
+	bfin_write_DMAC1_PERIMUX(bfin_read_DMAC1_PERIMUX() & ~1);
+	SSYNC();
+#endif
+
 	set_dma_callback(CH_NFC, (void *) bf5xx_nand_dma_irq, (void *) info);
 
 	/* Turn off the DMA channel first */



More information about the linux-mtd-cvs mailing list