Lines Matching refs:subdev

32 	struct mtd_info **subdev;  member
62 struct mtd_info *subdev = concat->subdev[i]; in concat_read() local
65 if (from >= subdev->size) { in concat_read()
68 from -= subdev->size; in concat_read()
71 if (from + len > subdev->size) in concat_read()
73 size = subdev->size - from; in concat_read()
78 err = mtd_read(subdev, from, size, &retsize, buf); in concat_read()
113 struct mtd_info *subdev = concat->subdev[i]; in concat_panic_write() local
116 if (to >= subdev->size) { in concat_panic_write()
117 to -= subdev->size; in concat_panic_write()
120 if (to + len > subdev->size) in concat_panic_write()
121 size = subdev->size - to; in concat_panic_write()
125 err = mtd_panic_write(subdev, to, size, &retsize, buf); in concat_panic_write()
155 struct mtd_info *subdev = concat->subdev[i]; in concat_write() local
158 if (to >= subdev->size) { in concat_write()
160 to -= subdev->size; in concat_write()
163 if (to + len > subdev->size) in concat_write()
164 size = subdev->size - to; in concat_write()
168 err = mtd_write(subdev, to, size, &retsize, buf); in concat_write()
213 struct mtd_info *subdev = concat->subdev[i]; in concat_writev() local
216 if (to >= subdev->size) { in concat_writev()
217 to -= subdev->size; in concat_writev()
221 size = min_t(uint64_t, total_len, subdev->size - to); in concat_writev()
234 err = mtd_writev(subdev, &vecs_copy[entry_low], in concat_writev()
269 struct mtd_info *subdev = concat->subdev[i]; in concat_read_oob() local
271 if (from >= subdev->size) { in concat_read_oob()
272 from -= subdev->size; in concat_read_oob()
277 if (from + devops.len > subdev->size) in concat_read_oob()
278 devops.len = subdev->size - from; in concat_read_oob()
280 err = mtd_read_oob(subdev, from, &devops); in concat_read_oob()
329 struct mtd_info *subdev = concat->subdev[i]; in concat_write_oob() local
331 if (to >= subdev->size) { in concat_write_oob()
332 to -= subdev->size; in concat_write_oob()
337 if (to + devops.len > subdev->size) in concat_write_oob()
338 devops.len = subdev->size - to; in concat_write_oob()
340 err = mtd_write_oob(subdev, to, &devops); in concat_write_oob()
366 struct mtd_info *subdev; in concat_erase() local
432 subdev = concat->subdev[i]; in concat_erase()
433 if (subdev->size <= erase->addr) { in concat_erase()
434 erase->addr -= subdev->size; in concat_erase()
435 offset += subdev->size; in concat_erase()
448 subdev = concat->subdev[i]; /* get current subdevice */ in concat_erase()
451 if (erase->addr + length > subdev->size) in concat_erase()
452 erase->len = subdev->size - erase->addr; in concat_erase()
457 if ((err = mtd_erase(subdev, erase))) { in concat_erase()
474 offset += subdev->size; in concat_erase()
488 struct mtd_info *subdev = concat->subdev[i]; in concat_xxlock() local
491 if (ofs >= subdev->size) { in concat_xxlock()
493 ofs -= subdev->size; in concat_xxlock()
496 if (ofs + len > subdev->size) in concat_xxlock()
497 size = subdev->size - ofs; in concat_xxlock()
502 err = mtd_lock(subdev, ofs, size); in concat_xxlock()
504 err = mtd_unlock(subdev, ofs, size); in concat_xxlock()
535 struct mtd_info *subdev = concat->subdev[i]; in concat_is_locked() local
537 if (ofs >= subdev->size) { in concat_is_locked()
538 ofs -= subdev->size; in concat_is_locked()
542 if (ofs + len > subdev->size) in concat_is_locked()
545 return mtd_is_locked(subdev, ofs, len); in concat_is_locked()
557 struct mtd_info *subdev = concat->subdev[i]; in concat_sync() local
558 mtd_sync(subdev); in concat_sync()
568 struct mtd_info *subdev = concat->subdev[i]; in concat_suspend() local
569 if ((rc = mtd_suspend(subdev)) < 0) in concat_suspend()
581 struct mtd_info *subdev = concat->subdev[i]; in concat_resume() local
582 mtd_resume(subdev); in concat_resume()
591 if (!mtd_can_have_bb(concat->subdev[0])) in concat_block_isbad()
595 struct mtd_info *subdev = concat->subdev[i]; in concat_block_isbad() local
597 if (ofs >= subdev->size) { in concat_block_isbad()
598 ofs -= subdev->size; in concat_block_isbad()
602 res = mtd_block_isbad(subdev, ofs); in concat_block_isbad()
615 struct mtd_info *subdev = concat->subdev[i]; in concat_block_markbad() local
617 if (ofs >= subdev->size) { in concat_block_markbad()
618 ofs -= subdev->size; in concat_block_markbad()
622 err = mtd_block_markbad(subdev, ofs); in concat_block_markbad()
637 struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to concatenate */ in mtd_concat_create() argument
651 printk(KERN_NOTICE "(%d): \"%s\"\n", i, subdev[i]->name); in mtd_concat_create()
663 concat->subdev = (struct mtd_info **) (concat + 1); in mtd_concat_create()
669 concat->mtd.type = subdev[0]->type; in mtd_concat_create()
670 concat->mtd.flags = subdev[0]->flags; in mtd_concat_create()
671 concat->mtd.size = subdev[0]->size; in mtd_concat_create()
672 concat->mtd.erasesize = subdev[0]->erasesize; in mtd_concat_create()
673 concat->mtd.writesize = subdev[0]->writesize; in mtd_concat_create()
676 if (max_writebufsize < subdev[i]->writebufsize) in mtd_concat_create()
677 max_writebufsize = subdev[i]->writebufsize; in mtd_concat_create()
680 concat->mtd.subpage_sft = subdev[0]->subpage_sft; in mtd_concat_create()
681 concat->mtd.oobsize = subdev[0]->oobsize; in mtd_concat_create()
682 concat->mtd.oobavail = subdev[0]->oobavail; in mtd_concat_create()
684 subdev_master = mtd_get_master(subdev[0]); in mtd_concat_create()
702 concat->mtd.ecc_stats.badblocks = subdev[0]->ecc_stats.badblocks; in mtd_concat_create()
704 concat->subdev[0] = subdev[0]; in mtd_concat_create()
707 if (concat->mtd.type != subdev[i]->type) { in mtd_concat_create()
710 subdev[i]->name); in mtd_concat_create()
713 if (concat->mtd.flags != subdev[i]->flags) { in mtd_concat_create()
718 if ((concat->mtd.flags ^ subdev[i]-> in mtd_concat_create()
722 subdev[i]->name); in mtd_concat_create()
728 subdev[i]->flags & MTD_WRITEABLE; in mtd_concat_create()
731 subdev_master = mtd_get_master(subdev[i]); in mtd_concat_create()
732 concat->mtd.size += subdev[i]->size; in mtd_concat_create()
734 subdev[i]->ecc_stats.badblocks; in mtd_concat_create()
735 if (concat->mtd.writesize != subdev[i]->writesize || in mtd_concat_create()
736 concat->mtd.subpage_sft != subdev[i]->subpage_sft || in mtd_concat_create()
737 concat->mtd.oobsize != subdev[i]->oobsize || in mtd_concat_create()
749 subdev[i]->name); in mtd_concat_create()
752 concat->subdev[i] = subdev[i]; in mtd_concat_create()
756 mtd_set_ooblayout(&concat->mtd, subdev[0]->ooblayout); in mtd_concat_create()
775 max_erasesize = curr_erasesize = subdev[0]->erasesize; in mtd_concat_create()
778 if (subdev[i]->numeraseregions == 0) { in mtd_concat_create()
780 if (subdev[i]->erasesize != curr_erasesize) { in mtd_concat_create()
783 curr_erasesize = subdev[i]->erasesize; in mtd_concat_create()
790 for (j = 0; j < subdev[i]->numeraseregions; j++) { in mtd_concat_create()
793 if (subdev[i]->eraseregions[j].erasesize != in mtd_concat_create()
797 subdev[i]->eraseregions[j]. in mtd_concat_create()
841 curr_erasesize = subdev[0]->erasesize; in mtd_concat_create()
844 if (subdev[i]->numeraseregions == 0) { in mtd_concat_create()
846 if (subdev[i]->erasesize != curr_erasesize) { in mtd_concat_create()
859 curr_erasesize = subdev[i]->erasesize; in mtd_concat_create()
862 position += subdev[i]->size; in mtd_concat_create()
866 for (j = 0; j < subdev[i]->numeraseregions; j++) { in mtd_concat_create()
868 if (subdev[i]->eraseregions[j]. in mtd_concat_create()
879 subdev[i]->eraseregions[j]. in mtd_concat_create()
884 subdev[i]->eraseregions[j]. in mtd_concat_create()