/* We don't register the master, or expect the caller to have done so, for reasons of data integrity.  */
int add_mtd_partitions(struct mtd_info *master, const struct mtd_partition *parts, int nbparts)
/* We don't register the master, or expect the caller to have done so, for reasons of data integrity.  */
int add_mtd_partitions(struct mtd_info *master, const struct mtd_partition *parts, int nbparts)
{
	struct mtd_part *slave;
	uint64_t cur_offset = 0;
	int i;
	printk(KERN_NOTICE "Creating %d MTD partitions on \"%s\":\n", nbparts, master->name);
	for (i = 0; i < nbparts; i++) {
		slave = add_one_partition(master, parts + i, i, cur_offset);
		if (!slave)
			return -ENOMEM;
		cur_offset = slave->offset + slave->mtd.size;
	}
	return 0;
}