From: Scott Wood Date: Tue, 11 Nov 2014 21:06:52 -0600 Subject: [U-Boot] [PATCH 1/2] mtd: denali: use CONFIG_SYS_NAND_SELF_INIT In-Reply-To: <1415711151-15237-2-git-send-email-yamada.m@jp.panasonic.com> References: <1415711151-15237-1-git-send-email-yamada.m@jp.panasonic.com> <1415711151-15237-2-git-send-email-yamada.m@jp.panasonic.com> Message-ID: <1415761612.15957.35.camel@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 2014-11-11 at 22:05 +0900, Masahiro Yamada wrote: > + /* > + * If CONFIG_SYS_NAND_SELF_INIT is defined, each driver is responsible > + * for instantiating struct nand_chip, while drivers/mtd/nand/nand.c > + * still provides a "struct mtd_info nand_info" instance. > + */ > + denali->mtd = nand_info; &nand_info[0] would be clearer. > + /* > + * In the future, these base addresses should be taken from > + * Device Tree or platform data. > + */ > + denali->flash_reg = (void __iomem *)CONFIG_SYS_NAND_REGS_BASE; > + denali->flash_mem = (void __iomem *)CONFIG_SYS_NAND_DATA_BASE; > + > + return denali_init(denali); > } > > -int board_nand_init(struct nand_chip *chip) > +void board_nand_init(void) > { > - return denali_nand_init(chip); > + __board_nand_init(); > } Why do you need this wrapper rather than putting the contents of __board_nand_init() here? Also, you might want to print an error if denali_init() returns an error, rather than just discarding it (or, make sure denali_init() prints for error conditions, and have it return void). I realize that the existing self-init drivers aren't perfect in this regard. :-) -Scott