diff options
author | Huang Shijie <b32955@freescale.com> | 2013-08-15 22:10:07 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:06:02 -0400 |
commit | 6e086e6df09db8cd943754cabaad9f3e8841733e (patch) | |
tree | e33cfe6f4ce796f8f5c2812c9dd3e719a5bf6fc1 | |
parent | b7ce93160e6918dcf7f41c517ad3fa23fed5d0a3 (diff) |
mtd: set ONFI nand's default hooks in nand_set_defaults()
We may do some ONFI get/set features operations before we call the
nand_scan_tail().
So move the default ONFI nand hooks into nand_set_defaults().
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 201123af3077..d1d4a98faa68 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -2794,6 +2794,12 @@ static void nand_set_defaults(struct nand_chip *chip, int busw) | |||
2794 | if (!chip->select_chip) | 2794 | if (!chip->select_chip) |
2795 | chip->select_chip = nand_select_chip; | 2795 | chip->select_chip = nand_select_chip; |
2796 | 2796 | ||
2797 | /* set for ONFI nand */ | ||
2798 | if (!chip->onfi_set_features) | ||
2799 | chip->onfi_set_features = nand_onfi_set_features; | ||
2800 | if (!chip->onfi_get_features) | ||
2801 | chip->onfi_get_features = nand_onfi_get_features; | ||
2802 | |||
2797 | /* If called twice, pointers that depend on busw may need to be reset */ | 2803 | /* If called twice, pointers that depend on busw may need to be reset */ |
2798 | if (!chip->read_byte || chip->read_byte == nand_read_byte) | 2804 | if (!chip->read_byte || chip->read_byte == nand_read_byte) |
2799 | chip->read_byte = busw ? nand_read_byte16 : nand_read_byte; | 2805 | chip->read_byte = busw ? nand_read_byte16 : nand_read_byte; |
@@ -3571,12 +3577,6 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3571 | if (!chip->write_page) | 3577 | if (!chip->write_page) |
3572 | chip->write_page = nand_write_page; | 3578 | chip->write_page = nand_write_page; |
3573 | 3579 | ||
3574 | /* set for ONFI nand */ | ||
3575 | if (!chip->onfi_set_features) | ||
3576 | chip->onfi_set_features = nand_onfi_set_features; | ||
3577 | if (!chip->onfi_get_features) | ||
3578 | chip->onfi_get_features = nand_onfi_get_features; | ||
3579 | |||
3580 | /* | 3580 | /* |
3581 | * Check ECC mode, default to software if 3byte/512byte hardware ECC is | 3581 | * Check ECC mode, default to software if 3byte/512byte hardware ECC is |
3582 | * selected and we have 256 byte pagesize fallback to software ECC | 3582 | * selected and we have 256 byte pagesize fallback to software ECC |