[MTD] NAND nand_base: Fix shift for bad block check (16bit devices only)
authorVitaly Wool <vwool@ru.mvista.com>
Wed, 2 Nov 2005 16:54:46 +0000 (16:54 +0000)
committerThomas Gleixner <tglx@mtd.linutronix.de>
Mon, 7 Nov 2005 01:15:21 +0000 (02:15 +0100)
In case of an odd offset, the result was shifted by 1 instead of 8

Signed-off-by: Vitaly Wool <vwool@ru.mvista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/mtd/nand/nand_base.c

index 4e22317397e80ef95d4852e9b777197115eda9fc..c7b1ce38c63c5d628479edaeed4cf0e81e0f648d 100644 (file)
@@ -433,7 +433,7 @@ static int nand_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip)
                this->cmdfunc (mtd, NAND_CMD_READOOB, this->badblockpos & 0xFE, page & this->pagemask);
                bad = cpu_to_le16(this->read_word(mtd));
                if (this->badblockpos & 0x1)
-                       bad >>= 1;
+                       bad >>= 8;
                if ((bad & 0xFF) != 0xff)
                        res = 1;
        } else {