Lines Matching refs:master
439 struct mtd_info *master = mtd_get_master(mtd); in mtd_wunit_to_pairing_info() local
440 int npairs = mtd_wunit_per_eb(master) / mtd_pairing_groups(master); in mtd_wunit_to_pairing_info()
445 if (master->pairing && master->pairing->get_info) in mtd_wunit_to_pairing_info()
446 return master->pairing->get_info(master, wunit, info); in mtd_wunit_to_pairing_info()
482 struct mtd_info *master = mtd_get_master(mtd); in mtd_pairing_info_to_wunit() local
483 int ngroups = mtd_pairing_groups(master); in mtd_pairing_info_to_wunit()
484 int npairs = mtd_wunit_per_eb(master) / ngroups; in mtd_pairing_info_to_wunit()
490 if (master->pairing && master->pairing->get_wunit) in mtd_pairing_info_to_wunit()
491 return mtd->pairing->get_wunit(master, info); in mtd_pairing_info_to_wunit()
509 struct mtd_info *master = mtd_get_master(mtd); in mtd_pairing_groups() local
511 if (!master->pairing || !master->pairing->ngroups) in mtd_pairing_groups()
514 return master->pairing->ngroups; in mtd_pairing_groups()
574 struct mtd_info *master = mtd_get_master(mtd); in add_mtd_device() local
596 if (WARN_ON((!mtd->erasesize || !master->_erase) && in add_mtd_device()
609 (!mtd_is_partition(mtd) || master->type != MTD_MLCNANDFLASH || in add_mtd_device()
610 !master->pairing || master->_writev)) in add_mtd_device()
629 int ngroups = mtd_pairing_groups(master); in add_mtd_device()
632 mtd->size = (u64)mtd_div_by_eb(mtd->size, master) * in add_mtd_device()
775 mutex_init(&mtd->master.partitions_lock); in mtd_set_dev_defaults()
864 int mtd_device_unregister(struct mtd_info *master) in mtd_device_unregister() argument
868 if (master->_reboot) in mtd_device_unregister()
869 unregister_reboot_notifier(&master->reboot_notifier); in mtd_device_unregister()
871 err = del_mtd_partitions(master); in mtd_device_unregister()
875 if (!device_is_registered(&master->dev)) in mtd_device_unregister()
878 return del_mtd_device(master); in mtd_device_unregister()
981 struct mtd_info *master = mtd_get_master(mtd); in __get_mtd_device() local
984 if (!try_module_get(master->owner)) in __get_mtd_device()
987 if (master->_get_device) { in __get_mtd_device()
988 err = master->_get_device(mtd); in __get_mtd_device()
991 module_put(master->owner); in __get_mtd_device()
1054 struct mtd_info *master = mtd_get_master(mtd); in __put_mtd_device() local
1062 if (master->_put_device) in __put_mtd_device()
1063 master->_put_device(master); in __put_mtd_device()
1065 module_put(master->owner); in __put_mtd_device()
1076 struct mtd_info *master = mtd_get_master(mtd); in mtd_erase() local
1084 if (!mtd->erasesize || !master->_erase) in mtd_erase()
1099 master->erasesize; in mtd_erase()
1101 master->erasesize) - in mtd_erase()
1107 ret = master->_erase(master, &adjinstr); in mtd_erase()
1113 master); in mtd_erase()
1128 struct mtd_info *master = mtd_get_master(mtd); in mtd_point() local
1134 if (!master->_point) in mtd_point()
1142 return master->_point(master, from, len, retlen, virt, phys); in mtd_point()
1149 struct mtd_info *master = mtd_get_master(mtd); in mtd_unpoint() local
1151 if (!master->_unpoint) in mtd_unpoint()
1157 return master->_unpoint(master, mtd_get_master_ofs(mtd, from), len); in mtd_unpoint()
1184 static void mtd_update_ecc_stats(struct mtd_info *mtd, struct mtd_info *master, in mtd_update_ecc_stats() argument
1189 if (master == mtd) in mtd_update_ecc_stats()
1192 diff = master->ecc_stats; in mtd_update_ecc_stats()
1245 struct mtd_info *master = mtd_get_master(mtd); in mtd_panic_write() local
1248 if (!master->_panic_write) in mtd_panic_write()
1256 if (!master->oops_panic_write) in mtd_panic_write()
1257 master->oops_panic_write = true; in mtd_panic_write()
1259 return master->_panic_write(master, mtd_get_master_ofs(mtd, to), len, in mtd_panic_write()
1300 struct mtd_info *master = mtd_get_master(mtd); in mtd_read_oob_std() local
1304 if (master->_read_oob) in mtd_read_oob_std()
1305 ret = master->_read_oob(master, from, ops); in mtd_read_oob_std()
1307 ret = master->_read(master, from, ops->len, &ops->retlen, in mtd_read_oob_std()
1316 struct mtd_info *master = mtd_get_master(mtd); in mtd_write_oob_std() local
1320 if (master->_write_oob) in mtd_write_oob_std()
1321 ret = master->_write_oob(master, to, ops); in mtd_write_oob_std()
1323 ret = master->_write(master, to, ops->len, &ops->retlen, in mtd_write_oob_std()
1332 struct mtd_info *master = mtd_get_master(mtd); in mtd_io_emulated_slc() local
1333 int ngroups = mtd_pairing_groups(master); in mtd_io_emulated_slc()
1334 int npairs = mtd_wunit_per_eb(master) / ngroups; in mtd_io_emulated_slc()
1343 base = (loff_t)mtd_div_by_eb(start, mtd) * master->erasesize; in mtd_io_emulated_slc()
1354 base += master->erasesize; in mtd_io_emulated_slc()
1357 wunit = mtd_pairing_info_to_wunit(master, &info); in mtd_io_emulated_slc()
1394 struct mtd_info *master = mtd_get_master(mtd); in mtd_read_oob() local
1395 struct mtd_ecc_stats old_stats = master->ecc_stats; in mtd_read_oob()
1407 if (!master->_read_oob && (!master->_read || ops->oobbuf)) in mtd_read_oob()
1415 mtd_update_ecc_stats(mtd, master, &old_stats); in mtd_read_oob()
1434 struct mtd_info *master = mtd_get_master(mtd); in mtd_write_oob() local
1449 if (!master->_write_oob && (!master->_write || ops->oobbuf)) in mtd_write_oob()
1478 struct mtd_info *master = mtd_get_master(mtd); in mtd_ooblayout_ecc() local
1482 if (!master || section < 0) in mtd_ooblayout_ecc()
1485 if (!master->ooblayout || !master->ooblayout->ecc) in mtd_ooblayout_ecc()
1488 return master->ooblayout->ecc(master, section, oobecc); in mtd_ooblayout_ecc()
1512 struct mtd_info *master = mtd_get_master(mtd); in mtd_ooblayout_free() local
1516 if (!master || section < 0) in mtd_ooblayout_free()
1519 if (!master->ooblayout || !master->ooblayout->free) in mtd_ooblayout_free()
1522 return master->ooblayout->free(master, section, oobfree); in mtd_ooblayout_free()
1831 struct mtd_info *master = mtd_get_master(mtd); in mtd_get_fact_prot_info() local
1833 if (!master->_get_fact_prot_info) in mtd_get_fact_prot_info()
1837 return master->_get_fact_prot_info(master, len, retlen, buf); in mtd_get_fact_prot_info()
1844 struct mtd_info *master = mtd_get_master(mtd); in mtd_read_fact_prot_reg() local
1847 if (!master->_read_fact_prot_reg) in mtd_read_fact_prot_reg()
1851 return master->_read_fact_prot_reg(master, from, len, retlen, buf); in mtd_read_fact_prot_reg()
1858 struct mtd_info *master = mtd_get_master(mtd); in mtd_get_user_prot_info() local
1860 if (!master->_get_user_prot_info) in mtd_get_user_prot_info()
1864 return master->_get_user_prot_info(master, len, retlen, buf); in mtd_get_user_prot_info()
1871 struct mtd_info *master = mtd_get_master(mtd); in mtd_read_user_prot_reg() local
1874 if (!master->_read_user_prot_reg) in mtd_read_user_prot_reg()
1878 return master->_read_user_prot_reg(master, from, len, retlen, buf); in mtd_read_user_prot_reg()
1885 struct mtd_info *master = mtd_get_master(mtd); in mtd_write_user_prot_reg() local
1889 if (!master->_write_user_prot_reg) in mtd_write_user_prot_reg()
1893 ret = master->_write_user_prot_reg(master, to, len, retlen, buf); in mtd_write_user_prot_reg()
1907 struct mtd_info *master = mtd_get_master(mtd); in mtd_lock_user_prot_reg() local
1909 if (!master->_lock_user_prot_reg) in mtd_lock_user_prot_reg()
1913 return master->_lock_user_prot_reg(master, from, len); in mtd_lock_user_prot_reg()
1920 struct mtd_info *master = mtd_get_master(mtd); in mtd_lock() local
1922 if (!master->_lock) in mtd_lock()
1930 ofs = (loff_t)mtd_div_by_eb(ofs, mtd) * master->erasesize; in mtd_lock()
1931 len = (u64)mtd_div_by_eb(len, mtd) * master->erasesize; in mtd_lock()
1934 return master->_lock(master, mtd_get_master_ofs(mtd, ofs), len); in mtd_lock()
1940 struct mtd_info *master = mtd_get_master(mtd); in mtd_unlock() local
1942 if (!master->_unlock) in mtd_unlock()
1950 ofs = (loff_t)mtd_div_by_eb(ofs, mtd) * master->erasesize; in mtd_unlock()
1951 len = (u64)mtd_div_by_eb(len, mtd) * master->erasesize; in mtd_unlock()
1954 return master->_unlock(master, mtd_get_master_ofs(mtd, ofs), len); in mtd_unlock()
1960 struct mtd_info *master = mtd_get_master(mtd); in mtd_is_locked() local
1962 if (!master->_is_locked) in mtd_is_locked()
1970 ofs = (loff_t)mtd_div_by_eb(ofs, mtd) * master->erasesize; in mtd_is_locked()
1971 len = (u64)mtd_div_by_eb(len, mtd) * master->erasesize; in mtd_is_locked()
1974 return master->_is_locked(master, mtd_get_master_ofs(mtd, ofs), len); in mtd_is_locked()
1980 struct mtd_info *master = mtd_get_master(mtd); in mtd_block_isreserved() local
1984 if (!master->_block_isreserved) in mtd_block_isreserved()
1988 ofs = (loff_t)mtd_div_by_eb(ofs, mtd) * master->erasesize; in mtd_block_isreserved()
1990 return master->_block_isreserved(master, mtd_get_master_ofs(mtd, ofs)); in mtd_block_isreserved()
1996 struct mtd_info *master = mtd_get_master(mtd); in mtd_block_isbad() local
2000 if (!master->_block_isbad) in mtd_block_isbad()
2004 ofs = (loff_t)mtd_div_by_eb(ofs, mtd) * master->erasesize; in mtd_block_isbad()
2006 return master->_block_isbad(master, mtd_get_master_ofs(mtd, ofs)); in mtd_block_isbad()
2012 struct mtd_info *master = mtd_get_master(mtd); in mtd_block_markbad() local
2015 if (!master->_block_markbad) in mtd_block_markbad()
2023 ofs = (loff_t)mtd_div_by_eb(ofs, mtd) * master->erasesize; in mtd_block_markbad()
2025 ret = master->_block_markbad(master, mtd_get_master_ofs(mtd, ofs)); in mtd_block_markbad()
2084 struct mtd_info *master = mtd_get_master(mtd); in mtd_writev() local
2090 if (!master->_writev) in mtd_writev()
2093 return master->_writev(master, vecs, count, in mtd_writev()