Lines Matching refs:concat
71 struct mtd_concat *concat = CONCAT(mtd); in concat_read() local
75 for (i = 0; i < concat->num_subdev; i++) { in concat_read()
76 struct mtd_info *subdev = concat->subdev[i]; in concat_read()
123 struct mtd_concat *concat = CONCAT(mtd); in concat_write() local
127 for (i = 0; i < concat->num_subdev; i++) { in concat_write()
128 struct mtd_info *subdev = concat->subdev[i]; in concat_write()
161 struct mtd_concat *concat = CONCAT(mtd); in concat_writev() local
185 for (i = 0; i < concat->num_subdev; i++) { in concat_writev()
186 struct mtd_info *subdev = concat->subdev[i]; in concat_writev()
235 struct mtd_concat *concat = CONCAT(mtd); in concat_read_oob() local
241 for (i = 0; i < concat->num_subdev; i++) { in concat_read_oob()
242 struct mtd_info *subdev = concat->subdev[i]; in concat_read_oob()
292 struct mtd_concat *concat = CONCAT(mtd); in concat_write_oob() local
301 for (i = 0; i < concat->num_subdev; i++) { in concat_write_oob()
302 struct mtd_info *subdev = concat->subdev[i]; in concat_write_oob()
338 struct mtd_concat *concat = CONCAT(mtd); in concat_erase() local
350 if (!concat->mtd.numeraseregions) { in concat_erase()
352 if (instr->addr & (concat->mtd.erasesize - 1)) in concat_erase()
354 if (instr->len & (concat->mtd.erasesize - 1)) in concat_erase()
359 concat->mtd.eraseregions; in concat_erase()
364 for (i = 0; i < concat->mtd.numeraseregions && in concat_erase()
379 for (; i < concat->mtd.numeraseregions && in concat_erase()
404 for (i = 0; i < concat->num_subdev; i++) { in concat_erase()
405 subdev = concat->subdev[i]; in concat_erase()
415 BUG_ON(i >= concat->num_subdev); in concat_erase()
421 subdev = concat->subdev[i]; /* get current subdevice */ in concat_erase()
456 struct mtd_concat *concat = CONCAT(mtd); in concat_lock() local
459 for (i = 0; i < concat->num_subdev; i++) { in concat_lock()
460 struct mtd_info *subdev = concat->subdev[i]; in concat_lock()
490 struct mtd_concat *concat = CONCAT(mtd); in concat_unlock() local
493 for (i = 0; i < concat->num_subdev; i++) { in concat_unlock()
494 struct mtd_info *subdev = concat->subdev[i]; in concat_unlock()
524 struct mtd_concat *concat = CONCAT(mtd); in concat_sync() local
527 for (i = 0; i < concat->num_subdev; i++) { in concat_sync()
528 struct mtd_info *subdev = concat->subdev[i]; in concat_sync()
535 struct mtd_concat *concat = CONCAT(mtd); in concat_suspend() local
538 for (i = 0; i < concat->num_subdev; i++) { in concat_suspend()
539 struct mtd_info *subdev = concat->subdev[i]; in concat_suspend()
548 struct mtd_concat *concat = CONCAT(mtd); in concat_resume() local
551 for (i = 0; i < concat->num_subdev; i++) { in concat_resume()
552 struct mtd_info *subdev = concat->subdev[i]; in concat_resume()
559 struct mtd_concat *concat = CONCAT(mtd); in concat_block_isbad() local
562 if (!mtd_can_have_bb(concat->subdev[0])) in concat_block_isbad()
565 for (i = 0; i < concat->num_subdev; i++) { in concat_block_isbad()
566 struct mtd_info *subdev = concat->subdev[i]; in concat_block_isbad()
582 struct mtd_concat *concat = CONCAT(mtd); in concat_block_markbad() local
585 for (i = 0; i < concat->num_subdev; i++) { in concat_block_markbad()
586 struct mtd_info *subdev = concat->subdev[i]; in concat_block_markbad()
614 struct mtd_concat *concat; in mtd_concat_create() local
626 concat = kzalloc(size, GFP_KERNEL); in mtd_concat_create()
627 if (!concat) { in mtd_concat_create()
633 concat->subdev = (struct mtd_info **) (concat + 1); in mtd_concat_create()
639 concat->mtd.type = subdev[0]->type; in mtd_concat_create()
640 concat->mtd.flags = subdev[0]->flags; in mtd_concat_create()
641 concat->mtd.size = subdev[0]->size; in mtd_concat_create()
642 concat->mtd.erasesize = subdev[0]->erasesize; in mtd_concat_create()
643 concat->mtd.writesize = subdev[0]->writesize; in mtd_concat_create()
648 concat->mtd.writebufsize = max_writebufsize; in mtd_concat_create()
650 concat->mtd.subpage_sft = subdev[0]->subpage_sft; in mtd_concat_create()
651 concat->mtd.oobsize = subdev[0]->oobsize; in mtd_concat_create()
652 concat->mtd.oobavail = subdev[0]->oobavail; in mtd_concat_create()
654 concat->mtd._writev = concat_writev; in mtd_concat_create()
656 concat->mtd._read_oob = concat_read_oob; in mtd_concat_create()
658 concat->mtd._write_oob = concat_write_oob; in mtd_concat_create()
660 concat->mtd._block_isbad = concat_block_isbad; in mtd_concat_create()
662 concat->mtd._block_markbad = concat_block_markbad; in mtd_concat_create()
664 concat->mtd.ecc_stats.badblocks = subdev[0]->ecc_stats.badblocks; in mtd_concat_create()
666 concat->subdev[0] = subdev[0]; in mtd_concat_create()
669 if (concat->mtd.type != subdev[i]->type) { in mtd_concat_create()
670 kfree(concat); in mtd_concat_create()
675 if (concat->mtd.flags != subdev[i]->flags) { in mtd_concat_create()
680 if ((concat->mtd.flags ^ subdev[i]-> in mtd_concat_create()
682 kfree(concat); in mtd_concat_create()
689 concat->mtd.flags |= in mtd_concat_create()
693 concat->mtd.size += subdev[i]->size; in mtd_concat_create()
694 concat->mtd.ecc_stats.badblocks += in mtd_concat_create()
696 if (concat->mtd.writesize != subdev[i]->writesize || in mtd_concat_create()
697 concat->mtd.subpage_sft != subdev[i]->subpage_sft || in mtd_concat_create()
698 concat->mtd.oobsize != subdev[i]->oobsize || in mtd_concat_create()
699 !concat->mtd._read_oob != !subdev[i]->_read_oob || in mtd_concat_create()
700 !concat->mtd._write_oob != !subdev[i]->_write_oob) { in mtd_concat_create()
701 kfree(concat); in mtd_concat_create()
706 concat->subdev[i] = subdev[i]; in mtd_concat_create()
710 mtd_set_ooblayout(&concat->mtd, subdev[0]->ooblayout); in mtd_concat_create()
712 concat->num_subdev = num_devs; in mtd_concat_create()
713 concat->mtd.name = name; in mtd_concat_create()
715 concat->mtd._erase = concat_erase; in mtd_concat_create()
716 concat->mtd._read = concat_read; in mtd_concat_create()
717 concat->mtd._write = concat_write; in mtd_concat_create()
718 concat->mtd._sync = concat_sync; in mtd_concat_create()
719 concat->mtd._lock = concat_lock; in mtd_concat_create()
720 concat->mtd._unlock = concat_unlock; in mtd_concat_create()
721 concat->mtd._suspend = concat_suspend; in mtd_concat_create()
722 concat->mtd._resume = concat_resume; in mtd_concat_create()
766 concat->mtd.erasesize = curr_erasesize; in mtd_concat_create()
767 concat->mtd.numeraseregions = 0; in mtd_concat_create()
778 concat->mtd.erasesize = max_erasesize; in mtd_concat_create()
779 concat->mtd.numeraseregions = num_erase_region; in mtd_concat_create()
780 concat->mtd.eraseregions = erase_region_p = in mtd_concat_create()
785 kfree(concat); in mtd_concat_create()
852 return &concat->mtd; in mtd_concat_create()
861 struct mtd_concat *concat = CONCAT(mtd); in mtd_concat_destroy() local
862 if (concat->mtd.numeraseregions) in mtd_concat_destroy()
863 kfree(concat->mtd.eraseregions); in mtd_concat_destroy()
864 kfree(concat); in mtd_concat_destroy()