init:
/* chip is struct nand_chip, and is now provided by the driver. */
- mtd = &chip.mtd;
+ mtd = nand_to_mtd(&chip);
/*
* Fill in appropriate values if this driver uses these fields,
/*
* Init board specific nand support
*/
- mtd = &nand_chip.mtd;
+ mtd = nand_to_mtd(&nand_chip);
nand_chip.IO_ADDR_R = nand_chip.IO_ADDR_W =
(void __iomem *)CONFIG_SYS_NAND_BASE;
board_nand_init(&nand_chip);
void nand_init(void)
{
- mtd = &nand_chip.mtd;
+ mtd = nand_to_mtd(&nand_chip);
mtd->writesize = CONFIG_SYS_NAND_PAGE_SIZE;
mtd->oobsize = CONFIG_SYS_NAND_OOBSIZE;
nand_chip.IO_ADDR_R = (void __iomem *)CONFIG_SYS_NAND_BASE;
void board_nand_init(void)
{
- struct mtd_info *mtd = &lpc32xx_chip.mtd;
+ struct mtd_info *mtd = nand_to_mtd(&lpc32xx_chip);
int ret;
/* Set all BOARDSPECIFIC (actually core-specific) fields */
/* init mxs nand driver */
board_nand_init(&nand_chip);
- mtd = &nand_chip.mtd;
+ mtd = nand_to_mtd(&nand_chip);
/* set mtd functions */
nand_chip.cmdfunc = mxs_nand_command;
nand_chip.numchips = 1;
/*
* Init board specific nand support
*/
- mtd = &nand_chip.mtd;
+ mtd = nand_to_mtd(&nand_chip);
nand_chip.IO_ADDR_R = nand_chip.IO_ADDR_W =
(void __iomem *)CONFIG_SYS_NAND_BASE;
board_nand_init(&nand_chip);