mtd: nand: add generic helpers to check, match, maximize ECC settings
[oweals/u-boot.git] / drivers / mtd / nand / lpc32xx_nand_mlc.c
index 426202981960be206665abdb6027e1c5d152322d..e1b36706cab3c2a673b7c0a3e11ca2b3cfb51cc2 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <common.h>
 #include <nand.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include <asm/io.h>
 #include <nand.h>
 #include <asm/arch/clk.h>
@@ -541,7 +541,7 @@ static struct nand_chip lpc32xx_chip;
 
 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  */
@@ -583,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, mtd);
        if (ret)
-               error("nand_register returned %i", ret);
+               pr_err("nand_register returned %i", ret);
 }
 
 #else /* defined(CONFIG_SPL_BUILD) */