Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 477478ae authored by Josh Wu's avatar Josh Wu Committed by Brian Norris
Browse files

mtd: atmel_nand: add a definition for the oob reserved bytes



It's better to use a macro instead of just a number.

Signed-off-by: default avatarJosh Wu <josh.wu@atmel.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 3a434f66
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -485,7 +485,7 @@ static void pmecc_config_ecc_layout(struct nand_ecclayout *layout,
	for (i = 0; i < ecc_len; i++)
		layout->eccpos[i] = oobsize - ecc_len + i;

	layout->oobfree[0].offset = 2;
	layout->oobfree[0].offset = PMECC_OOB_RESERVED_BYTES;
	layout->oobfree[0].length =
		oobsize - ecc_len - layout->oobfree[0].offset;
}
@@ -1254,7 +1254,8 @@ static int atmel_pmecc_nand_init_params(struct platform_device *pdev,
		nand_chip->ecc.steps = mtd->writesize / sector_size;
		nand_chip->ecc.total = nand_chip->ecc.bytes *
			nand_chip->ecc.steps;
		if (nand_chip->ecc.total > mtd->oobsize - 2) {
		if (nand_chip->ecc.total >
				mtd->oobsize - PMECC_OOB_RESERVED_BYTES) {
			dev_err(host->dev, "No room for ECC bytes\n");
			err_no = -EINVAL;
			goto err;
+3 −0
Original line number Diff line number Diff line
@@ -152,4 +152,7 @@
/* Time out value for reading PMECC status register */
#define PMECC_MAX_TIMEOUT_MS			100

/* Reserved bytes in oob area */
#define PMECC_OOB_RESERVED_BYTES		2

#endif