kernel: Update kernel 4.14 to version 4.14.187
[openwrt/openwrt.git] / target / linux / ramips / patches-4.14 / 0040-nand-hack.patch
1 --- a/drivers/mtd/nand/nand_base.c
2 +++ b/drivers/mtd/nand/nand_base.c
3 @@ -1908,6 +1908,9 @@ static int nand_do_read_ops(struct mtd_i
4 __func__, buf);
5
6 read_retry:
7 +#ifdef CONFIG_MTK_MTD_NAND
8 + ret = chip->read_page(mtd, chip, bufpoi, page);
9 +#else
10 if (nand_standard_page_accessors(&chip->ecc))
11 chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, page);
12
13 @@ -1927,6 +1930,7 @@ read_retry:
14 else
15 ret = chip->ecc.read_page(mtd, chip, bufpoi,
16 oob_required, page);
17 +#endif
18 if (ret < 0) {
19 if (use_bufpoi)
20 /* Invalidate page cache */
21 --- a/include/linux/mtd/rawnand.h
22 +++ b/include/linux/mtd/rawnand.h
23 @@ -895,6 +895,9 @@ struct nand_chip {
24 int (*setup_data_interface)(struct mtd_info *mtd, int chipnr,
25 const struct nand_data_interface *conf);
26
27 +#ifdef CONFIG_MTK_MTD_NAND
28 + int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip, u8 *buf, int page);
29 +#endif /* CONFIG_MTK_MTD_NAND */
30
31 int chip_delay;
32 unsigned int options;