For nand flashes automatically create a bb device for each partion.
Signed-off-by: Sascha Hauer <[email protected]>
---
drivers/of/partition.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/of/partition.c b/drivers/of/partition.c
index a78466b..2d70cf5 100644
--- a/drivers/of/partition.c
+++ b/drivers/of/partition.c
@@ -21,6 +21,7 @@
#include <of.h>
#include <malloc.h>
#include <linux/mtd/mtd.h>
+#include <nand.h>
int of_parse_partitions(struct cdev *cdev, struct device_node *node)
{
@@ -56,6 +57,9 @@ int of_parse_partitions(struct cdev *cdev, struct device_node
*node)
devfs_add_partition(cdev->name, offset, size, flags, filename);
+ if (cdev->mtd && cdev->mtd->type == MTD_NANDFLASH)
+ dev_add_bb_dev(filename, NULL);
+
free(filename);
}
--
1.8.2.rc2
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox