summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-04-22 09:09:24 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-04-22 09:25:37 +0200
commitcd23160af8b4e342bb3af116d8e5b4e262ac9083 (patch)
treec33e608dc4b3f1596ca56c99cb4c35fb7d6cdba7 /drivers
parent66cd90abe728418afdd01c52502781021748e3e6 (diff)
downloadbarebox-cd23160af8b4e342bb3af116d8e5b4e262ac9083.tar.gz
barebox-cd23160af8b4e342bb3af116d8e5b4e262ac9083.tar.xz
of: partitions: create bb device for nand flashes
For nand flashes automatically create a bb device for each partion. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/of/partition.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/of/partition.c b/drivers/of/partition.c
index a78466b797..2d70cf5353 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);
}