From: Scott Wood Date: Wed, 13 Nov 2013 19:15:53 -0600 Subject: [U-Boot] [U-Boot, 2/5] mtd: atmel_nand: enable PMECC support for 8k bytes page NAND flash In-Reply-To: <1382089595-5235-3-git-send-email-josh.wu@atmel.com> References: <1382089595-5235-3-git-send-email-josh.wu@atmel.com> Message-ID: <20131114011553.GA8217@home.buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, Oct 18, 2013 at 05:46:31PM +0800, Wu, Josh wrote: > @@ -840,6 +841,13 @@ static int atmel_pmecc_nand_init_params(struct nand_chip *nand, > nand->ecc.steps = 1; > nand->ecc.bytes = host->pmecc_bytes_per_sector * > host->pmecc_sector_number; > + > + if (nand->ecc.bytes > MTD_MAX_ECCPOS_ENTRIES_LARGE) { > + dev_err(host->dev, "too large eccpos entries. max support ecc.bytes is %d\n", > + MTD_MAX_ECCPOS_ENTRIES_LARGE); > + return -EINVAL; > + } I won't hold up acceptance over this, but wouldn't it be more useful to show the actual ecc.bytes rather than the constant limit which could be easily looked up in the source? Or better, print both. -Scott