mtd: Don't stop MTD partition creation when it fails on one device
[oweals/u-boot.git] / drivers / mtd / mtdpart.c
index 4d2ac8107f01c564cf9165454f1e6203b99b06a3..fd8d8e5ea7295ac44c2bb25677d2e3df06f6d1cc 100644 (file)
@@ -63,6 +63,18 @@ char *kstrdup(const char *s, gfp_t gfp)
 #define MTD_SIZE_REMAINING             (~0LLU)
 #define MTD_OFFSET_NOT_SPECIFIED       (~0LLU)
 
+bool mtd_partitions_used(struct mtd_info *master)
+{
+       struct mtd_info *slave;
+
+       list_for_each_entry(slave, &master->partitions, node) {
+               if (slave->usecount)
+                       return true;
+       }
+
+       return false;
+}
+
 /**
  * mtd_parse_partition - Parse @mtdparts partition definition, fill @partition
  *                       with it and update the @mtdparts string pointer.