ar71xx: fix nand init issues on some rb2011 devices
[openwrt/staging/lynxis.git] / target / linux / ar71xx / files / arch / mips / ath79 / mach-rb2011.c
index 7bf64905c68d0d5b4405d12f2c918dc472528e12..aee0fb201445f693bfa32baf6a54a2da9f988e9f 100644 (file)
@@ -256,7 +256,9 @@ static int rb2011_nand_scan_fixup(struct mtd_info *mtd)
 {
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
        struct nand_chip *chip = mtd->priv;
-#endif
+#else
+       struct nand_chip *chip = mtd_to_nand(mtd);
+#endif /* < 4.6.0 */
 
        if (mtd->writesize == 512) {
                /*
@@ -270,6 +272,8 @@ static int rb2011_nand_scan_fixup(struct mtd_info *mtd)
 #endif
        }
 
+       chip->options = NAND_NO_SUBPAGE_WRITE;
+
        return 0;
 }