X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fmtd%2Fnand%2Flpc32xx_nand_mlc.c;h=e1b36706cab3c2a673b7c0a3e11ca2b3cfb51cc2;hb=470c29d1c28d23bdd86456bc431b8f26f8727903;hp=8156fe9613e719fdba9e6a15cfe91c8a3ded9fae;hpb=ffb96d55d13759a7e4fe4ba5fc5e3eb6fac11738;p=oweals%2Fu-boot.git diff --git a/drivers/mtd/nand/lpc32xx_nand_mlc.c b/drivers/mtd/nand/lpc32xx_nand_mlc.c index 8156fe9613..e1b36706ca 100644 --- a/drivers/mtd/nand/lpc32xx_nand_mlc.c +++ b/drivers/mtd/nand/lpc32xx_nand_mlc.c @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include @@ -378,7 +378,8 @@ static int lpc32xx_read_oob(struct mtd_info *mtd, struct nand_chip *chip, */ static int lpc32xx_write_page_hwecc(struct mtd_info *mtd, - struct nand_chip *chip, const uint8_t *buf, int oob_required) + struct nand_chip *chip, const uint8_t *buf, int oob_required, + int page) { unsigned int i, status, timeout; struct lpc32xx_oob *oob = (struct lpc32xx_oob *)chip->oob_poi; @@ -435,7 +436,8 @@ static int lpc32xx_write_page_hwecc(struct mtd_info *mtd, */ static int lpc32xx_write_page_raw(struct mtd_info *mtd, - struct nand_chip *chip, const uint8_t *buf, int oob_required) + struct nand_chip *chip, const uint8_t *buf, int oob_required, + int page) { unsigned int i; struct lpc32xx_oob *oob = (struct lpc32xx_oob *)chip->oob_poi; @@ -539,11 +541,7 @@ static struct nand_chip lpc32xx_chip; void board_nand_init(void) { - /* we have only one device anyway */ - struct mtd_info *mtd = &nand_info[0]; - /* chip is struct nand_chip, and is now provided by the driver. */ - mtd->priv = &lpc32xx_chip; - /* to store return status in case we need to print it */ + struct mtd_info *mtd = nand_to_mtd(&lpc32xx_chip); int ret; /* Set all BOARDSPECIFIC (actually core-specific) fields */ @@ -585,21 +583,21 @@ void board_nand_init(void) /* identify chip */ ret = nand_scan_ident(mtd, CONFIG_SYS_MAX_NAND_CHIPS, NULL); if (ret) { - error("nand_scan_ident returned %i", ret); + pr_err("nand_scan_ident returned %i", ret); return; } /* finish scanning the chip */ ret = nand_scan_tail(mtd); if (ret) { - error("nand_scan_tail returned %i", ret); + pr_err("nand_scan_tail returned %i", ret); return; } /* chip is good, register it */ - ret = nand_register(0); + ret = nand_register(0, mtd); if (ret) - error("nand_register returned %i", ret); + pr_err("nand_register returned %i", ret); } #else /* defined(CONFIG_SPL_BUILD) */