[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.23 / 0045-mtd-cafe_nand-fix-an-vs-mistake.patch
1 From e48907a3c090265dcbe0965537bbe9b510a1f7ef Mon Sep 17 00:00:00 2001
2 From: Dan Carpenter <dan.carpenter@oracle.com>
3 Date: Sat, 9 Jun 2012 19:08:25 +0300
4 Subject: [PATCH 45/49] mtd: cafe_nand: fix an & vs | mistake
6 commit 48f8b641297df49021093763a3271119a84990a2 upstream.
8 The intent here was clearly to set result to true if the 0x40000000 flag
9 was set. But instead there was a | vs & typo and we always set result
10 to true.
12 Artem: check the spec at
13 wiki.laptop.org/images/5/5c/88ALP01_Datasheet_July_2007.pdf
14 and this fix looks correct.
16 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
17 Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
18 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
19 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
20 ---
21 drivers/mtd/nand/cafe_nand.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
24 diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
25 index 72d3f23..68ecf48 100644
26 --- a/drivers/mtd/nand/cafe_nand.c
27 +++ b/drivers/mtd/nand/cafe_nand.c
28 @@ -102,7 +102,7 @@ static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
29 static int cafe_device_ready(struct mtd_info *mtd)
30 {
31 struct cafe_priv *cafe = mtd->priv;
32 - int result = !!(cafe_readl(cafe, NAND_STATUS) | 0x40000000);
33 + int result = !!(cafe_readl(cafe, NAND_STATUS) & 0x40000000);
34 uint32_t irqs = cafe_readl(cafe, NAND_IRQ);
36 cafe_writel(cafe, irqs, NAND_IRQ);
37 --
38 1.7.10