]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
OneNAND: Fix compiler warnings
authorStefan Roese <sr@denx.de>
Tue, 11 Nov 2008 09:28:53 +0000 (10:28 +0100)
committerScott Wood <scottwood@freescale.com>
Fri, 23 Jan 2009 16:32:45 +0000 (10:32 -0600)
Signed-off-by: Stefan Roese <sr@denx.de>
drivers/mtd/onenand/onenand_base.c

index 66214e86d3c2f9671ccf298f4652363dee03535f..8d004d383b64448f35abb1965f361ce8c413585a 100644 (file)
@@ -408,6 +408,30 @@ static int onenand_write_bufferram(struct mtd_info *mtd, loff_t addr, int area,
        return 0;
 }
 
+/**
+ * onenand_get_2x_blockpage - [GENERIC] Get blockpage at 2x program mode
+ * @param mtd          MTD data structure
+ * @param addr         address to check
+ * @return             blockpage address
+ *
+ * Get blockpage address at 2x program mode
+ */
+static int onenand_get_2x_blockpage(struct mtd_info *mtd, loff_t addr)
+{
+       struct onenand_chip *this = mtd->priv;
+       int blockpage, block, page;
+
+       /* Calculate the even block number */
+       block = (int) (addr >> this->erase_shift) & ~1;
+       /* Is it the odd plane? */
+       if (addr & this->writesize)
+               block++;
+       page = (int) (addr >> (this->page_shift + 1)) & this->page_mask;
+       blockpage = (block << 7) | page;
+
+       return blockpage;
+}
+
 /**
  * onenand_check_bufferram - [GENERIC] Check BufferRAM information
  * @param mtd          MTD data structure
@@ -1666,6 +1690,7 @@ static int onenand_do_lock_cmd(struct mtd_info *mtd, loff_t ofs, size_t len, int
        return 0;
 }
 
+#ifdef ONENAND_LINUX
 /**
  * onenand_lock - [MTD Interface] Lock block(s)
  * @param mtd           MTD device structure
@@ -1701,6 +1726,7 @@ static int onenand_unlock(struct mtd_info *mtd, loff_t ofs, size_t len)
        onenand_release_device(mtd);
        return ret;
 }
+#endif
 
 /**
  * onenand_check_lock_status - [OneNAND Interface] Check lock status