Lines Matching refs:master

66 bool mtd_partitions_used(struct mtd_info *master)  in mtd_partitions_used()  argument
70 list_for_each_entry(slave, &master->partitions, node) { in mtd_partitions_used()
532 static int do_del_mtd_partitions(struct mtd_info *master) in do_del_mtd_partitions() argument
537 list_for_each_entry_safe(slave, next, &master->partitions, node) { in do_del_mtd_partitions()
557 int del_mtd_partitions(struct mtd_info *master) in del_mtd_partitions() argument
561 debug("Deleting MTD partitions on \"%s\":\n", master->name); in del_mtd_partitions()
564 ret = do_del_mtd_partitions(master); in del_mtd_partitions()
570 static struct mtd_info *allocate_partition(struct mtd_info *master, in allocate_partition() argument
582 master->name); in allocate_partition()
589 slave->type = master->type; in allocate_partition()
590 slave->flags = master->flags & ~part->mask_flags; in allocate_partition()
592 slave->writesize = master->writesize; in allocate_partition()
593 slave->writebufsize = master->writebufsize; in allocate_partition()
594 slave->oobsize = master->oobsize; in allocate_partition()
595 slave->oobavail = master->oobavail; in allocate_partition()
596 slave->subpage_sft = master->subpage_sft; in allocate_partition()
599 slave->owner = master->owner; in allocate_partition()
601 slave->backing_dev_info = master->backing_dev_info; in allocate_partition()
606 slave->dev.parent = master->dev.parent; in allocate_partition()
609 if (master->_read) in allocate_partition()
611 if (master->_write) in allocate_partition()
614 if (master->_panic_write) in allocate_partition()
618 if (master->_point && master->_unpoint) { in allocate_partition()
624 if (master->_get_unmapped_area) in allocate_partition()
626 if (master->_read_oob) in allocate_partition()
628 if (master->_write_oob) in allocate_partition()
630 if (master->_read_user_prot_reg) in allocate_partition()
632 if (master->_read_fact_prot_reg) in allocate_partition()
634 if (master->_write_user_prot_reg) in allocate_partition()
636 if (master->_lock_user_prot_reg) in allocate_partition()
638 if (master->_get_user_prot_info) in allocate_partition()
640 if (master->_get_fact_prot_info) in allocate_partition()
642 if (master->_sync) in allocate_partition()
645 if (!partno && !master->dev.class && master->_suspend && in allocate_partition()
646 master->_resume) { in allocate_partition()
650 if (master->_writev) in allocate_partition()
653 if (master->_lock) in allocate_partition()
655 if (master->_unlock) in allocate_partition()
657 if (master->_is_locked) in allocate_partition()
659 if (master->_block_isreserved) in allocate_partition()
661 if (master->_block_isbad) in allocate_partition()
663 if (master->_block_markbad) in allocate_partition()
666 slave->parent = master; in allocate_partition()
675 if (mtd_mod_by_eb(cur_offset, master) != 0) { in allocate_partition()
677 slave->offset = (mtd_div_by_eb(cur_offset, master) + 1) * master->erasesize; in allocate_partition()
685 if (master->size - slave->offset >= slave->size) { in allocate_partition()
686 slave->size = master->size - slave->offset in allocate_partition()
690 part->name, master->size - slave->offset, in allocate_partition()
697 slave->size = master->size - slave->offset; in allocate_partition()
703 if (slave->offset >= master->size) { in allocate_partition()
711 if (slave->offset + slave->size > master->size) { in allocate_partition()
712 slave->size = master->size - slave->offset; in allocate_partition()
714 part->name, master->name, slave->size); in allocate_partition()
716 if (master->numeraseregions > 1) { in allocate_partition()
718 int i, max = master->numeraseregions; in allocate_partition()
720 struct mtd_erase_region_info *regions = master->eraseregions; in allocate_partition()
738 slave->erasesize = master->erasesize; in allocate_partition()
757 slave->ecclayout = master->ecclayout; in allocate_partition()
758 slave->ecc_step_size = master->ecc_step_size; in allocate_partition()
759 slave->ecc_strength = master->ecc_strength; in allocate_partition()
760 slave->bitflip_threshold = master->bitflip_threshold; in allocate_partition()
762 if (master->_block_isbad) { in allocate_partition()
766 if (mtd_block_isbad(master, offs + slave->offset)) in allocate_partition()
777 int mtd_add_partition(struct mtd_info *master, const char *name, in mtd_add_partition() argument
791 length = master->size - offset; in mtd_add_partition()
802 new = allocate_partition(master, &part, -1, offset); in mtd_add_partition()
810 list_for_each_entry(p, &master->partitions, node) { in mtd_add_partition()
820 list_add_tail(&new->node, &master->partitions); in mtd_add_partition()
833 int mtd_del_partition(struct mtd_info *master, int partno) in mtd_del_partition() argument
839 list_for_each_entry_safe(slave, next, &master->partitions, node) in mtd_del_partition()
865 int add_mtd_partitions(struct mtd_info *master, in add_mtd_partitions() argument
873 debug("Creating %d MTD partitions on \"%s\":\n", nbparts, master->name); in add_mtd_partitions()
876 slave = allocate_partition(master, parts + i, i, cur_offset); in add_mtd_partitions()
881 list_add_tail(&slave->node, &master->partitions); in add_mtd_partitions()
961 int parse_mtd_partitions(struct mtd_info *master, const char *const *types, in parse_mtd_partitions() argument
977 ret = (*parser->parse_fn)(master, pparts, data); in parse_mtd_partitions()
981 ret, parser->name, master->name); in parse_mtd_partitions()