Commit 49196f33 authored by Vitaly Wool's avatar Vitaly Wool Committed by Thomas Gleixner

[MTD] NAND nand_base: Fix shift for bad block check (16bit devices only)

In case of an odd offset, the result was shifted by 1 instead of 8
Signed-off-by: default avatarVitaly Wool <vwool@ru.mvista.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 46d0d0fb
...@@ -433,7 +433,7 @@ static int nand_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip) ...@@ -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); this->cmdfunc (mtd, NAND_CMD_READOOB, this->badblockpos & 0xFE, page & this->pagemask);
bad = cpu_to_le16(this->read_word(mtd)); bad = cpu_to_le16(this->read_word(mtd));
if (this->badblockpos & 0x1) if (this->badblockpos & 0x1)
bad >>= 1; bad >>= 8;
if ((bad & 0xFF) != 0xff) if ((bad & 0xFF) != 0xff)
res = 1; res = 1;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment