aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthieu CASTET <matthieu.castet@parrot.com>2011-06-26 12:26:55 -0400
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-09-11 08:02:14 -0400
commit08c248fbe2bfc0326255c5b0cb3952166234d59b (patch)
tree60d4f98ac6137beaf9e93b45ca24819c57e6e26b
parentc478d7e449508d924628b012e62dee6dddb6b9e9 (diff)
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@parrot.com> Acked-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
-rw-r--r--drivers/mtd/nand/nand_base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 5418d27122c4..250e86f5592e 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)
2824 * Check if the NAND chip is ONFI compliant, returns 1 if it is, 0 otherwise. 2824 * Check if the NAND chip is ONFI compliant, returns 1 if it is, 0 otherwise.
2825 */ 2825 */
2826static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, 2826static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
2827 int busw) 2827 int *busw)
2828{ 2828{
2829 struct nand_onfi_params *p = &chip->onfi_params; 2829 struct nand_onfi_params *p = &chip->onfi_params;
2830 int i; 2830 int i;
@@ -2879,9 +2879,9 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
2879 mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize; 2879 mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize;
2880 mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page); 2880 mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);
2881 chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize; 2881 chip->chipsize = (uint64_t)le32_to_cpu(p->blocks_per_lun) * mtd->erasesize;
2882 busw = 0; 2882 *busw = 0;
2883 if (le16_to_cpu(p->features) & 1) 2883 if (le16_to_cpu(p->features) & 1)
2884 busw = NAND_BUSWIDTH_16; 2884 *busw = NAND_BUSWIDTH_16;
2885 2885
2886 chip->options &= ~NAND_CHIPOPTIONS_MSK; 2886 chip->options &= ~NAND_CHIPOPTIONS_MSK;
2887 chip->options |= (NAND_NO_READRDY | 2887 chip->options |= (NAND_NO_READRDY |
@@ -2948,7 +2948,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
2948 chip->onfi_version = 0; 2948 chip->onfi_version = 0;
2949 if (!type->name || !type->pagesize) { 2949 if (!type->name || !type->pagesize) {
2950 /* Check is chip is ONFI compliant */ 2950 /* Check is chip is ONFI compliant */
2951 ret = nand_flash_detect_onfi(mtd, chip, busw); 2951 ret = nand_flash_detect_onfi(mtd, chip, &busw);
2952 if (ret) 2952 if (ret)
2953 goto ident_done; 2953 goto ident_done;
2954 } 2954 }