summaryrefslogtreecommitdiffstats
path: root/drivers/nand/nand_base.c
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2007-05-08 00:32:35 +0200
committerMichal Simek <monstr@monstr.eu>2007-05-08 00:32:35 +0200
commit3c4bd60de15d79ddfc0cf3170a55847b2025d93f (patch)
tree891b84b58f13a5f45536a243585b9d94c253a410 /drivers/nand/nand_base.c
parentfb05f6da35ea1c15c553abe6f23f656bf18dc5db (diff)
parentac4cd59d59c9bf3f89cb7a344abf8184d678f562 (diff)
downloadblackbird-obmc-uboot-3c4bd60de15d79ddfc0cf3170a55847b2025d93f.tar.gz
blackbird-obmc-uboot-3c4bd60de15d79ddfc0cf3170a55847b2025d93f.zip
Merge git://www.denx.de/git/u-boot
Conflicts: include/asm-microblaze/microblaze_intc.h include/linux/stat.h
Diffstat (limited to 'drivers/nand/nand_base.c')
-rw-r--r--drivers/nand/nand_base.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/nand/nand_base.c b/drivers/nand/nand_base.c
index 8495829900..c6fee18222 100644
--- a/drivers/nand/nand_base.c
+++ b/drivers/nand/nand_base.c
@@ -427,8 +427,9 @@ static int nand_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip)
struct nand_chip *this = mtd->priv;
u16 bad;
+ page = (int)(ofs >> this->page_shift) & this->pagemask;
+
if (getchip) {
- page = (int)(ofs >> this->page_shift);
chipnr = (int)(ofs >> this->chip_shift);
/* Grab the lock and see if the device is available */
@@ -436,18 +437,17 @@ static int nand_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip)
/* Select the NAND device */
this->select_chip(mtd, chipnr);
- } else
- page = (int) ofs;
+ }
if (this->options & NAND_BUSWIDTH_16) {
- this->cmdfunc (mtd, NAND_CMD_READOOB, this->badblockpos & 0xFE, page & this->pagemask);
+ this->cmdfunc (mtd, NAND_CMD_READOOB, this->badblockpos & 0xFE, page);
bad = cpu_to_le16(this->read_word(mtd));
if (this->badblockpos & 0x1)
bad >>= 1;
if ((bad & 0xFF) != 0xff)
res = 1;
} else {
- this->cmdfunc (mtd, NAND_CMD_READOOB, this->badblockpos, page & this->pagemask);
+ this->cmdfunc (mtd, NAND_CMD_READOOB, this->badblockpos, page);
if (this->read_byte(mtd) != 0xff)
res = 1;
}
OpenPOWER on IntegriCloud