Lines Matching full:master

67 bool mtd_partitions_used(struct mtd_info *master)  in mtd_partitions_used()  argument
71 list_for_each_entry(slave, &master->partitions, node) { in mtd_partitions_used()
531 * attached to the given master MTD object, recursively.
533 static int do_del_mtd_partitions(struct mtd_info *master) in do_del_mtd_partitions() argument
538 list_for_each_entry_safe(slave, next, &master->partitions, node) { in do_del_mtd_partitions()
558 int del_mtd_partitions(struct mtd_info *master) in del_mtd_partitions() argument
562 debug("Deleting MTD partitions on \"%s\":\n", master->name); in del_mtd_partitions()
565 ret = do_del_mtd_partitions(master); in del_mtd_partitions()
571 static struct mtd_info *allocate_partition(struct mtd_info *master, in allocate_partition() argument
583 master->name); in allocate_partition()
590 slave->type = master->type; in allocate_partition()
591 slave->flags = master->flags & ~part->mask_flags; in allocate_partition()
593 slave->writesize = master->writesize; in allocate_partition()
594 slave->writebufsize = master->writebufsize; in allocate_partition()
595 slave->oobsize = master->oobsize; in allocate_partition()
596 slave->oobavail = master->oobavail; in allocate_partition()
597 slave->subpage_sft = master->subpage_sft; in allocate_partition()
600 slave->owner = master->owner; in allocate_partition()
602 slave->backing_dev_info = master->backing_dev_info; in allocate_partition()
607 slave->dev.parent = master->dev.parent; in allocate_partition()
610 if (master->_read) in allocate_partition()
612 if (master->_write) in allocate_partition()
615 if (master->_panic_write) in allocate_partition()
619 if (master->_point && master->_unpoint) { in allocate_partition()
625 if (master->_get_unmapped_area) in allocate_partition()
627 if (master->_read_oob) in allocate_partition()
629 if (master->_write_oob) in allocate_partition()
631 if (master->_read_user_prot_reg) in allocate_partition()
633 if (master->_read_fact_prot_reg) in allocate_partition()
635 if (master->_write_user_prot_reg) in allocate_partition()
637 if (master->_lock_user_prot_reg) in allocate_partition()
639 if (master->_get_user_prot_info) in allocate_partition()
641 if (master->_get_fact_prot_info) in allocate_partition()
643 if (master->_sync) in allocate_partition()
646 if (!partno && !master->dev.class && master->_suspend && in allocate_partition()
647 master->_resume) { in allocate_partition()
651 if (master->_writev) in allocate_partition()
654 if (master->_lock) in allocate_partition()
656 if (master->_unlock) in allocate_partition()
658 if (master->_is_locked) in allocate_partition()
660 if (master->_block_isreserved) in allocate_partition()
662 if (master->_block_isbad) in allocate_partition()
664 if (master->_block_markbad) in allocate_partition()
667 slave->parent = master; in allocate_partition()
676 if (mtd_mod_by_eb(cur_offset, master) != 0) { in allocate_partition()
678 slave->offset = (mtd_div_by_eb(cur_offset, master) + 1) * master->erasesize; in allocate_partition()
686 if (master->size - slave->offset >= slave->size) { in allocate_partition()
687 slave->size = master->size - slave->offset in allocate_partition()
691 part->name, master->size - slave->offset, in allocate_partition()
698 slave->size = master->size - slave->offset; in allocate_partition()
704 if (slave->offset >= master->size) { in allocate_partition()
712 if (slave->offset + slave->size > master->size) { in allocate_partition()
713 slave->size = master->size - slave->offset; in allocate_partition()
715 part->name, master->name, slave->size); in allocate_partition()
717 if (master->numeraseregions > 1) { in allocate_partition()
719 int i, max = master->numeraseregions; in allocate_partition()
721 struct mtd_erase_region_info *regions = master->eraseregions; in allocate_partition()
739 slave->erasesize = master->erasesize; in allocate_partition()
758 slave->ecclayout = master->ecclayout; in allocate_partition()
759 slave->ecc_step_size = master->ecc_step_size; in allocate_partition()
760 slave->ecc_strength = master->ecc_strength; in allocate_partition()
761 slave->bitflip_threshold = master->bitflip_threshold; in allocate_partition()
763 if (master->_block_isbad) { in allocate_partition()
767 if (mtd_block_isbad(master, offs + slave->offset)) in allocate_partition()
778 int mtd_add_partition(struct mtd_info *master, const char *name, in mtd_add_partition() argument
792 length = master->size - offset; in mtd_add_partition()
803 new = allocate_partition(master, &part, -1, offset); in mtd_add_partition()
811 list_for_each_entry(p, &master->partitions, node) { in mtd_add_partition()
821 list_add_tail(&new->node, &master->partitions); in mtd_add_partition()
834 int mtd_del_partition(struct mtd_info *master, int partno) in mtd_del_partition() argument
840 list_for_each_entry_safe(slave, next, &master->partitions, node) in mtd_del_partition()
858 * This function, given a master MTD object and a partition table, creates
859 * and registers slave MTD objects which are bound to the master according to
862 * We don't register the master, or expect the caller to have done so,
866 int add_mtd_partitions(struct mtd_info *master, in add_mtd_partitions() argument
874 debug("Creating %d MTD partitions on \"%s\":\n", nbparts, master->name); in add_mtd_partitions()
877 slave = allocate_partition(master, parts + i, i, cur_offset); in add_mtd_partitions()
882 list_add_tail(&slave->node, &master->partitions); in add_mtd_partitions()
944 * @master: the master partition (describes whole MTD device)
949 * This function tries to find partition on MTD device @master. It uses MTD
962 int parse_mtd_partitions(struct mtd_info *master, const char *const *types, in parse_mtd_partitions() argument
978 ret = (*parser->parse_fn)(master, pparts, data); in parse_mtd_partitions()
982 ret, parser->name, master->name); in parse_mtd_partitions()