/* Note, we currently do not try and look to see if we've already copied the data in a previous set.  */
static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set)
/* Note, we currently do not try and look to see if we've already copied the data in a previous set.  */
static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set)
{
	void *ptr;
	int size;
	size = sizeof(struct mtd_partition) * set->nr_partitions;
	if (size) {
		ptr = kmemdup(set->partitions, size, GFP_KERNEL);
		set->partitions = ptr;
		if (!ptr)
			return -ENOMEM;
	}
	if (set->nr_map && set->nr_chips) {
		size = sizeof(int) * set->nr_chips;
		ptr = kmemdup(set->nr_map, size, GFP_KERNEL);
		set->nr_map = ptr;
		if (!ptr)
			return -ENOMEM;
	}
	if (set->ecc_layout) {
		ptr = kmemdup(set->ecc_layout,
			      sizeof(struct nand_ecclayout), GFP_KERNEL);
		set->ecc_layout = ptr;
		if (!ptr)
			return -ENOMEM;
	}
	return 0;
}