aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
authorBoris BREZILLON <boris.brezillon@free-electrons.com>2016-03-07 04:46:51 -0500
committerBrian Norris <computersforpeace@gmail.com>2016-03-07 19:23:09 -0500
commitf5b8aa78ef086248145363bf1ffe5ca4348b6a98 (patch)
treee1cbe852ebab047c0acf6af3c7498b11d37d2786 /drivers/mtd/devices
parent9ebfdf5b18493f338237ef9861a555c2f79b0c17 (diff)
mtd: kill the ecclayout->oobavail field
ecclayout->oobavail is just redundant with the mtd->oobavail field. Moreover, it prevents static const definition of ecc layouts since the NAND framework is calculating this value based on the ecclayout->oobfree field. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/docg3.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index c3a2695a4420..e7b2e439696c 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -72,13 +72,11 @@ MODULE_PARM_DESC(reliable_mode, "Set the docg3 mode (0=normal MLC, 1=fast, "
72 * @eccbytes: 8 bytes are used (1 for Hamming ECC, 7 for BCH ECC) 72 * @eccbytes: 8 bytes are used (1 for Hamming ECC, 7 for BCH ECC)
73 * @eccpos: ecc positions (byte 7 is Hamming ECC, byte 8-14 are BCH ECC) 73 * @eccpos: ecc positions (byte 7 is Hamming ECC, byte 8-14 are BCH ECC)
74 * @oobfree: free pageinfo bytes (byte 0 until byte 6, byte 15 74 * @oobfree: free pageinfo bytes (byte 0 until byte 6, byte 15
75 * @oobavail: 8 available bytes remaining after ECC toll
76 */ 75 */
77static struct nand_ecclayout docg3_oobinfo = { 76static struct nand_ecclayout docg3_oobinfo = {
78 .eccbytes = 8, 77 .eccbytes = 8,
79 .eccpos = {7, 8, 9, 10, 11, 12, 13, 14}, 78 .eccpos = {7, 8, 9, 10, 11, 12, 13, 14},
80 .oobfree = {{0, 7}, {15, 1} }, 79 .oobfree = {{0, 7}, {15, 1} },
81 .oobavail = 8,
82}; 80};
83 81
84static inline u8 doc_readb(struct docg3 *docg3, u16 reg) 82static inline u8 doc_readb(struct docg3 *docg3, u16 reg)
@@ -1438,7 +1436,7 @@ static int doc_write_oob(struct mtd_info *mtd, loff_t ofs,
1438 oobdelta = mtd->oobsize; 1436 oobdelta = mtd->oobsize;
1439 break; 1437 break;
1440 case MTD_OPS_AUTO_OOB: 1438 case MTD_OPS_AUTO_OOB:
1441 oobdelta = mtd->ecclayout->oobavail; 1439 oobdelta = mtd->oobavail;
1442 break; 1440 break;
1443 default: 1441 default:
1444 return -EINVAL; 1442 return -EINVAL;
@@ -1860,6 +1858,7 @@ static int __init doc_set_driver_info(int chip_id, struct mtd_info *mtd)
1860 mtd->_write_oob = doc_write_oob; 1858 mtd->_write_oob = doc_write_oob;
1861 mtd->_block_isbad = doc_block_isbad; 1859 mtd->_block_isbad = doc_block_isbad;
1862 mtd->ecclayout = &docg3_oobinfo; 1860 mtd->ecclayout = &docg3_oobinfo;
1861 mtd->oobavail = 8;
1863 mtd->ecc_strength = DOC_ECC_BCH_T; 1862 mtd->ecc_strength = DOC_ECC_BCH_T;
1864 1863
1865 return 0; 1864 return 0;