[U-Boot] [PATCH 1/2] mtd: denali: use CONFIG_SYS_NAND_SELF_INIT
Scott Wood
scottwood at freescale.com
Wed Nov 12 04:06:52 CET 2014
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
More information about the U-Boot
mailing list