1 --- a/include/linux/mtd/nand.h 2017-05-25 16:45:05.000000000 +0300
2 +++ b/include/linux/mtd/nand.h 2017-05-28 09:45:05.016541089 +0300
3 @@ -1053,6 +1053,7 @@ struct platform_nand_chip {
5 unsigned int bbt_options;
6 const char **part_probe_types;
7 + int (*chip_fixup)(struct mtd_info *mtd);
11 --- a/drivers/mtd/nand/plat_nand.c 2017-05-25 16:45:05.000000000 +0300
12 +++ b/drivers/mtd/nand/plat_nand.c 2017-05-28 10:01:49.235556815 +0300
13 @@ -86,11 +86,23 @@ static int plat_nand_probe(struct platfo
16 /* Scan to find existence of the device */
17 - if (nand_scan(mtd, pdata->chip.nr_chips)) {
18 + if (nand_scan_ident(mtd, pdata->chip.nr_chips, NULL)) {
23 + if (pdata->chip.chip_fixup) {
24 + err = pdata->chip.chip_fixup(mtd);
29 + if (nand_scan_tail(mtd)) {
35 part_types = pdata->chip.part_probe_types;
37 err = mtd_device_parse_register(mtd, part_types, NULL,