From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Tue, 25 Jun 2013 10:10:57 -0500 Subject: [U-Boot] [PATCH v2 5/5] ARM: at91: atmel_nand: add code to check the ONFI parameter ECC requirement In-Reply-To: <51C939BC.5030401@atmel.com> (from josh.wu@atmel.com on Tue Jun 25 01:33:32 2013) References: <1371761824.11064.15@snotra> <51C939BC.5030401@atmel.com> Message-ID: <1372173057.8183.15@snotra> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 06/25/2013 01:33:32 AM, Josh Wu wrote: > Hi, Dear Scott > > On 6/21/2013 4:57 AM, Scott Wood wrote: >> On 06/17/2013 05:51:21 AM, Josh Wu wrote: >>> +static int pmecc_choose_ecc(struct atmel_nand_host *host, >>> + struct nand_chip *chip, >>> + int *cap, int *sector_size) >>> +{ >>> + /* Get ECC requirement from ONFI parameters */ >>> + *cap = *sector_size = 0; >>> + if (chip->onfi_version) { >>> + if (!get_onfi_ecc_param(chip, cap, sector_size)) >>> + pr_debug("ONFI params, minimum required ECC: %d bits >>> in %d bytes\n", >>> + *cap, *sector_size); >>> + else >>> + dev_info(NULL, "NAND chip ECC reqirement is in >>> Extended ONFI parameter, we don't support yet.\n"); >>> + } else { >>> + dev_info(NULL, "NAND chip is not ONFI compliant, assume >>> ecc_bits is 2 in 512 bytes"); >>> + } >> >> Don't pass NULL to dev_info(). Either pass host->dev as the Linux >> code does (and use dev_dbg rather than pr_debug), or just use >> printf() (and debug()) if there's no intent to sync this change back >> to Linux. It doesn't matter if host->dev doesn't exist in U-Boot, >> as the macro doesn't use that parameter, but the only reason to use >> Linux-style prints is to keep the code common with Linux. > > understood. I prefer to use dev_xxx(host->dev, ...) to keep > consistent with kernel. > > I use pr_debug because it is defined as MTDDEBUG in mtd/mtd.h, that > is exact what I want. > Since if use debug(), then when I enable debug, there are many mtd > non-related message shows up. If pr_debug() and dev_dbg() are behaving differently in U-Boot, that's a bug that should be fixed. -Scott