mtd: nand_flash_detect_onfi propagate busw info

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Nov 7 11:59:25 EST 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=08c248fbe2bfc0326255c5b0cb3952166234d59b
Commit:     08c248fbe2bfc0326255c5b0cb3952166234d59b
Parent:     c478d7e449508d924628b012e62dee6dddb6b9e9
Author:     Matthieu CASTET <matthieu.castet at parrot.com>
AuthorDate: Sun Jun 26 18:26:55 2011 +0200
Committer:  Artem Bityutskiy <artem.bityutskiy at intel.com>
CommitDate: Sun Sep 11 15:02:14 2011 +0300

    mtd: nand_flash_detect_onfi propagate busw info
    
    there is a bug in nand_flash_detect_onfi, busw need to be passed
    by pointer to return it.
    
    Signed-off-by: Matthieu CASTET <matthieu.castet at parrot.com>
    Acked-by: Brian Norris <computersforpeace at gmail.com>
    Signed-off-by: Artem Bityutskiy <dedekind1 at gmail.com>
---
 drivers/mtd/nand/nand_base.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 5418d27..250e86f 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2824,7 +2824,7 @@ static u16 onfi_crc16(u16 crc, u8 const *p, size_t len)
  * Check if the NAND chip is ONFI compliant, returns 1 if it is, 0 otherwise.
  */
 static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
-					int busw)
+					int *busw)
 {
 	struct nand_onfi_params *p = &chip->onfi_params;
 	int i;
@@ -2879,9 +2879,9 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
 	mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
 	mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
 	chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
-	busw = 0;
+	*busw = 0;
 	if (le16_to_cpu(p->features) & 1)
-		busw = NAND_BUSWIDTH_16;
+		*busw = NAND_BUSWIDTH_16;
 
 	chip->options &= ~NAND_CHIPOPTIONS_MSK;
 	chip->options |= (NAND_NO_READRDY |
@@ -2948,7 +2948,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
 	chip->onfi_version = 0;
 	if (!type->name || !type->pagesize) {
 		/* Check is chip is ONFI compliant */
-		ret = nand_flash_detect_onfi(mtd, chip, busw);
+		ret = nand_flash_detect_onfi(mtd, chip, &busw);
 		if (ret)
 			goto ident_done;
 	}



More information about the linux-mtd-cvs mailing list