bcm53xx: bcm_nand: switch from cmdlinepart to ofpart

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 43580
This commit is contained in:
Rafał Miłecki 2014-12-08 17:39:07 +00:00
parent 73237c0c9b
commit aed6b26431
2 changed files with 12 additions and 6 deletions

View File

@ -22,7 +22,7 @@
nand-objs := nand_base.o nand_bbt.o nand-objs := nand_base.o nand_bbt.o
--- /dev/null --- /dev/null
+++ b/drivers/mtd/nand/bcm_nand.c +++ b/drivers/mtd/nand/bcm_nand.c
@@ -0,0 +1,1580 @@ @@ -0,0 +1,1583 @@
+/* +/*
+ * Nortstar NAND controller driver + * Nortstar NAND controller driver
+ * + *
@ -64,6 +64,7 @@
+ +
+#include <linux/mtd/mtd.h> +#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h> +#include <linux/mtd/nand.h>
+#include <linux/mtd/partitions.h>
+ +
+#define NANDC_MAX_CHIPS 2 /* Only 2 CSn supported in NorthStar */ +#define NANDC_MAX_CHIPS 2 /* Only 2 CSn supported in NorthStar */
+ +
@ -1515,13 +1516,14 @@
+ return 0; + return 0;
+} +}
+ +
+static const char * const part_probes[] = { "bcm47xxpart", "cmdlinepart", NULL }; +static const char * const part_probes[] = { "ofpart", "bcm47xxpart", NULL };
+ +
+/* +/*
+ * Top-level init function + * Top-level init function
+ */ + */
+static int bcmnand_probe(struct bcma_device *core) +static int bcmnand_probe(struct bcma_device *core)
+{ +{
+ struct mtd_part_parser_data parser_data;
+ struct device *dev = &core->dev; + struct device *dev = &core->dev;
+ struct bcmnand_ctrl *ctrl; + struct bcmnand_ctrl *ctrl;
+ int res, i, irq; + int res, i, irq;
@ -1559,7 +1561,8 @@
+ if (res) + if (res)
+ return 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) { + if (res) {
+ dev_err(dev, "Failed to register MTD device: %d\n", res); + dev_err(dev, "Failed to register MTD device: %d\n", res);
+ return res; + return res;

View File

@ -22,7 +22,7 @@
nand-objs := nand_base.o nand_bbt.o nand_timings.o nand-objs := nand_base.o nand_bbt.o nand_timings.o
--- /dev/null --- /dev/null
+++ b/drivers/mtd/nand/bcm_nand.c +++ b/drivers/mtd/nand/bcm_nand.c
@@ -0,0 +1,1580 @@ @@ -0,0 +1,1583 @@
+/* +/*
+ * Nortstar NAND controller driver + * Nortstar NAND controller driver
+ * + *
@ -64,6 +64,7 @@
+ +
+#include <linux/mtd/mtd.h> +#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h> +#include <linux/mtd/nand.h>
+#include <linux/mtd/partitions.h>
+ +
+#define NANDC_MAX_CHIPS 2 /* Only 2 CSn supported in NorthStar */ +#define NANDC_MAX_CHIPS 2 /* Only 2 CSn supported in NorthStar */
+ +
@ -1515,13 +1516,14 @@
+ return 0; + return 0;
+} +}
+ +
+static const char * const part_probes[] = { "bcm47xxpart", "cmdlinepart", NULL }; +static const char * const part_probes[] = { "ofpart", "bcm47xxpart", NULL };
+ +
+/* +/*
+ * Top-level init function + * Top-level init function
+ */ + */
+static int bcmnand_probe(struct bcma_device *core) +static int bcmnand_probe(struct bcma_device *core)
+{ +{
+ struct mtd_part_parser_data parser_data;
+ struct device *dev = &core->dev; + struct device *dev = &core->dev;
+ struct bcmnand_ctrl *ctrl; + struct bcmnand_ctrl *ctrl;
+ int res, i, irq; + int res, i, irq;
@ -1559,7 +1561,8 @@
+ if (res) + if (res)
+ return 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) { + if (res) {
+ dev_err(dev, "Failed to register MTD device: %d\n", res); + dev_err(dev, "Failed to register MTD device: %d\n", res);
+ return res; + return res;