ar71xx: fix rb922gs_nand_scan_fixup()

Apply code from commits 9e1bc27e6d
(ar71xx: Fix UBIFS work on Mikrotik RB95x devices) and
665bb27499 (ar71xx: fix invalid pointer
dereference in rb95x_nand_scan_fixup()) to RB92x devices too.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
This commit is contained in:
Roger Pueyo Centelles 2017-12-21 15:51:10 +01:00 committed by Daniel Golle
parent dda2229c52
commit 8927446dae

View file

@ -195,7 +195,9 @@ static int rb922gs_nand_scan_fixup(struct mtd_info *mtd)
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
struct nand_chip *chip = mtd->priv; struct nand_chip *chip = mtd->priv;
#endif #else
struct nand_chip *chip = mtd_to_nand(mtd);
#endif /* < 4.6.0 */
if (mtd->writesize == 512) { if (mtd->writesize == 512) {
/* /*
@ -209,6 +211,8 @@ static int rb922gs_nand_scan_fixup(struct mtd_info *mtd)
#endif #endif
} }
chip->options = NAND_NO_SUBPAGE_WRITE;
return 0; return 0;
} }