3f9d1b430fe6b5d5a30f7167d198134b54ec9f8d
[openwrt/staging/chunkeey.git] / target / linux / mediatek / patches-4.4 / 0059-mtd-nand-backport-fixes.patch
1 From 96ec6b2ee8a19799835209d0a6753519b96277f8 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Thu, 31 Mar 2016 02:28:08 +0200
4 Subject: [PATCH 59/81] mtd: nand: backport fixes
5
6 ---
7 drivers/mtd/nand/mtksdg1_nand.c | 9 ++++++++-
8 1 file changed, 8 insertions(+), 1 deletion(-)
9
10 --- a/drivers/mtd/nand/mtksdg1_nand.c
11 +++ b/drivers/mtd/nand/mtksdg1_nand.c
12 @@ -107,6 +107,9 @@ static struct nand_ecclayout nand_4k_128
13 .oobfree = { {0, 32} },
14 };
15
16 +static const char * const part_probes[] = {
17 + "cmdlinepart", "RedBoot", "ofpart", NULL };
18 +
19 /* NFI register access */
20 static inline void mtk_nfi_writel(struct mtk_nfc_host *host, u32 val, u32 reg)
21 {
22 @@ -1298,6 +1301,7 @@ static int mtk_nfc_probe(struct platform
23
24 chip = &host->chip;
25 mtd = nand_to_mtd(chip);
26 + mtd->priv = chip;
27 host->dev = dev;
28
29 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
30 @@ -1428,7 +1432,10 @@ static int mtk_nfc_probe(struct platform
31 }
32 host->switch_oob = false;
33
34 - ret = mtd_device_parse_register(mtd, NULL, NULL, NULL, 0);
35 + ret = mtd_device_parse_register(mtd, part_probes,
36 + &(struct mtd_part_parser_data) {
37 + .of_node = pdev->dev.of_node,
38 + }, NULL, 0);
39 if (ret) {
40 dev_err(dev, "mtd parse partition error\n");
41 goto nand_free;