048e60441c2d18fcaf43444859e1229d61a3e42e
[openwrt/openwrt.git] / target / linux / ramips / patches-4.14 / 0040-nand-hack-restore-write_page.patch
1 --- a/include/linux/mtd/rawnand.h
2 +++ b/include/linux/mtd/rawnand.h
3 @@ -885,6 +885,9 @@ struct nand_chip {
4 int(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this);
5 int (*erase)(struct mtd_info *mtd, int page);
6 int (*scan_bbt)(struct mtd_info *mtd);
7 + int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
8 + uint32_t offset, int data_len, const uint8_t *buf,
9 + int oob_required, int page, int raw);
10 int (*onfi_set_features)(struct mtd_info *mtd, struct nand_chip *chip,
11 int feature_addr, uint8_t *subfeature_para);
12 int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip,
13 --- a/drivers/mtd/nand/nand_base.c
14 +++ b/drivers/mtd/nand/nand_base.c
15 @@ -2756,9 +2756,14 @@ static int nand_do_write_ops(struct mtd_
16 memset(chip->oob_poi, 0xff, mtd->oobsize);
17 }
18
19 - ret = nand_write_page(mtd, chip, column, bytes, wbuf,
20 - oob_required, page,
21 - (ops->mode == MTD_OPS_RAW));
22 +// if (chip->write_page)
23 + ret = chip->write_page(mtd, chip, column, bytes, wbuf,
24 + oob_required, page,
25 + (ops->mode == MTD_OPS_RAW));
26 +// else
27 +// ret = nand_write_page(mtd, chip, column, bytes, wbuf,
28 +// oob_required, page,
29 +// (ops->mode == MTD_OPS_RAW));
30 if (ret)
31 break;
32
33 @@ -4714,6 +4719,9 @@ int nand_scan_tail(struct mtd_info *mtd)
34 }
35 }
36
37 +// if (!chip->write_page)
38 +// chip->write_page = nand_write_page;
39 +
40 /*
41 * Check ECC mode, default to software if 3byte/512byte hardware ECC is
42 * selected and we have 256 byte pagesize fallback to software ECC