mtd: cafe_nand: fix an & vs | mistake

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Jul 6 09:59:01 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=48f8b641297df49021093763a3271119a84990a2
Commit:     48f8b641297df49021093763a3271119a84990a2
Parent:     ea3b2ea24ef0f2ef9c6795b19cff456195b6728a
Author:     Dan Carpenter <dan.carpenter at oracle.com>
AuthorDate: Sat Jun 9 19:08:25 2012 +0300
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Jul 6 14:27:13 2012 +0100

    mtd: cafe_nand: fix an & vs | mistake
    
    The intent here was clearly to set result to true if the 0x40000000 flag
    was set.  But instead there was a | vs & typo and we always set result
    to true.
    
    Artem: check the spec at
    wiki.laptop.org/images/5/5c/88ALP01_Datasheet_July_2007.pdf
    and this fix looks correct.
    
    Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
    Cc: stable at vger.kernel.org
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/cafe_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
index 41371ba..f3f6cfe 100644
--- a/drivers/mtd/nand/cafe_nand.c
+++ b/drivers/mtd/nand/cafe_nand.c
@@ -102,7 +102,7 @@ static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
 static int cafe_device_ready(struct mtd_info *mtd)
 {
 	struct cafe_priv *cafe = mtd->priv;
-	int result = !!(cafe_readl(cafe, NAND_STATUS) | 0x40000000);
+	int result = !!(cafe_readl(cafe, NAND_STATUS) & 0x40000000);
 	uint32_t irqs = cafe_readl(cafe, NAND_IRQ);
 
 	cafe_writel(cafe, irqs, NAND_IRQ);



More information about the linux-mtd-cvs mailing list