/* This function unregisters and destroy all slave MTD objects which are attached to the given master MTD object.  */
int del_mtd_partitions(struct mtd_info *master)
/* This function unregisters and destroy all slave MTD objects which are attached to the given master MTD object.  */
int del_mtd_partitions(struct mtd_info *master)
{
	struct mtd_part *slave, *next;
	list_for_each_entry_safe(slave, next, &mtd_partitions, list)
		if (slave->master == master) {
			list_del(&slave->list);
			if (slave->registered)
				del_mtd_device(&slave->mtd);
			kfree(slave);
		}
	return 0;
}