[OpenWrt-Devel] [PATCH][RFC][bcm53xx] mtd: nand: bcm_nand: switch from cmdlinepart to ofpart

Rafał Miłecki zajec5 at gmail.com
Sat Dec 6 19:18:22 EST 2014


bcm_nand uses (and depends on) OF, so there isn't much sense to use
cmdlinepart

Signed-off-by: Rafał Miłecki <zajec5 at gmail.com>
---
 drivers/mtd/nand/bcm_nand.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/bcm_nand.c b/drivers/mtd/nand/bcm_nand.c
index 3c5b1d1..f2bd79e 100644
--- a/drivers/mtd/nand/bcm_nand.c
+++ b/drivers/mtd/nand/bcm_nand.c
@@ -40,6 +40,7 @@
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
+#include <linux/mtd/partitions.h>
 
 #define NANDC_MAX_CHIPS		2	/* Only 2 CSn supported in NorthStar */
 
@@ -1494,13 +1495,14 @@ static int __init bcmnand_idm_init(struct bcmnand_ctrl *ctrl)
 	return 0;
 }
 
-static const char * const part_probes[] = { "bcm47xxpart", "cmdlinepart", NULL };
+static const char * const part_probes[] = { "bcm47xxpart", "ofpart", NULL };
 
 /*
  * Top-level init function
  */
 static int bcmnand_probe(struct bcma_device *core)
 {
+	struct mtd_part_parser_data parser_data;
 	struct device *dev = &core->dev;
 	struct device_node *np = dev->of_node;
 	struct bcmnand_ctrl *ctrl;
@@ -1539,7 +1541,8 @@ static int bcmnand_probe(struct bcma_device *core)
 	if (res)
 		return res;
 
-	res = mtd_device_parse_register(&ctrl->mtd, part_probes, NULL, NULL, 0);
+	parser_data.of_node = np;
+	res = mtd_device_parse_register(&ctrl->mtd, part_probes, &parser_data, NULL, 0);
 	if (res) {
 		pr_err("%s: Failed to register MTD device: %d\n", DRV_NAME, res);
 		return res;
-- 
1.8.4.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list