2016-04-01 07:11:18 +00:00
|
|
|
From 96ec6b2ee8a19799835209d0a6753519b96277f8 Mon Sep 17 00:00:00 2001
|
|
|
|
From: John Crispin <blogic@openwrt.org>
|
|
|
|
Date: Thu, 31 Mar 2016 02:28:08 +0200
|
2016-04-09 10:25:08 +00:00
|
|
|
Subject: [PATCH 59/81] mtd: nand: backport fixes
|
2016-04-01 07:11:18 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
drivers/mtd/nand/mtksdg1_nand.c | 9 ++++++++-
|
|
|
|
1 file changed, 8 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
--- a/drivers/mtd/nand/mtksdg1_nand.c
|
|
|
|
+++ b/drivers/mtd/nand/mtksdg1_nand.c
|
2016-04-16 21:05:48 +00:00
|
|
|
@@ -107,6 +107,9 @@ static struct nand_ecclayout nand_4k_128
|
2016-04-01 07:11:18 +00:00
|
|
|
.oobfree = { {0, 32} },
|
|
|
|
};
|
|
|
|
|
|
|
|
+static const char * const part_probes[] = {
|
|
|
|
+ "cmdlinepart", "RedBoot", "ofpart", NULL };
|
|
|
|
+
|
|
|
|
/* NFI register access */
|
|
|
|
static inline void mtk_nfi_writel(struct mtk_nfc_host *host, u32 val, u32 reg)
|
|
|
|
{
|
2016-04-16 21:05:48 +00:00
|
|
|
@@ -1298,6 +1301,7 @@ static int mtk_nfc_probe(struct platform
|
2016-04-01 07:11:18 +00:00
|
|
|
|
|
|
|
chip = &host->chip;
|
|
|
|
mtd = nand_to_mtd(chip);
|
|
|
|
+ mtd->priv = chip;
|
|
|
|
host->dev = dev;
|
|
|
|
|
|
|
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
2016-04-16 21:05:48 +00:00
|
|
|
@@ -1428,7 +1432,10 @@ static int mtk_nfc_probe(struct platform
|
2016-04-01 07:11:18 +00:00
|
|
|
}
|
|
|
|
host->switch_oob = false;
|
|
|
|
|
|
|
|
- ret = mtd_device_parse_register(mtd, NULL, NULL, NULL, 0);
|
|
|
|
+ ret = mtd_device_parse_register(mtd, part_probes,
|
|
|
|
+ &(struct mtd_part_parser_data) {
|
|
|
|
+ .of_node = pdev->dev.of_node,
|
|
|
|
+ }, NULL, 0);
|
|
|
|
if (ret) {
|
|
|
|
dev_err(dev, "mtd parse partition error\n");
|
|
|
|
goto nand_free;
|