Lines Matching refs:subdev

46 	struct mtd_info **subdev;
51 * including the pointer array subdev points to:
76 struct mtd_info *subdev = concat->subdev[i];
79 if (from >= subdev->size) {
80 /* Not destined for this subdev */
82 from -= subdev->size;
85 if (from + len > subdev->size)
86 /* First part goes into this subdev */
87 size = subdev->size - from;
89 /* Entire transaction goes into this subdev */
92 err = mtd_read(subdev, from, size, &retsize, buf);
128 struct mtd_info *subdev = concat->subdev[i];
131 if (to >= subdev->size) {
133 to -= subdev->size;
136 if (to + len > subdev->size)
137 size = subdev->size - to;
141 err = mtd_write(subdev, to, size, &retsize, buf);
186 struct mtd_info *subdev = concat->subdev[i];
189 if (to >= subdev->size) {
190 to -= subdev->size;
194 size = min_t(uint64_t, total_len, subdev->size - to);
207 err = mtd_writev(subdev, &vecs_copy[entry_low],
242 struct mtd_info *subdev = concat->subdev[i];
244 if (from >= subdev->size) {
245 from -= subdev->size;
250 if (from + devops.len > subdev->size)
251 devops.len = subdev->size - from;
253 err = mtd_read_oob(subdev, from, &devops);
302 struct mtd_info *subdev = concat->subdev[i];
304 if (to >= subdev->size) {
305 to -= subdev->size;
310 if (to + devops.len > subdev->size)
311 devops.len = subdev->size - to;
313 err = mtd_write_oob(subdev, to, &devops);
377 struct mtd_info *subdev;
443 subdev = concat->subdev[i];
444 if (subdev->size <= erase->addr) {
445 erase->addr -= subdev->size;
446 offset += subdev->size;
459 subdev = concat->subdev[i]; /* get current subdevice */
462 if (erase->addr + length > subdev->size)
463 erase->len = subdev->size - erase->addr;
468 if ((err = concat_dev_erase(subdev, erase))) {
485 offset += subdev->size;
503 struct mtd_info *subdev = concat->subdev[i];
506 if (ofs >= subdev->size) {
508 ofs -= subdev->size;
511 if (ofs + len > subdev->size)
512 size = subdev->size - ofs;
516 err = mtd_lock(subdev, ofs, size);
537 struct mtd_info *subdev = concat->subdev[i];
540 if (ofs >= subdev->size) {
542 ofs -= subdev->size;
545 if (ofs + len > subdev->size)
546 size = subdev->size - ofs;
550 err = mtd_unlock(subdev, ofs, size);
571 struct mtd_info *subdev = concat->subdev[i];
572 mtd_sync(subdev);
582 struct mtd_info *subdev = concat->subdev[i];
583 if ((rc = mtd_suspend(subdev)) < 0)
595 struct mtd_info *subdev = concat->subdev[i];
596 mtd_resume(subdev);
605 if (!mtd_can_have_bb(concat->subdev[0]))
609 struct mtd_info *subdev = concat->subdev[i];
611 if (ofs >= subdev->size) {
612 ofs -= subdev->size;
616 res = mtd_block_isbad(subdev, ofs);
629 struct mtd_info *subdev = concat->subdev[i];
631 if (ofs >= subdev->size) {
632 ofs -= subdev->size;
636 err = mtd_block_markbad(subdev, ofs);
647 * - we don't support subdev spanning as we can't guarantee it'll work
658 struct mtd_info *subdev = concat->subdev[i];
660 if (offset >= subdev->size) {
661 offset -= subdev->size;
665 return mtd_get_unmapped_area(subdev, len, offset, flags);
677 struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to concatenate */
690 printk(KERN_NOTICE "(%d): \"%s\"\n", i, subdev[i]->name);
702 concat->subdev = (struct mtd_info **) (concat + 1);
708 concat->mtd.type = subdev[0]->type;
709 concat->mtd.flags = subdev[0]->flags;
710 concat->mtd.size = subdev[0]->size;
711 concat->mtd.erasesize = subdev[0]->erasesize;
712 concat->mtd.writesize = subdev[0]->writesize;
715 if (max_writebufsize < subdev[i]->writebufsize)
716 max_writebufsize = subdev[i]->writebufsize;
719 concat->mtd.subpage_sft = subdev[0]->subpage_sft;
720 concat->mtd.oobsize = subdev[0]->oobsize;
721 concat->mtd.oobavail = subdev[0]->oobavail;
722 if (subdev[0]->_writev)
724 if (subdev[0]->_read_oob)
726 if (subdev[0]->_write_oob)
728 if (subdev[0]->_block_isbad)
730 if (subdev[0]->_block_markbad)
733 concat->mtd.ecc_stats.badblocks = subdev[0]->ecc_stats.badblocks;
735 concat->mtd.backing_dev_info = subdev[0]->backing_dev_info;
737 concat->subdev[0] = subdev[0];
740 if (concat->mtd.type != subdev[i]->type) {
743 subdev[i]->name);
746 if (concat->mtd.flags != subdev[i]->flags) {
751 if ((concat->mtd.flags ^ subdev[i]->
755 subdev[i]->name);
761 subdev[i]->flags & MTD_WRITEABLE;
768 subdev[i]->backing_dev_info)
772 concat->mtd.size += subdev[i]->size;
774 subdev[i]->ecc_stats.badblocks;
775 if (concat->mtd.writesize != subdev[i]->writesize ||
776 concat->mtd.subpage_sft != subdev[i]->subpage_sft ||
777 concat->mtd.oobsize != subdev[i]->oobsize ||
778 !concat->mtd._read_oob != !subdev[i]->_read_oob ||
779 !concat->mtd._write_oob != !subdev[i]->_write_oob) {
782 subdev[i]->name);
785 concat->subdev[i] = subdev[i];
789 concat->mtd.ecclayout = subdev[0]->ecclayout;
810 max_erasesize = curr_erasesize = subdev[0]->erasesize;
813 if (subdev[i]->numeraseregions == 0) {
815 if (subdev[i]->erasesize != curr_erasesize) {
818 curr_erasesize = subdev[i]->erasesize;
825 for (j = 0; j < subdev[i]->numeraseregions; j++) {
828 if (subdev[i]->eraseregions[j].erasesize !=
832 subdev[i]->eraseregions[j].
875 curr_erasesize = subdev[0]->erasesize;
878 if (subdev[i]->numeraseregions == 0) {
880 if (subdev[i]->erasesize != curr_erasesize) {
893 curr_erasesize = subdev[i]->erasesize;
896 position += subdev[i]->size;
900 for (j = 0; j < subdev[i]->numeraseregions; j++) {
902 if (subdev[i]->eraseregions[j].
913 subdev[i]->eraseregions[j].
918 subdev[i]->eraseregions[j].