mtd                31 arch/arm/include/asm/mach/flash.h 	void		(*mmcontrol)(struct mtd_info *mtd, int sync_read);
mtd               757 arch/arm/mach-pxa/spitz.c static int akita_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               785 arch/arm/mach-pxa/spitz.c static int akita_ooblayout_free(struct mtd_info *mtd, int section,
mtd              1779 drivers/block/skd_main.c 	u32 mtd;
mtd              1805 drivers/block/skd_main.c 		mtd = FIT_MXD_CONS(FIT_MTD_FITFW_INIT, 0, 0);
mtd              1806 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
mtd              1807 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
mtd              1923 drivers/block/skd_main.c 	u32 mtd;
mtd              1948 drivers/block/skd_main.c 		mtd = FIT_MXD_CONS(FIT_MTD_GET_CMDQ_DEPTH, 0, 0);
mtd              1949 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
mtd              1950 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
mtd              1955 drivers/block/skd_main.c 		mtd = FIT_MXD_CONS(FIT_MTD_SET_COMPQ_DEPTH, 0,
mtd              1957 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
mtd              1958 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
mtd              1963 drivers/block/skd_main.c 		mtd = FIT_MXD_CONS(FIT_MTD_SET_COMPQ_ADDR, 0, 0);
mtd              1964 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
mtd              1965 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
mtd              1970 drivers/block/skd_main.c 		mtd = FIT_MXD_CONS(FIT_MTD_CMD_LOG_HOST_ID, 0, skdev->devno);
mtd              1971 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
mtd              1972 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
mtd              1979 drivers/block/skd_main.c 		mtd = FIT_MXD_CONS(FIT_MTD_CMD_LOG_TIME_STAMP_LO, 0, data);
mtd              1980 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
mtd              1981 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
mtd              1987 drivers/block/skd_main.c 		mtd = FIT_MXD_CONS(FIT_MTD_CMD_LOG_TIME_STAMP_HI, 0, data);
mtd              1988 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
mtd              1989 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
mtd              1994 drivers/block/skd_main.c 		mtd = FIT_MXD_CONS(FIT_MTD_ARM_QUEUE, 0, 0);
mtd              1995 drivers/block/skd_main.c 		SKD_WRITEL(skdev, mtd, FIT_MSG_TO_DEVICE);
mtd              1996 drivers/block/skd_main.c 		skdev->last_mtd = mtd;
mtd               137 drivers/firmware/broadcom/bcm47xx_nvram.c 	struct mtd_info *mtd;
mtd               142 drivers/firmware/broadcom/bcm47xx_nvram.c 	mtd = get_mtd_device_nm("nvram");
mtd               143 drivers/firmware/broadcom/bcm47xx_nvram.c 	if (IS_ERR(mtd))
mtd               146 drivers/firmware/broadcom/bcm47xx_nvram.c 	err = mtd_read(mtd, 0, sizeof(header), &bytes_read, (uint8_t *)&header);
mtd               156 drivers/firmware/broadcom/bcm47xx_nvram.c 		err = mtd_read(mtd, 0, nvram_len, &nvram_len,
mtd               287 drivers/media/pci/cobalt/cobalt-driver.h 	struct mtd_info *mtd;
mtd                88 drivers/media/pci/cobalt/cobalt-flash.c 	struct mtd_info *mtd;
mtd                97 drivers/media/pci/cobalt/cobalt-flash.c 	mtd = do_map_probe("cfi_probe", map);
mtd                98 drivers/media/pci/cobalt/cobalt-flash.c 	cobalt->mtd = mtd;
mtd                99 drivers/media/pci/cobalt/cobalt-flash.c 	if (!mtd) {
mtd               104 drivers/media/pci/cobalt/cobalt-flash.c 	mtd->owner = THIS_MODULE;
mtd               105 drivers/media/pci/cobalt/cobalt-flash.c 	mtd->dev.parent = &cobalt->pci_dev->dev;
mtd               106 drivers/media/pci/cobalt/cobalt-flash.c 	mtd_device_register(mtd, NULL, 0);
mtd               112 drivers/media/pci/cobalt/cobalt-flash.c 	if (cobalt->mtd) {
mtd               113 drivers/media/pci/cobalt/cobalt-flash.c 		mtd_device_unregister(cobalt->mtd);
mtd               114 drivers/media/pci/cobalt/cobalt-flash.c 		map_destroy(cobalt->mtd);
mtd                68 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd                69 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd                70 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_is_locked(struct mtd_info *mtd, loff_t ofs,
mtd                93 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_point (struct mtd_info *mtd, loff_t from, size_t len,
mtd                95 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_unpoint(struct mtd_info *mtd, loff_t from, size_t len);
mtd               170 drivers/mtd/chips/cfi_cmdset_0001.c static void fixup_convert_atmel_pri(struct mtd_info *mtd)
mtd               172 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd               210 drivers/mtd/chips/cfi_cmdset_0001.c static void fixup_at49bv640dx_lock(struct mtd_info *mtd)
mtd               212 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd               217 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->flags |= MTD_POWERUP_LOCK;
mtd               222 drivers/mtd/chips/cfi_cmdset_0001.c static void fixup_intel_strataflash(struct mtd_info *mtd)
mtd               224 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd               235 drivers/mtd/chips/cfi_cmdset_0001.c static void fixup_no_write_suspend(struct mtd_info *mtd)
mtd               237 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd               248 drivers/mtd/chips/cfi_cmdset_0001.c static void fixup_st_m28w320ct(struct mtd_info *mtd)
mtd               250 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd               257 drivers/mtd/chips/cfi_cmdset_0001.c static void fixup_st_m28w320cb(struct mtd_info *mtd)
mtd               259 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd               277 drivers/mtd/chips/cfi_cmdset_0001.c static void fixup_LH28F640BF(struct mtd_info *mtd)
mtd               279 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd               297 drivers/mtd/chips/cfi_cmdset_0001.c static void fixup_use_point(struct mtd_info *mtd)
mtd               299 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd               300 drivers/mtd/chips/cfi_cmdset_0001.c 	if (!mtd->_point && map_is_linear(map)) {
mtd               301 drivers/mtd/chips/cfi_cmdset_0001.c 		mtd->_point   = cfi_intelext_point;
mtd               302 drivers/mtd/chips/cfi_cmdset_0001.c 		mtd->_unpoint = cfi_intelext_unpoint;
mtd               306 drivers/mtd/chips/cfi_cmdset_0001.c static void fixup_use_write_buffers(struct mtd_info *mtd)
mtd               308 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd               312 drivers/mtd/chips/cfi_cmdset_0001.c 		mtd->_write = cfi_intelext_write_buffers;
mtd               313 drivers/mtd/chips/cfi_cmdset_0001.c 		mtd->_writev = cfi_intelext_writev;
mtd               320 drivers/mtd/chips/cfi_cmdset_0001.c static void fixup_unlock_powerup_lock(struct mtd_info *mtd)
mtd               322 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd               328 drivers/mtd/chips/cfi_cmdset_0001.c 		mtd->flags |= MTD_POWERUP_LOCK;
mtd               482 drivers/mtd/chips/cfi_cmdset_0001.c 	struct mtd_info *mtd;
mtd               485 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
mtd               486 drivers/mtd/chips/cfi_cmdset_0001.c 	if (!mtd)
mtd               488 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->priv = map;
mtd               489 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->type = MTD_NORFLASH;
mtd               492 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_erase   = cfi_intelext_erase_varsize;
mtd               493 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_read    = cfi_intelext_read;
mtd               494 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_write   = cfi_intelext_write_words;
mtd               495 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_sync    = cfi_intelext_sync;
mtd               496 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_lock    = cfi_intelext_lock;
mtd               497 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_unlock  = cfi_intelext_unlock;
mtd               498 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_is_locked = cfi_intelext_is_locked;
mtd               499 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_suspend = cfi_intelext_suspend;
mtd               500 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_resume  = cfi_intelext_resume;
mtd               501 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->flags   = MTD_CAP_NORFLASH;
mtd               502 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->name    = map->name;
mtd               503 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->writesize = 1;
mtd               504 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->writebufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
mtd               506 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->reboot_notifier.notifier_call = cfi_intelext_reboot;
mtd               519 drivers/mtd/chips/cfi_cmdset_0001.c 			kfree(mtd);
mtd               526 drivers/mtd/chips/cfi_cmdset_0001.c 		cfi_fixup(mtd, cfi_fixup_table);
mtd               539 drivers/mtd/chips/cfi_cmdset_0001.c 		cfi_fixup(mtd, jedec_fixup_table);
mtd               542 drivers/mtd/chips/cfi_cmdset_0001.c 	cfi_fixup(mtd, fixup_table);
mtd               590 drivers/mtd/chips/cfi_cmdset_0001.c 	return cfi_intelext_setup(mtd);
mtd               598 drivers/mtd/chips/cfi_cmdset_0001.c static struct mtd_info *cfi_intelext_setup(struct mtd_info *mtd)
mtd               600 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd               608 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->size = devsize * cfi->numchips;
mtd               610 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips;
mtd               611 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->eraseregions = kcalloc(mtd->numeraseregions,
mtd               614 drivers/mtd/chips/cfi_cmdset_0001.c 	if (!mtd->eraseregions)
mtd               622 drivers/mtd/chips/cfi_cmdset_0001.c 		if (mtd->erasesize < ersize) {
mtd               623 drivers/mtd/chips/cfi_cmdset_0001.c 			mtd->erasesize = ersize;
mtd               626 drivers/mtd/chips/cfi_cmdset_0001.c 			mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].offset = (j*devsize)+offset;
mtd               627 drivers/mtd/chips/cfi_cmdset_0001.c 			mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].erasesize = ersize;
mtd               628 drivers/mtd/chips/cfi_cmdset_0001.c 			mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].numblocks = ernum;
mtd               629 drivers/mtd/chips/cfi_cmdset_0001.c 			mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].lockmap = kmalloc(ernum / 8 + 1, GFP_KERNEL);
mtd               630 drivers/mtd/chips/cfi_cmdset_0001.c 			if (!mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].lockmap)
mtd               642 drivers/mtd/chips/cfi_cmdset_0001.c 	for (i=0; i<mtd->numeraseregions;i++){
mtd               644 drivers/mtd/chips/cfi_cmdset_0001.c 		       i,(unsigned long long)mtd->eraseregions[i].offset,
mtd               645 drivers/mtd/chips/cfi_cmdset_0001.c 		       mtd->eraseregions[i].erasesize,
mtd               646 drivers/mtd/chips/cfi_cmdset_0001.c 		       mtd->eraseregions[i].numblocks);
mtd               650 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_read_fact_prot_reg = cfi_intelext_read_fact_prot_reg;
mtd               651 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_read_user_prot_reg = cfi_intelext_read_user_prot_reg;
mtd               652 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_write_user_prot_reg = cfi_intelext_write_user_prot_reg;
mtd               653 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_lock_user_prot_reg = cfi_intelext_lock_user_prot_reg;
mtd               654 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_get_fact_prot_info = cfi_intelext_get_fact_prot_info;
mtd               655 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd->_get_user_prot_info = cfi_intelext_get_user_prot_info;
mtd               660 drivers/mtd/chips/cfi_cmdset_0001.c 	if (cfi_intelext_partition_fixup(mtd, &cfi) != 0)
mtd               664 drivers/mtd/chips/cfi_cmdset_0001.c 	register_reboot_notifier(&mtd->reboot_notifier);
mtd               665 drivers/mtd/chips/cfi_cmdset_0001.c 	return mtd;
mtd               668 drivers/mtd/chips/cfi_cmdset_0001.c 	if (mtd->eraseregions)
mtd               671 drivers/mtd/chips/cfi_cmdset_0001.c 				kfree(mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].lockmap);
mtd               672 drivers/mtd/chips/cfi_cmdset_0001.c 	kfree(mtd->eraseregions);
mtd               673 drivers/mtd/chips/cfi_cmdset_0001.c 	kfree(mtd);
mtd               678 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_partition_fixup(struct mtd_info *mtd,
mtd               681 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd               736 drivers/mtd/chips/cfi_cmdset_0001.c 			mtd->writesize = cfi->interleave << prinfo->ProgRegShift;
mtd               737 drivers/mtd/chips/cfi_cmdset_0001.c 			mtd->flags &= ~MTD_BIT_WRITEABLE;
mtd               739 drivers/mtd/chips/cfi_cmdset_0001.c 			       map->name, mtd->writesize,
mtd               751 drivers/mtd/chips/cfi_cmdset_0001.c 		if ((1 << partshift) < mtd->erasesize) {
mtd              1379 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_point(struct mtd_info *mtd, loff_t from, size_t len,
mtd              1382 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd              1432 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
mtd              1434 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd              1511 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
mtd              1513 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd              1623 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_write_words (struct mtd_info *mtd, loff_t to , size_t len, size_t *retlen, const u_char *buf)
mtd              1625 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd              1868 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_writev (struct mtd_info *mtd, const struct kvec *vecs,
mtd              1871 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd              1920 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_write_buffers (struct mtd_info *mtd, loff_t to,
mtd              1928 drivers/mtd/chips/cfi_cmdset_0001.c 	return cfi_intelext_writev(mtd, &vec, 1, to, retlen);
mtd              2021 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_erase_varsize(struct mtd_info *mtd, struct erase_info *instr)
mtd              2023 drivers/mtd/chips/cfi_cmdset_0001.c 	return cfi_varsize_frob(mtd, do_erase_oneblock, instr->addr,
mtd              2027 drivers/mtd/chips/cfi_cmdset_0001.c static void cfi_intelext_sync (struct mtd_info *mtd)
mtd              2029 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd              2160 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd              2167 drivers/mtd/chips/cfi_cmdset_0001.c 	cfi_varsize_frob(mtd, do_printlockstatus_oneblock,
mtd              2171 drivers/mtd/chips/cfi_cmdset_0001.c 	ret = cfi_varsize_frob(mtd, do_xxlock_oneblock,
mtd              2177 drivers/mtd/chips/cfi_cmdset_0001.c 	cfi_varsize_frob(mtd, do_printlockstatus_oneblock,
mtd              2184 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd              2191 drivers/mtd/chips/cfi_cmdset_0001.c 	cfi_varsize_frob(mtd, do_printlockstatus_oneblock,
mtd              2195 drivers/mtd/chips/cfi_cmdset_0001.c 	ret = cfi_varsize_frob(mtd, do_xxlock_oneblock,
mtd              2201 drivers/mtd/chips/cfi_cmdset_0001.c 	cfi_varsize_frob(mtd, do_printlockstatus_oneblock,
mtd              2208 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_is_locked(struct mtd_info *mtd, loff_t ofs,
mtd              2211 drivers/mtd/chips/cfi_cmdset_0001.c 	return cfi_varsize_frob(mtd, do_getlockstatus_oneblock,
mtd              2295 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_otp_walk(struct mtd_info *mtd, loff_t from, size_t len,
mtd              2299 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd              2429 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_read_fact_prot_reg(struct mtd_info *mtd, loff_t from,
mtd              2433 drivers/mtd/chips/cfi_cmdset_0001.c 	return cfi_intelext_otp_walk(mtd, from, len, retlen,
mtd              2437 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_read_user_prot_reg(struct mtd_info *mtd, loff_t from,
mtd              2441 drivers/mtd/chips/cfi_cmdset_0001.c 	return cfi_intelext_otp_walk(mtd, from, len, retlen,
mtd              2445 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_write_user_prot_reg(struct mtd_info *mtd, loff_t from,
mtd              2449 drivers/mtd/chips/cfi_cmdset_0001.c 	return cfi_intelext_otp_walk(mtd, from, len, retlen,
mtd              2453 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_lock_user_prot_reg(struct mtd_info *mtd,
mtd              2457 drivers/mtd/chips/cfi_cmdset_0001.c 	return cfi_intelext_otp_walk(mtd, from, len, &retlen,
mtd              2461 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_get_fact_prot_info(struct mtd_info *mtd, size_t len,
mtd              2465 drivers/mtd/chips/cfi_cmdset_0001.c 	return cfi_intelext_otp_walk(mtd, 0, len, retlen, (u_char *)buf,
mtd              2469 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_get_user_prot_info(struct mtd_info *mtd, size_t len,
mtd              2472 drivers/mtd/chips/cfi_cmdset_0001.c 	return cfi_intelext_otp_walk(mtd, 0, len, retlen, (u_char *)buf,
mtd              2478 drivers/mtd/chips/cfi_cmdset_0001.c static void cfi_intelext_save_locks(struct mtd_info *mtd)
mtd              2485 drivers/mtd/chips/cfi_cmdset_0001.c 	for (i = 0; i < mtd->numeraseregions; i++) {
mtd              2486 drivers/mtd/chips/cfi_cmdset_0001.c 		region = &mtd->eraseregions[i];
mtd              2494 drivers/mtd/chips/cfi_cmdset_0001.c 			status = cfi_varsize_frob(mtd,
mtd              2504 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_suspend(struct mtd_info *mtd)
mtd              2506 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd              2513 drivers/mtd/chips/cfi_cmdset_0001.c 	if ((mtd->flags & MTD_POWERUP_LOCK)
mtd              2515 drivers/mtd/chips/cfi_cmdset_0001.c 		cfi_intelext_save_locks(mtd);
mtd              2578 drivers/mtd/chips/cfi_cmdset_0001.c static void cfi_intelext_restore_locks(struct mtd_info *mtd)
mtd              2585 drivers/mtd/chips/cfi_cmdset_0001.c 	for (i = 0; i < mtd->numeraseregions; i++) {
mtd              2586 drivers/mtd/chips/cfi_cmdset_0001.c 		region = &mtd->eraseregions[i];
mtd              2593 drivers/mtd/chips/cfi_cmdset_0001.c 			cfi_intelext_unlock(mtd, adr, len);
mtd              2598 drivers/mtd/chips/cfi_cmdset_0001.c static void cfi_intelext_resume(struct mtd_info *mtd)
mtd              2600 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd              2615 drivers/mtd/chips/cfi_cmdset_0001.c 			fixup_LH28F640BF(mtd);
mtd              2624 drivers/mtd/chips/cfi_cmdset_0001.c 	if ((mtd->flags & MTD_POWERUP_LOCK)
mtd              2626 drivers/mtd/chips/cfi_cmdset_0001.c 		cfi_intelext_restore_locks(mtd);
mtd              2629 drivers/mtd/chips/cfi_cmdset_0001.c static int cfi_intelext_reset(struct mtd_info *mtd)
mtd              2631 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd              2657 drivers/mtd/chips/cfi_cmdset_0001.c 	struct mtd_info *mtd;
mtd              2659 drivers/mtd/chips/cfi_cmdset_0001.c 	mtd = container_of(nb, struct mtd_info, reboot_notifier);
mtd              2660 drivers/mtd/chips/cfi_cmdset_0001.c 	cfi_intelext_reset(mtd);
mtd              2664 drivers/mtd/chips/cfi_cmdset_0001.c static void cfi_intelext_destroy(struct mtd_info *mtd)
mtd              2666 drivers/mtd/chips/cfi_cmdset_0001.c 	struct map_info *map = mtd->priv;
mtd              2670 drivers/mtd/chips/cfi_cmdset_0001.c 	cfi_intelext_reset(mtd);
mtd              2671 drivers/mtd/chips/cfi_cmdset_0001.c 	unregister_reboot_notifier(&mtd->reboot_notifier);
mtd              2676 drivers/mtd/chips/cfi_cmdset_0001.c 	for (i = 0; i < mtd->numeraseregions; i++) {
mtd              2677 drivers/mtd/chips/cfi_cmdset_0001.c 		region = &mtd->eraseregions[i];
mtd              2680 drivers/mtd/chips/cfi_cmdset_0001.c 	kfree(mtd->eraseregions);
mtd                86 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd                98 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_atmel_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd                99 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_atmel_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd               101 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_ppb_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd               102 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd               103 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_ppb_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd               221 drivers/mtd/chips/cfi_cmdset_0002.c static void fixup_amd_bootblock(struct mtd_info *mtd)
mtd               223 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd               271 drivers/mtd/chips/cfi_cmdset_0002.c static void fixup_use_write_buffers(struct mtd_info *mtd)
mtd               273 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd               277 drivers/mtd/chips/cfi_cmdset_0002.c 		mtd->_write = cfi_amdstd_write_buffers;
mtd               283 drivers/mtd/chips/cfi_cmdset_0002.c static void fixup_convert_atmel_pri(struct mtd_info *mtd)
mtd               285 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd               314 drivers/mtd/chips/cfi_cmdset_0002.c static void fixup_use_secsi(struct mtd_info *mtd)
mtd               317 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_read_user_prot_reg = cfi_amdstd_secsi_read;
mtd               318 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_read_fact_prot_reg = cfi_amdstd_secsi_read;
mtd               321 drivers/mtd/chips/cfi_cmdset_0002.c static void fixup_use_erase_chip(struct mtd_info *mtd)
mtd               323 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd               327 drivers/mtd/chips/cfi_cmdset_0002.c 		mtd->_erase = cfi_amdstd_erase_chip;
mtd               336 drivers/mtd/chips/cfi_cmdset_0002.c static void fixup_use_atmel_lock(struct mtd_info *mtd)
mtd               338 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_lock = cfi_atmel_lock;
mtd               339 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_unlock = cfi_atmel_unlock;
mtd               340 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->flags |= MTD_POWERUP_LOCK;
mtd               343 drivers/mtd/chips/cfi_cmdset_0002.c static void fixup_old_sst_eraseregion(struct mtd_info *mtd)
mtd               345 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd               357 drivers/mtd/chips/cfi_cmdset_0002.c static void fixup_sst39vf(struct mtd_info *mtd)
mtd               359 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd               362 drivers/mtd/chips/cfi_cmdset_0002.c 	fixup_old_sst_eraseregion(mtd);
mtd               368 drivers/mtd/chips/cfi_cmdset_0002.c static void fixup_sst39vf_rev_b(struct mtd_info *mtd)
mtd               370 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd               373 drivers/mtd/chips/cfi_cmdset_0002.c 	fixup_old_sst_eraseregion(mtd);
mtd               381 drivers/mtd/chips/cfi_cmdset_0002.c static void fixup_sst38vf640x_sectorsize(struct mtd_info *mtd)
mtd               383 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd               386 drivers/mtd/chips/cfi_cmdset_0002.c 	fixup_sst39vf_rev_b(mtd);
mtd               394 drivers/mtd/chips/cfi_cmdset_0002.c 		mtd->name);
mtd               397 drivers/mtd/chips/cfi_cmdset_0002.c static void fixup_s29gl064n_sectors(struct mtd_info *mtd)
mtd               399 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd               405 drivers/mtd/chips/cfi_cmdset_0002.c 			mtd->name);
mtd               409 drivers/mtd/chips/cfi_cmdset_0002.c static void fixup_s29gl032n_sectors(struct mtd_info *mtd)
mtd               411 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd               417 drivers/mtd/chips/cfi_cmdset_0002.c 			mtd->name);
mtd               421 drivers/mtd/chips/cfi_cmdset_0002.c static void fixup_s29ns512p_sectors(struct mtd_info *mtd)
mtd               423 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd               432 drivers/mtd/chips/cfi_cmdset_0002.c 		mtd->name);
mtd               587 drivers/mtd/chips/cfi_cmdset_0002.c 	struct mtd_info *mtd;
mtd               590 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
mtd               591 drivers/mtd/chips/cfi_cmdset_0002.c 	if (!mtd)
mtd               593 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->priv = map;
mtd               594 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->type = MTD_NORFLASH;
mtd               597 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_erase   = cfi_amdstd_erase_varsize;
mtd               598 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_write   = cfi_amdstd_write_words;
mtd               599 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_read    = cfi_amdstd_read;
mtd               600 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_sync    = cfi_amdstd_sync;
mtd               601 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_suspend = cfi_amdstd_suspend;
mtd               602 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_resume  = cfi_amdstd_resume;
mtd               603 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_read_user_prot_reg = cfi_amdstd_read_user_prot_reg;
mtd               604 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_read_fact_prot_reg = cfi_amdstd_read_fact_prot_reg;
mtd               605 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_get_fact_prot_info = cfi_amdstd_get_fact_prot_info;
mtd               606 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_get_user_prot_info = cfi_amdstd_get_user_prot_info;
mtd               607 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_write_user_prot_reg = cfi_amdstd_write_user_prot_reg;
mtd               608 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_lock_user_prot_reg = cfi_amdstd_lock_user_prot_reg;
mtd               609 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->flags   = MTD_CAP_NORFLASH;
mtd               610 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->name    = map->name;
mtd               611 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->writesize = 1;
mtd               612 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->writebufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
mtd               615 drivers/mtd/chips/cfi_cmdset_0002.c 			mtd->writebufsize);
mtd               617 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->_panic_write = cfi_amdstd_panic_write;
mtd               618 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->reboot_notifier.notifier_call = cfi_amdstd_reboot;
mtd               647 drivers/mtd/chips/cfi_cmdset_0002.c 				kfree(mtd);
mtd               658 drivers/mtd/chips/cfi_cmdset_0002.c 			cfi_fixup(mtd, cfi_fixup_table);
mtd               670 drivers/mtd/chips/cfi_cmdset_0002.c 				mtd->_lock = cfi_ppb_lock;
mtd               671 drivers/mtd/chips/cfi_cmdset_0002.c 				mtd->_unlock = cfi_ppb_unlock;
mtd               672 drivers/mtd/chips/cfi_cmdset_0002.c 				mtd->_is_locked = cfi_ppb_is_locked;
mtd               698 drivers/mtd/chips/cfi_cmdset_0002.c 		cfi_fixup(mtd, cfi_nopri_fixup_table);
mtd               701 drivers/mtd/chips/cfi_cmdset_0002.c 			kfree(mtd);
mtd               708 drivers/mtd/chips/cfi_cmdset_0002.c 		cfi_fixup(mtd, jedec_fixup_table);
mtd               711 drivers/mtd/chips/cfi_cmdset_0002.c 	cfi_fixup(mtd, fixup_table);
mtd               740 drivers/mtd/chips/cfi_cmdset_0002.c 	return cfi_amdstd_setup(mtd);
mtd               748 drivers/mtd/chips/cfi_cmdset_0002.c static struct mtd_info *cfi_amdstd_setup(struct mtd_info *mtd)
mtd               750 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd               759 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->size = devsize * cfi->numchips;
mtd               761 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips;
mtd               762 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd->eraseregions = kmalloc_array(mtd->numeraseregions,
mtd               765 drivers/mtd/chips/cfi_cmdset_0002.c 	if (!mtd->eraseregions)
mtd               773 drivers/mtd/chips/cfi_cmdset_0002.c 		if (mtd->erasesize < ersize) {
mtd               774 drivers/mtd/chips/cfi_cmdset_0002.c 			mtd->erasesize = ersize;
mtd               777 drivers/mtd/chips/cfi_cmdset_0002.c 			mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].offset = (j*devsize)+offset;
mtd               778 drivers/mtd/chips/cfi_cmdset_0002.c 			mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].erasesize = ersize;
mtd               779 drivers/mtd/chips/cfi_cmdset_0002.c 			mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].numblocks = ernum;
mtd               790 drivers/mtd/chips/cfi_cmdset_0002.c 	register_reboot_notifier(&mtd->reboot_notifier);
mtd               791 drivers/mtd/chips/cfi_cmdset_0002.c 	return mtd;
mtd               794 drivers/mtd/chips/cfi_cmdset_0002.c 	kfree(mtd->eraseregions);
mtd               795 drivers/mtd/chips/cfi_cmdset_0002.c 	kfree(mtd);
mtd              1240 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
mtd              1242 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd              1348 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_secsi_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
mtd              1350 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd              1485 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_otp_walk(struct mtd_info *mtd, loff_t from, size_t len,
mtd              1489 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd              1603 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_get_fact_prot_info(struct mtd_info *mtd, size_t len,
mtd              1606 drivers/mtd/chips/cfi_cmdset_0002.c 	return cfi_amdstd_otp_walk(mtd, 0, len, retlen, (u_char *)buf,
mtd              1610 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_get_user_prot_info(struct mtd_info *mtd, size_t len,
mtd              1613 drivers/mtd/chips/cfi_cmdset_0002.c 	return cfi_amdstd_otp_walk(mtd, 0, len, retlen, (u_char *)buf,
mtd              1617 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from,
mtd              1621 drivers/mtd/chips/cfi_cmdset_0002.c 	return cfi_amdstd_otp_walk(mtd, from, len, retlen,
mtd              1625 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_read_user_prot_reg(struct mtd_info *mtd, loff_t from,
mtd              1629 drivers/mtd/chips/cfi_cmdset_0002.c 	return cfi_amdstd_otp_walk(mtd, from, len, retlen,
mtd              1633 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_write_user_prot_reg(struct mtd_info *mtd, loff_t from,
mtd              1637 drivers/mtd/chips/cfi_cmdset_0002.c 	return cfi_amdstd_otp_walk(mtd, from, len, retlen, buf,
mtd              1641 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
mtd              1645 drivers/mtd/chips/cfi_cmdset_0002.c 	return cfi_amdstd_otp_walk(mtd, from, len, &retlen, NULL,
mtd              1820 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_write_words(struct mtd_info *mtd, loff_t to, size_t len,
mtd              1823 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd              2100 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
mtd              2103 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd              2118 drivers/mtd/chips/cfi_cmdset_0002.c 		ret = cfi_amdstd_write_words(mtd, ofs + (chipnum<<cfi->chipshift),
mtd              2165 drivers/mtd/chips/cfi_cmdset_0002.c 		ret = cfi_amdstd_write_words(mtd, ofs + (chipnum<<cfi->chipshift),
mtd              2312 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd              2315 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd              2614 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_erase_varsize(struct mtd_info *mtd, struct erase_info *instr)
mtd              2616 drivers/mtd/chips/cfi_cmdset_0002.c 	return cfi_varsize_frob(mtd, do_erase_oneblock, instr->addr,
mtd              2621 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_erase_chip(struct mtd_info *mtd, struct erase_info *instr)
mtd              2623 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd              2629 drivers/mtd/chips/cfi_cmdset_0002.c 	if (instr->len != mtd->size)
mtd              2697 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_atmel_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd              2699 drivers/mtd/chips/cfi_cmdset_0002.c 	return cfi_varsize_frob(mtd, do_atmel_lock, ofs, len, NULL);
mtd              2702 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_atmel_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd              2704 drivers/mtd/chips/cfi_cmdset_0002.c 	return cfi_varsize_frob(mtd, do_atmel_unlock, ofs, len, NULL);
mtd              2794 drivers/mtd/chips/cfi_cmdset_0002.c static int __maybe_unused cfi_ppb_lock(struct mtd_info *mtd, loff_t ofs,
mtd              2797 drivers/mtd/chips/cfi_cmdset_0002.c 	return cfi_varsize_frob(mtd, do_ppb_xxlock, ofs, len,
mtd              2801 drivers/mtd/chips/cfi_cmdset_0002.c static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs,
mtd              2804 drivers/mtd/chips/cfi_cmdset_0002.c 	struct mtd_erase_region_info *regions = mtd->eraseregions;
mtd              2805 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd              2824 drivers/mtd/chips/cfi_cmdset_0002.c 	for (i = 0; i < mtd->numeraseregions; i++)
mtd              2840 drivers/mtd/chips/cfi_cmdset_0002.c 	length = mtd->size;
mtd              2885 drivers/mtd/chips/cfi_cmdset_0002.c 	ret = cfi_varsize_frob(mtd, do_ppb_xxlock, ofs, len,
mtd              2906 drivers/mtd/chips/cfi_cmdset_0002.c static int __maybe_unused cfi_ppb_is_locked(struct mtd_info *mtd, loff_t ofs,
mtd              2909 drivers/mtd/chips/cfi_cmdset_0002.c 	return cfi_varsize_frob(mtd, do_ppb_xxlock, ofs, len,
mtd              2913 drivers/mtd/chips/cfi_cmdset_0002.c static void cfi_amdstd_sync (struct mtd_info *mtd)
mtd              2915 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd              2975 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_suspend(struct mtd_info *mtd)
mtd              2977 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd              3029 drivers/mtd/chips/cfi_cmdset_0002.c static void cfi_amdstd_resume(struct mtd_info *mtd)
mtd              3031 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd              3061 drivers/mtd/chips/cfi_cmdset_0002.c static int cfi_amdstd_reset(struct mtd_info *mtd)
mtd              3063 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd              3091 drivers/mtd/chips/cfi_cmdset_0002.c 	struct mtd_info *mtd;
mtd              3093 drivers/mtd/chips/cfi_cmdset_0002.c 	mtd = container_of(nb, struct mtd_info, reboot_notifier);
mtd              3094 drivers/mtd/chips/cfi_cmdset_0002.c 	cfi_amdstd_reset(mtd);
mtd              3099 drivers/mtd/chips/cfi_cmdset_0002.c static void cfi_amdstd_destroy(struct mtd_info *mtd)
mtd              3101 drivers/mtd/chips/cfi_cmdset_0002.c 	struct map_info *map = mtd->priv;
mtd              3104 drivers/mtd/chips/cfi_cmdset_0002.c 	cfi_amdstd_reset(mtd);
mtd              3105 drivers/mtd/chips/cfi_cmdset_0002.c 	unregister_reboot_notifier(&mtd->reboot_notifier);
mtd              3109 drivers/mtd/chips/cfi_cmdset_0002.c 	kfree(mtd->eraseregions);
mtd                39 drivers/mtd/chips/cfi_cmdset_0020.c static int cfi_staa_writev(struct mtd_info *mtd, const struct kvec *vecs,
mtd                43 drivers/mtd/chips/cfi_cmdset_0020.c static int cfi_staa_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd                44 drivers/mtd/chips/cfi_cmdset_0020.c static int cfi_staa_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd               169 drivers/mtd/chips/cfi_cmdset_0020.c 	struct mtd_info *mtd;
mtd               174 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
mtd               177 drivers/mtd/chips/cfi_cmdset_0020.c 	if (!mtd) {
mtd               182 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->priv = map;
mtd               183 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->type = MTD_NORFLASH;
mtd               184 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->size = devsize * cfi->numchips;
mtd               186 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips;
mtd               187 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->eraseregions = kmalloc_array(mtd->numeraseregions,
mtd               190 drivers/mtd/chips/cfi_cmdset_0020.c 	if (!mtd->eraseregions) {
mtd               192 drivers/mtd/chips/cfi_cmdset_0020.c 		kfree(mtd);
mtd               201 drivers/mtd/chips/cfi_cmdset_0020.c 		if (mtd->erasesize < ersize) {
mtd               202 drivers/mtd/chips/cfi_cmdset_0020.c 			mtd->erasesize = ersize;
mtd               205 drivers/mtd/chips/cfi_cmdset_0020.c 			mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].offset = (j*devsize)+offset;
mtd               206 drivers/mtd/chips/cfi_cmdset_0020.c 			mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].erasesize = ersize;
mtd               207 drivers/mtd/chips/cfi_cmdset_0020.c 			mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].numblocks = ernum;
mtd               215 drivers/mtd/chips/cfi_cmdset_0020.c 		kfree(mtd->eraseregions);
mtd               217 drivers/mtd/chips/cfi_cmdset_0020.c 		kfree(mtd);
mtd               221 drivers/mtd/chips/cfi_cmdset_0020.c 	for (i=0; i<mtd->numeraseregions;i++){
mtd               223 drivers/mtd/chips/cfi_cmdset_0020.c 		       i, (unsigned long long)mtd->eraseregions[i].offset,
mtd               224 drivers/mtd/chips/cfi_cmdset_0020.c 		       mtd->eraseregions[i].erasesize,
mtd               225 drivers/mtd/chips/cfi_cmdset_0020.c 		       mtd->eraseregions[i].numblocks);
mtd               229 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->_erase = cfi_staa_erase_varsize;
mtd               230 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->_read = cfi_staa_read;
mtd               231 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->_write = cfi_staa_write_buffers;
mtd               232 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->_writev = cfi_staa_writev;
mtd               233 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->_sync = cfi_staa_sync;
mtd               234 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->_lock = cfi_staa_lock;
mtd               235 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->_unlock = cfi_staa_unlock;
mtd               236 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->_suspend = cfi_staa_suspend;
mtd               237 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->_resume = cfi_staa_resume;
mtd               238 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->flags = MTD_CAP_NORFLASH & ~MTD_BIT_WRITEABLE;
mtd               239 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->writesize = 8; /* FIXME: Should be 0 for STMicro flashes w/out ECC */
mtd               240 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->writebufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
mtd               243 drivers/mtd/chips/cfi_cmdset_0020.c 	mtd->name = map->name;
mtd               244 drivers/mtd/chips/cfi_cmdset_0020.c 	return mtd;
mtd               384 drivers/mtd/chips/cfi_cmdset_0020.c static int cfi_staa_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
mtd               386 drivers/mtd/chips/cfi_cmdset_0020.c 	struct map_info *map = mtd->priv;
mtd               608 drivers/mtd/chips/cfi_cmdset_0020.c static int cfi_staa_write_buffers (struct mtd_info *mtd, loff_t to,
mtd               611 drivers/mtd/chips/cfi_cmdset_0020.c 	struct map_info *map = mtd->priv;
mtd               661 drivers/mtd/chips/cfi_cmdset_0020.c #define ECCBUF_SIZE (mtd->writesize)
mtd               665 drivers/mtd/chips/cfi_cmdset_0020.c cfi_staa_writev(struct mtd_info *mtd, const struct kvec *vecs,
mtd               696 drivers/mtd/chips/cfi_cmdset_0020.c 			ret = mtd_write(mtd, to, ECCBUF_SIZE, &thislen,
mtd               706 drivers/mtd/chips/cfi_cmdset_0020.c 			ret = mtd_write(mtd, to, ECCBUF_DIV(elem_len),
mtd               721 drivers/mtd/chips/cfi_cmdset_0020.c 		ret = mtd_write(mtd, to, buflen, &thislen, buffer);
mtd               893 drivers/mtd/chips/cfi_cmdset_0020.c static int cfi_staa_erase_varsize(struct mtd_info *mtd,
mtd               895 drivers/mtd/chips/cfi_cmdset_0020.c {	struct map_info *map = mtd->priv;
mtd               900 drivers/mtd/chips/cfi_cmdset_0020.c 	struct mtd_erase_region_info *regions = mtd->eraseregions;
mtd               914 drivers/mtd/chips/cfi_cmdset_0020.c 	while (i < mtd->numeraseregions && instr->addr >= regions[i].offset)
mtd               934 drivers/mtd/chips/cfi_cmdset_0020.c 	while (i<mtd->numeraseregions && (instr->addr + instr->len) >= regions[i].offset)
mtd               975 drivers/mtd/chips/cfi_cmdset_0020.c static void cfi_staa_sync (struct mtd_info *mtd)
mtd               977 drivers/mtd/chips/cfi_cmdset_0020.c 	struct map_info *map = mtd->priv;
mtd              1130 drivers/mtd/chips/cfi_cmdset_0020.c static int cfi_staa_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd              1132 drivers/mtd/chips/cfi_cmdset_0020.c 	struct map_info *map = mtd->priv;
mtd              1140 drivers/mtd/chips/cfi_cmdset_0020.c 	if (ofs & (mtd->erasesize - 1))
mtd              1143 drivers/mtd/chips/cfi_cmdset_0020.c 	if (len & (mtd->erasesize -1))
mtd              1168 drivers/mtd/chips/cfi_cmdset_0020.c 		adr += mtd->erasesize;
mtd              1169 drivers/mtd/chips/cfi_cmdset_0020.c 		len -= mtd->erasesize;
mtd              1277 drivers/mtd/chips/cfi_cmdset_0020.c static int cfi_staa_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd              1279 drivers/mtd/chips/cfi_cmdset_0020.c 	struct map_info *map = mtd->priv;
mtd              1298 drivers/mtd/chips/cfi_cmdset_0020.c 			temp_adr += mtd->erasesize;
mtd              1299 drivers/mtd/chips/cfi_cmdset_0020.c 			temp_len -= mtd->erasesize;
mtd              1316 drivers/mtd/chips/cfi_cmdset_0020.c static int cfi_staa_suspend(struct mtd_info *mtd)
mtd              1318 drivers/mtd/chips/cfi_cmdset_0020.c 	struct map_info *map = mtd->priv;
mtd              1372 drivers/mtd/chips/cfi_cmdset_0020.c static void cfi_staa_resume(struct mtd_info *mtd)
mtd              1374 drivers/mtd/chips/cfi_cmdset_0020.c 	struct map_info *map = mtd->priv;
mtd              1396 drivers/mtd/chips/cfi_cmdset_0020.c static void cfi_staa_destroy(struct mtd_info *mtd)
mtd              1398 drivers/mtd/chips/cfi_cmdset_0020.c 	struct map_info *map = mtd->priv;
mtd               342 drivers/mtd/chips/cfi_util.c void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup *fixups)
mtd               344 drivers/mtd/chips/cfi_util.c 	struct map_info *map = mtd->priv;
mtd               351 drivers/mtd/chips/cfi_util.c 			f->fixup(mtd);
mtd               358 drivers/mtd/chips/cfi_util.c int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob,
mtd               361 drivers/mtd/chips/cfi_util.c 	struct map_info *map = mtd->priv;
mtd               366 drivers/mtd/chips/cfi_util.c 	struct mtd_erase_region_info *regions = mtd->eraseregions;
mtd               380 drivers/mtd/chips/cfi_util.c 	while (i < mtd->numeraseregions && ofs >= regions[i].offset)
mtd               400 drivers/mtd/chips/cfi_util.c 	while (i<mtd->numeraseregions && (ofs + len) >= regions[i].offset)
mtd                86 drivers/mtd/chips/chipreg.c void map_destroy(struct mtd_info *mtd)
mtd                88 drivers/mtd/chips/chipreg.c 	struct map_info *map = mtd->priv;
mtd                91 drivers/mtd/chips/chipreg.c 		map->fldrv->destroy(mtd);
mtd                95 drivers/mtd/chips/chipreg.c 	kfree(mtd);
mtd                80 drivers/mtd/chips/fwh_lock.h static int fwh_lock_varsize(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd                84 drivers/mtd/chips/fwh_lock.h 	ret = cfi_varsize_frob(mtd, fwh_xxlock_oneblock, ofs, len,
mtd                91 drivers/mtd/chips/fwh_lock.h static int fwh_unlock_varsize(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd                95 drivers/mtd/chips/fwh_lock.h 	ret = cfi_varsize_frob(mtd, fwh_xxlock_oneblock, ofs, len,
mtd               101 drivers/mtd/chips/fwh_lock.h static void fixup_use_fwh_lock(struct mtd_info *mtd)
mtd               105 drivers/mtd/chips/fwh_lock.h 	mtd->_lock   = fwh_lock_varsize;
mtd               106 drivers/mtd/chips/fwh_lock.h 	mtd->_unlock = fwh_unlock_varsize;
mtd                23 drivers/mtd/chips/gen_probe.c 	struct mtd_info *mtd;
mtd                35 drivers/mtd/chips/gen_probe.c 	mtd = check_cmd_set(map, 1); /* First the primary cmdset */
mtd                36 drivers/mtd/chips/gen_probe.c 	if (!mtd)
mtd                37 drivers/mtd/chips/gen_probe.c 		mtd = check_cmd_set(map, 0); /* Then the secondary */
mtd                39 drivers/mtd/chips/gen_probe.c 	if (mtd) {
mtd                40 drivers/mtd/chips/gen_probe.c 		if (mtd->size > map->size) {
mtd                42 drivers/mtd/chips/gen_probe.c 			       (unsigned long)mtd->size >> 10,
mtd                44 drivers/mtd/chips/gen_probe.c 			mtd->size = map->size;
mtd                46 drivers/mtd/chips/gen_probe.c 		return mtd;
mtd               220 drivers/mtd/chips/gen_probe.c 		struct mtd_info *mtd;
mtd               222 drivers/mtd/chips/gen_probe.c 		mtd = (*probe_function)(map, primary);
mtd               225 drivers/mtd/chips/gen_probe.c 		return mtd;
mtd                47 drivers/mtd/chips/map_absent.c 	struct mtd_info *mtd;
mtd                49 drivers/mtd/chips/map_absent.c 	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
mtd                50 drivers/mtd/chips/map_absent.c 	if (!mtd) {
mtd                55 drivers/mtd/chips/map_absent.c 	mtd->priv 	= map;
mtd                56 drivers/mtd/chips/map_absent.c 	mtd->name 	= map->name;
mtd                57 drivers/mtd/chips/map_absent.c 	mtd->type 	= MTD_ABSENT;
mtd                58 drivers/mtd/chips/map_absent.c 	mtd->size 	= map->size;
mtd                59 drivers/mtd/chips/map_absent.c 	mtd->_erase 	= map_absent_erase;
mtd                60 drivers/mtd/chips/map_absent.c 	mtd->_read 	= map_absent_read;
mtd                61 drivers/mtd/chips/map_absent.c 	mtd->_write 	= map_absent_write;
mtd                62 drivers/mtd/chips/map_absent.c 	mtd->_sync 	= map_absent_sync;
mtd                63 drivers/mtd/chips/map_absent.c 	mtd->flags 	= 0;
mtd                64 drivers/mtd/chips/map_absent.c 	mtd->erasesize  = PAGE_SIZE;
mtd                65 drivers/mtd/chips/map_absent.c 	mtd->writesize  = 1;
mtd                68 drivers/mtd/chips/map_absent.c 	return mtd;
mtd                72 drivers/mtd/chips/map_absent.c static int map_absent_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
mtd                77 drivers/mtd/chips/map_absent.c static int map_absent_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
mtd                82 drivers/mtd/chips/map_absent.c static int map_absent_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd                87 drivers/mtd/chips/map_absent.c static void map_absent_sync(struct mtd_info *mtd)
mtd                92 drivers/mtd/chips/map_absent.c static void map_absent_destroy(struct mtd_info *mtd)
mtd                23 drivers/mtd/chips/map_ram.c static int mapram_point (struct mtd_info *mtd, loff_t from, size_t len,
mtd                25 drivers/mtd/chips/map_ram.c static int mapram_unpoint(struct mtd_info *mtd, loff_t from, size_t len);
mtd                36 drivers/mtd/chips/map_ram.c 	struct mtd_info *mtd;
mtd                59 drivers/mtd/chips/map_ram.c 	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
mtd                60 drivers/mtd/chips/map_ram.c 	if (!mtd)
mtd                64 drivers/mtd/chips/map_ram.c 	mtd->priv = map;
mtd                65 drivers/mtd/chips/map_ram.c 	mtd->name = map->name;
mtd                66 drivers/mtd/chips/map_ram.c 	mtd->type = MTD_RAM;
mtd                67 drivers/mtd/chips/map_ram.c 	mtd->size = map->size;
mtd                68 drivers/mtd/chips/map_ram.c 	mtd->_erase = mapram_erase;
mtd                69 drivers/mtd/chips/map_ram.c 	mtd->_read = mapram_read;
mtd                70 drivers/mtd/chips/map_ram.c 	mtd->_write = mapram_write;
mtd                71 drivers/mtd/chips/map_ram.c 	mtd->_panic_write = mapram_write;
mtd                72 drivers/mtd/chips/map_ram.c 	mtd->_point = mapram_point;
mtd                73 drivers/mtd/chips/map_ram.c 	mtd->_sync = mapram_nop;
mtd                74 drivers/mtd/chips/map_ram.c 	mtd->_unpoint = mapram_unpoint;
mtd                75 drivers/mtd/chips/map_ram.c 	mtd->flags = MTD_CAP_RAM;
mtd                76 drivers/mtd/chips/map_ram.c 	mtd->writesize = 1;
mtd                78 drivers/mtd/chips/map_ram.c 	mtd->erasesize = PAGE_SIZE;
mtd                79 drivers/mtd/chips/map_ram.c  	while(mtd->size & (mtd->erasesize - 1))
mtd                80 drivers/mtd/chips/map_ram.c 		mtd->erasesize >>= 1;
mtd                83 drivers/mtd/chips/map_ram.c 	return mtd;
mtd                86 drivers/mtd/chips/map_ram.c static int mapram_point(struct mtd_info *mtd, loff_t from, size_t len,
mtd                89 drivers/mtd/chips/map_ram.c 	struct map_info *map = mtd->priv;
mtd               100 drivers/mtd/chips/map_ram.c static int mapram_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
mtd               105 drivers/mtd/chips/map_ram.c static int mapram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
mtd               107 drivers/mtd/chips/map_ram.c 	struct map_info *map = mtd->priv;
mtd               114 drivers/mtd/chips/map_ram.c static int mapram_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
mtd               116 drivers/mtd/chips/map_ram.c 	struct map_info *map = mtd->priv;
mtd               123 drivers/mtd/chips/map_ram.c static int mapram_erase (struct mtd_info *mtd, struct erase_info *instr)
mtd               127 drivers/mtd/chips/map_ram.c 	struct map_info *map = mtd->priv;
mtd               137 drivers/mtd/chips/map_ram.c static void mapram_nop(struct mtd_info *mtd)
mtd                22 drivers/mtd/chips/map_rom.c static int maprom_erase (struct mtd_info *mtd, struct erase_info *info);
mtd                23 drivers/mtd/chips/map_rom.c static int maprom_point (struct mtd_info *mtd, loff_t from, size_t len,
mtd                25 drivers/mtd/chips/map_rom.c static int maprom_unpoint(struct mtd_info *mtd, loff_t from, size_t len);
mtd                45 drivers/mtd/chips/map_rom.c 	struct mtd_info *mtd;
mtd                47 drivers/mtd/chips/map_rom.c 	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
mtd                48 drivers/mtd/chips/map_rom.c 	if (!mtd)
mtd                52 drivers/mtd/chips/map_rom.c 	mtd->priv = map;
mtd                53 drivers/mtd/chips/map_rom.c 	mtd->name = map->name;
mtd                54 drivers/mtd/chips/map_rom.c 	mtd->type = MTD_ROM;
mtd                55 drivers/mtd/chips/map_rom.c 	mtd->size = map->size;
mtd                56 drivers/mtd/chips/map_rom.c 	mtd->_point = maprom_point;
mtd                57 drivers/mtd/chips/map_rom.c 	mtd->_unpoint = maprom_unpoint;
mtd                58 drivers/mtd/chips/map_rom.c 	mtd->_read = maprom_read;
mtd                59 drivers/mtd/chips/map_rom.c 	mtd->_write = maprom_write;
mtd                60 drivers/mtd/chips/map_rom.c 	mtd->_sync = maprom_nop;
mtd                61 drivers/mtd/chips/map_rom.c 	mtd->_erase = maprom_erase;
mtd                62 drivers/mtd/chips/map_rom.c 	mtd->flags = MTD_CAP_ROM;
mtd                63 drivers/mtd/chips/map_rom.c 	mtd->erasesize = default_erasesize(map);
mtd                64 drivers/mtd/chips/map_rom.c 	mtd->writesize = 1;
mtd                65 drivers/mtd/chips/map_rom.c 	mtd->writebufsize = 1;
mtd                68 drivers/mtd/chips/map_rom.c 	return mtd;
mtd                72 drivers/mtd/chips/map_rom.c static int maprom_point(struct mtd_info *mtd, loff_t from, size_t len,
mtd                75 drivers/mtd/chips/map_rom.c 	struct map_info *map = mtd->priv;
mtd                86 drivers/mtd/chips/map_rom.c static int maprom_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
mtd                91 drivers/mtd/chips/map_rom.c static int maprom_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
mtd                93 drivers/mtd/chips/map_rom.c 	struct map_info *map = mtd->priv;
mtd               100 drivers/mtd/chips/map_rom.c static void maprom_nop(struct mtd_info *mtd)
mtd               105 drivers/mtd/chips/map_rom.c static int maprom_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
mtd               110 drivers/mtd/chips/map_rom.c static int maprom_erase (struct mtd_info *mtd, struct erase_info *info)
mtd                69 drivers/mtd/devices/bcm47xxsflash.c static int bcm47xxsflash_erase(struct mtd_info *mtd, struct erase_info *erase)
mtd                71 drivers/mtd/devices/bcm47xxsflash.c 	struct bcm47xxsflash *b47s = mtd->priv;
mtd                95 drivers/mtd/devices/bcm47xxsflash.c static int bcm47xxsflash_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd                98 drivers/mtd/devices/bcm47xxsflash.c 	struct bcm47xxsflash *b47s = mtd->priv;
mtd               102 drivers/mtd/devices/bcm47xxsflash.c 	if ((from + len) > mtd->size)
mtd               128 drivers/mtd/devices/bcm47xxsflash.c static int bcm47xxsflash_write_st(struct mtd_info *mtd, u32 offset, size_t len,
mtd               131 drivers/mtd/devices/bcm47xxsflash.c 	struct bcm47xxsflash *b47s = mtd->priv;
mtd               173 drivers/mtd/devices/bcm47xxsflash.c static int bcm47xxsflash_write_at(struct mtd_info *mtd, u32 offset, size_t len,
mtd               176 drivers/mtd/devices/bcm47xxsflash.c 	struct bcm47xxsflash *b47s = mtd->priv;
mtd               216 drivers/mtd/devices/bcm47xxsflash.c static int bcm47xxsflash_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd               219 drivers/mtd/devices/bcm47xxsflash.c 	struct bcm47xxsflash *b47s = mtd->priv;
mtd               228 drivers/mtd/devices/bcm47xxsflash.c 			written = bcm47xxsflash_write_st(mtd, to, len, buf);
mtd               231 drivers/mtd/devices/bcm47xxsflash.c 			written = bcm47xxsflash_write_at(mtd, to, len, buf);
mtd               252 drivers/mtd/devices/bcm47xxsflash.c 	struct mtd_info *mtd = &b47s->mtd;
mtd               254 drivers/mtd/devices/bcm47xxsflash.c 	mtd->priv = b47s;
mtd               255 drivers/mtd/devices/bcm47xxsflash.c 	mtd->dev.parent = dev;
mtd               256 drivers/mtd/devices/bcm47xxsflash.c 	mtd->name = "bcm47xxsflash";
mtd               258 drivers/mtd/devices/bcm47xxsflash.c 	mtd->type = MTD_NORFLASH;
mtd               259 drivers/mtd/devices/bcm47xxsflash.c 	mtd->flags = MTD_CAP_NORFLASH;
mtd               260 drivers/mtd/devices/bcm47xxsflash.c 	mtd->size = b47s->size;
mtd               261 drivers/mtd/devices/bcm47xxsflash.c 	mtd->erasesize = b47s->blocksize;
mtd               262 drivers/mtd/devices/bcm47xxsflash.c 	mtd->writesize = 1;
mtd               263 drivers/mtd/devices/bcm47xxsflash.c 	mtd->writebufsize = 1;
mtd               265 drivers/mtd/devices/bcm47xxsflash.c 	mtd->_erase = bcm47xxsflash_erase;
mtd               266 drivers/mtd/devices/bcm47xxsflash.c 	mtd->_read = bcm47xxsflash_read;
mtd               267 drivers/mtd/devices/bcm47xxsflash.c 	mtd->_write = bcm47xxsflash_write;
mtd               347 drivers/mtd/devices/bcm47xxsflash.c 	err = mtd_device_parse_register(&b47s->mtd, probes, NULL, NULL, 0);
mtd               364 drivers/mtd/devices/bcm47xxsflash.c 	mtd_device_unregister(&b47s->mtd);
mtd                78 drivers/mtd/devices/bcm47xxsflash.h 	struct mtd_info mtd;
mtd                38 drivers/mtd/devices/block2mtd.c 	struct mtd_info mtd;
mtd                84 drivers/mtd/devices/block2mtd.c static int block2mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd                86 drivers/mtd/devices/block2mtd.c 	struct block2mtd_dev *dev = mtd->priv;
mtd               101 drivers/mtd/devices/block2mtd.c static int block2mtd_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd               104 drivers/mtd/devices/block2mtd.c 	struct block2mtd_dev *dev = mtd->priv;
mtd               175 drivers/mtd/devices/block2mtd.c static int block2mtd_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd               178 drivers/mtd/devices/block2mtd.c 	struct block2mtd_dev *dev = mtd->priv;
mtd               191 drivers/mtd/devices/block2mtd.c static void block2mtd_sync(struct mtd_info *mtd)
mtd               193 drivers/mtd/devices/block2mtd.c 	struct block2mtd_dev *dev = mtd->priv;
mtd               204 drivers/mtd/devices/block2mtd.c 	kfree(dev->mtd.name);
mtd               285 drivers/mtd/devices/block2mtd.c 	dev->mtd.name = name;
mtd               287 drivers/mtd/devices/block2mtd.c 	dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;
mtd               288 drivers/mtd/devices/block2mtd.c 	dev->mtd.erasesize = erase_size;
mtd               289 drivers/mtd/devices/block2mtd.c 	dev->mtd.writesize = 1;
mtd               290 drivers/mtd/devices/block2mtd.c 	dev->mtd.writebufsize = PAGE_SIZE;
mtd               291 drivers/mtd/devices/block2mtd.c 	dev->mtd.type = MTD_RAM;
mtd               292 drivers/mtd/devices/block2mtd.c 	dev->mtd.flags = MTD_CAP_RAM;
mtd               293 drivers/mtd/devices/block2mtd.c 	dev->mtd._erase = block2mtd_erase;
mtd               294 drivers/mtd/devices/block2mtd.c 	dev->mtd._write = block2mtd_write;
mtd               295 drivers/mtd/devices/block2mtd.c 	dev->mtd._sync = block2mtd_sync;
mtd               296 drivers/mtd/devices/block2mtd.c 	dev->mtd._read = block2mtd_read;
mtd               297 drivers/mtd/devices/block2mtd.c 	dev->mtd.priv = dev;
mtd               298 drivers/mtd/devices/block2mtd.c 	dev->mtd.owner = THIS_MODULE;
mtd               300 drivers/mtd/devices/block2mtd.c 	if (mtd_device_register(&dev->mtd, NULL, 0)) {
mtd               307 drivers/mtd/devices/block2mtd.c 		dev->mtd.index,
mtd               308 drivers/mtd/devices/block2mtd.c 		dev->mtd.name + strlen("block2mtd: "),
mtd               309 drivers/mtd/devices/block2mtd.c 		dev->mtd.erasesize >> 10, dev->mtd.erasesize);
mtd               482 drivers/mtd/devices/block2mtd.c 		block2mtd_sync(&dev->mtd);
mtd               483 drivers/mtd/devices/block2mtd.c 		mtd_device_unregister(&dev->mtd);
mtd               486 drivers/mtd/devices/block2mtd.c 			dev->mtd.index,
mtd               487 drivers/mtd/devices/block2mtd.c 			dev->mtd.name + strlen("block2mtd: "));
mtd                56 drivers/mtd/devices/docg3.c static int docg3_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd                69 drivers/mtd/devices/docg3.c static int docg3_ooblayout_free(struct mtd_info *mtd, int section,
mtd               865 drivers/mtd/devices/docg3.c static int doc_read_oob(struct mtd_info *mtd, loff_t from,
mtd               868 drivers/mtd/devices/docg3.c 	struct docg3 *docg3 = mtd->priv;
mtd               947 drivers/mtd/devices/docg3.c 				mtd->ecc_stats.failed++;
mtd               951 drivers/mtd/devices/docg3.c 				mtd->ecc_stats.corrected += ret;
mtd              1005 drivers/mtd/devices/docg3.c static int doc_block_isbad(struct mtd_info *mtd, loff_t from)
mtd              1007 drivers/mtd/devices/docg3.c 	struct docg3 *docg3 = mtd->priv;
mtd              1176 drivers/mtd/devices/docg3.c static int doc_erase(struct mtd_info *mtd, struct erase_info *info)
mtd              1178 drivers/mtd/devices/docg3.c 	struct docg3 *docg3 = mtd->priv;
mtd              1186 drivers/mtd/devices/docg3.c 	if (info->addr + info->len > mtd->size || page || ofs)
mtd              1194 drivers/mtd/devices/docg3.c 	for (len = info->len; !ret && len > 0; len -= mtd->erasesize) {
mtd              1374 drivers/mtd/devices/docg3.c static int doc_write_oob(struct mtd_info *mtd, loff_t ofs,
mtd              1377 drivers/mtd/devices/docg3.c 	struct docg3 *docg3 = mtd->priv;
mtd              1401 drivers/mtd/devices/docg3.c 		oobdelta = mtd->oobsize;
mtd              1404 drivers/mtd/devices/docg3.c 		oobdelta = mtd->oobavail;
mtd              1745 drivers/mtd/devices/docg3.c static int __init doc_set_driver_info(int chip_id, struct mtd_info *mtd)
mtd              1747 drivers/mtd/devices/docg3.c 	struct docg3 *docg3 = mtd->priv;
mtd              1756 drivers/mtd/devices/docg3.c 		mtd->name = devm_kasprintf(docg3->dev, GFP_KERNEL, "docg3.%d",
mtd              1758 drivers/mtd/devices/docg3.c 		if (!mtd->name)
mtd              1763 drivers/mtd/devices/docg3.c 	mtd->type = MTD_NANDFLASH;
mtd              1764 drivers/mtd/devices/docg3.c 	mtd->flags = MTD_CAP_NANDFLASH;
mtd              1765 drivers/mtd/devices/docg3.c 	mtd->size = (docg3->max_block + 1) * DOC_LAYOUT_BLOCK_SIZE;
mtd              1767 drivers/mtd/devices/docg3.c 		mtd->size /= 2;
mtd              1768 drivers/mtd/devices/docg3.c 	mtd->erasesize = DOC_LAYOUT_BLOCK_SIZE * DOC_LAYOUT_NBPLANES;
mtd              1770 drivers/mtd/devices/docg3.c 		mtd->erasesize /= 2;
mtd              1771 drivers/mtd/devices/docg3.c 	mtd->writebufsize = mtd->writesize = DOC_LAYOUT_PAGE_SIZE;
mtd              1772 drivers/mtd/devices/docg3.c 	mtd->oobsize = DOC_LAYOUT_OOB_SIZE;
mtd              1773 drivers/mtd/devices/docg3.c 	mtd->_erase = doc_erase;
mtd              1774 drivers/mtd/devices/docg3.c 	mtd->_read_oob = doc_read_oob;
mtd              1775 drivers/mtd/devices/docg3.c 	mtd->_write_oob = doc_write_oob;
mtd              1776 drivers/mtd/devices/docg3.c 	mtd->_block_isbad = doc_block_isbad;
mtd              1777 drivers/mtd/devices/docg3.c 	mtd_set_ooblayout(mtd, &nand_ooblayout_docg3_ops);
mtd              1778 drivers/mtd/devices/docg3.c 	mtd->oobavail = 8;
mtd              1779 drivers/mtd/devices/docg3.c 	mtd->ecc_strength = DOC_ECC_BCH_T;
mtd              1803 drivers/mtd/devices/docg3.c 	struct mtd_info *mtd;
mtd              1809 drivers/mtd/devices/docg3.c 	mtd = kzalloc(sizeof(struct mtd_info), GFP_KERNEL);
mtd              1810 drivers/mtd/devices/docg3.c 	if (!mtd)
mtd              1812 drivers/mtd/devices/docg3.c 	mtd->priv = docg3;
mtd              1813 drivers/mtd/devices/docg3.c 	mtd->dev.parent = dev;
mtd              1846 drivers/mtd/devices/docg3.c 	ret = doc_set_driver_info(chip_id, mtd);
mtd              1852 drivers/mtd/devices/docg3.c 	return mtd;
mtd              1857 drivers/mtd/devices/docg3.c 	kfree(mtd);
mtd              1868 drivers/mtd/devices/docg3.c static void doc_release_device(struct mtd_info *mtd)
mtd              1870 drivers/mtd/devices/docg3.c 	struct docg3 *docg3 = mtd->priv;
mtd              1872 drivers/mtd/devices/docg3.c 	mtd_device_unregister(mtd);
mtd              1875 drivers/mtd/devices/docg3.c 	kfree(mtd);
mtd              1888 drivers/mtd/devices/docg3.c 	struct mtd_info **docg3_floors, *mtd;
mtd              1893 drivers/mtd/devices/docg3.c 	mtd = docg3_floors[0];
mtd              1894 drivers/mtd/devices/docg3.c 	docg3 = mtd->priv;
mtd              1915 drivers/mtd/devices/docg3.c 	struct mtd_info **docg3_floors, *mtd;
mtd              1922 drivers/mtd/devices/docg3.c 		mtd = docg3_floors[floor];
mtd              1923 drivers/mtd/devices/docg3.c 		if (!mtd)
mtd              1925 drivers/mtd/devices/docg3.c 		docg3 = mtd->priv;
mtd              1948 drivers/mtd/devices/docg3.c 	mtd = docg3_floors[0];
mtd              1949 drivers/mtd/devices/docg3.c 	docg3 = mtd->priv;
mtd              1966 drivers/mtd/devices/docg3.c 	struct mtd_info *mtd;
mtd              1993 drivers/mtd/devices/docg3.c 		mtd = doc_probe_device(cascade, floor, dev);
mtd              1994 drivers/mtd/devices/docg3.c 		if (IS_ERR(mtd)) {
mtd              1995 drivers/mtd/devices/docg3.c 			ret = PTR_ERR(mtd);
mtd              1998 drivers/mtd/devices/docg3.c 		if (!mtd) {
mtd              2004 drivers/mtd/devices/docg3.c 		cascade->floors[floor] = mtd;
mtd              2005 drivers/mtd/devices/docg3.c 		ret = mtd_device_parse_register(mtd, part_probes, NULL, NULL,
mtd               358 drivers/mtd/devices/lart.c static int flash_erase (struct mtd_info *mtd,struct erase_info *instr)
mtd               376 drivers/mtd/devices/lart.c    for (i = 0; i < mtd->numeraseregions && instr->addr >= mtd->eraseregions[i].offset; i++) ;
mtd               385 drivers/mtd/devices/lart.c    if (i < 0 || (instr->addr & (mtd->eraseregions[i].erasesize - 1)))
mtd               398 drivers/mtd/devices/lart.c    for (; i < mtd->numeraseregions && instr->addr + instr->len >= mtd->eraseregions[i].offset; i++) ;
mtd               402 drivers/mtd/devices/lart.c    if (i < 0 || ((instr->addr + instr->len) & (mtd->eraseregions[i].erasesize - 1)))
mtd               416 drivers/mtd/devices/lart.c 		addr += mtd->eraseregions[i].erasesize;
mtd               417 drivers/mtd/devices/lart.c 		len -= mtd->eraseregions[i].erasesize;
mtd               419 drivers/mtd/devices/lart.c 		if (addr == mtd->eraseregions[i].offset + (mtd->eraseregions[i].erasesize * mtd->eraseregions[i].numblocks)) i++;
mtd               425 drivers/mtd/devices/lart.c static int flash_read (struct mtd_info *mtd,loff_t from,size_t len,size_t *retlen,u_char *buf)
mtd               500 drivers/mtd/devices/lart.c static int flash_write (struct mtd_info *mtd,loff_t to,size_t len,size_t *retlen,const u_char *buf)
mtd               560 drivers/mtd/devices/lart.c static struct mtd_info mtd;
mtd               602 drivers/mtd/devices/lart.c    memset (&mtd,0,sizeof (mtd));
mtd               611 drivers/mtd/devices/lart.c    mtd.name = module_name;
mtd               612 drivers/mtd/devices/lart.c    mtd.type = MTD_NORFLASH;
mtd               613 drivers/mtd/devices/lart.c    mtd.writesize = 1;
mtd               614 drivers/mtd/devices/lart.c    mtd.writebufsize = 4;
mtd               615 drivers/mtd/devices/lart.c    mtd.flags = MTD_CAP_NORFLASH;
mtd               616 drivers/mtd/devices/lart.c    mtd.size = FLASH_BLOCKSIZE_PARAM * FLASH_NUMBLOCKS_16m_PARAM + FLASH_BLOCKSIZE_MAIN * FLASH_NUMBLOCKS_16m_MAIN;
mtd               617 drivers/mtd/devices/lart.c    mtd.erasesize = FLASH_BLOCKSIZE_MAIN;
mtd               618 drivers/mtd/devices/lart.c    mtd.numeraseregions = ARRAY_SIZE(erase_regions);
mtd               619 drivers/mtd/devices/lart.c    mtd.eraseregions = erase_regions;
mtd               620 drivers/mtd/devices/lart.c    mtd._erase = flash_erase;
mtd               621 drivers/mtd/devices/lart.c    mtd._read = flash_read;
mtd               622 drivers/mtd/devices/lart.c    mtd._write = flash_write;
mtd               623 drivers/mtd/devices/lart.c    mtd.owner = THIS_MODULE;
mtd               631 drivers/mtd/devices/lart.c 		   mtd.name,
mtd               632 drivers/mtd/devices/lart.c 		   mtd.size,mtd.size / (1024*1024),
mtd               633 drivers/mtd/devices/lart.c 		   mtd.erasesize,mtd.erasesize / 1024,
mtd               634 drivers/mtd/devices/lart.c 		   mtd.numeraseregions);
mtd               636 drivers/mtd/devices/lart.c    if (mtd.numeraseregions)
mtd               637 drivers/mtd/devices/lart.c 	 for (result = 0; result < mtd.numeraseregions; result++)
mtd               643 drivers/mtd/devices/lart.c 			   result,mtd.eraseregions[result].offset,
mtd               644 drivers/mtd/devices/lart.c 			   result,mtd.eraseregions[result].erasesize,mtd.eraseregions[result].erasesize / 1024,
mtd               645 drivers/mtd/devices/lart.c 			   result,mtd.eraseregions[result].numblocks);
mtd               660 drivers/mtd/devices/lart.c    result = mtd_device_register(&mtd, lart_partitions,
mtd               668 drivers/mtd/devices/lart.c    mtd_device_unregister(&mtd);
mtd                30 drivers/mtd/devices/mchp23k256.c 	struct mtd_info		mtd;
mtd                39 drivers/mtd/devices/mchp23k256.c #define to_mchp23k256_flash(x) container_of(x, struct mchp23k256_flash, mtd)
mtd                60 drivers/mtd/devices/mchp23k256.c static int mchp23k256_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd                63 drivers/mtd/devices/mchp23k256.c 	struct mchp23k256_flash *flash = to_mchp23k256_flash(mtd);
mtd                99 drivers/mtd/devices/mchp23k256.c static int mchp23k256_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd               102 drivers/mtd/devices/mchp23k256.c 	struct mchp23k256_flash *flash = to_mchp23k256_flash(mtd);
mtd               195 drivers/mtd/devices/mchp23k256.c 	mtd_set_of_node(&flash->mtd, spi->dev.of_node);
mtd               196 drivers/mtd/devices/mchp23k256.c 	flash->mtd.dev.parent	= &spi->dev;
mtd               197 drivers/mtd/devices/mchp23k256.c 	flash->mtd.type		= MTD_RAM;
mtd               198 drivers/mtd/devices/mchp23k256.c 	flash->mtd.flags	= MTD_CAP_RAM;
mtd               199 drivers/mtd/devices/mchp23k256.c 	flash->mtd.writesize	= 1;
mtd               200 drivers/mtd/devices/mchp23k256.c 	flash->mtd.size		= flash->caps->size;
mtd               201 drivers/mtd/devices/mchp23k256.c 	flash->mtd._read	= mchp23k256_read;
mtd               202 drivers/mtd/devices/mchp23k256.c 	flash->mtd._write	= mchp23k256_write;
mtd               204 drivers/mtd/devices/mchp23k256.c 	err = mtd_device_register(&flash->mtd, data ? data->parts : NULL,
mtd               216 drivers/mtd/devices/mchp23k256.c 	return mtd_device_unregister(&flash->mtd);
mtd                53 drivers/mtd/devices/ms02-nv.c static int ms02nv_read(struct mtd_info *mtd, loff_t from,
mtd                56 drivers/mtd/devices/ms02-nv.c 	struct ms02nv_private *mp = mtd->priv;
mtd                63 drivers/mtd/devices/ms02-nv.c static int ms02nv_write(struct mtd_info *mtd, loff_t to,
mtd                66 drivers/mtd/devices/ms02-nv.c 	struct ms02nv_private *mp = mtd->priv;
mtd               106 drivers/mtd/devices/ms02-nv.c 	struct mtd_info *mtd;
mtd               141 drivers/mtd/devices/ms02-nv.c 	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
mtd               142 drivers/mtd/devices/ms02-nv.c 	if (!mtd)
mtd               148 drivers/mtd/devices/ms02-nv.c 	mtd->priv = mp;
mtd               201 drivers/mtd/devices/ms02-nv.c 	mtd->type = MTD_RAM;
mtd               202 drivers/mtd/devices/ms02-nv.c 	mtd->flags = MTD_CAP_RAM;
mtd               203 drivers/mtd/devices/ms02-nv.c 	mtd->size = fixsize;
mtd               204 drivers/mtd/devices/ms02-nv.c 	mtd->name = ms02nv_name;
mtd               205 drivers/mtd/devices/ms02-nv.c 	mtd->owner = THIS_MODULE;
mtd               206 drivers/mtd/devices/ms02-nv.c 	mtd->_read = ms02nv_read;
mtd               207 drivers/mtd/devices/ms02-nv.c 	mtd->_write = ms02nv_write;
mtd               208 drivers/mtd/devices/ms02-nv.c 	mtd->writesize = 1;
mtd               211 drivers/mtd/devices/ms02-nv.c 	if (mtd_device_register(mtd, NULL, 0)) {
mtd               218 drivers/mtd/devices/ms02-nv.c 		mtd->index, ms02nv_name, addr, size >> 20);
mtd               221 drivers/mtd/devices/ms02-nv.c 	root_ms02nv_mtd = mtd;
mtd               238 drivers/mtd/devices/ms02-nv.c 	kfree(mtd);
mtd               248 drivers/mtd/devices/ms02-nv.c 	struct mtd_info *mtd = root_ms02nv_mtd;
mtd               249 drivers/mtd/devices/ms02-nv.c 	struct ms02nv_private *mp = mtd->priv;
mtd               253 drivers/mtd/devices/ms02-nv.c 	mtd_device_unregister(mtd);
mtd               264 drivers/mtd/devices/ms02-nv.c 	kfree(mtd);
mtd                96 drivers/mtd/devices/mtd_dataflash.c 	struct mtd_info		mtd;
mtd               148 drivers/mtd/devices/mtd_dataflash.c static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd               150 drivers/mtd/devices/mtd_dataflash.c 	struct dataflash	*priv = mtd->priv;
mtd               229 drivers/mtd/devices/mtd_dataflash.c static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd               232 drivers/mtd/devices/mtd_dataflash.c 	struct dataflash	*priv = mtd->priv;
mtd               293 drivers/mtd/devices/mtd_dataflash.c static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd               296 drivers/mtd/devices/mtd_dataflash.c 	struct dataflash	*priv = mtd->priv;
mtd               436 drivers/mtd/devices/mtd_dataflash.c static int dataflash_get_otp_info(struct mtd_info *mtd, size_t len,
mtd               495 drivers/mtd/devices/mtd_dataflash.c static int dataflash_read_fact_otp(struct mtd_info *mtd,
mtd               498 drivers/mtd/devices/mtd_dataflash.c 	struct dataflash	*priv = mtd->priv;
mtd               512 drivers/mtd/devices/mtd_dataflash.c static int dataflash_read_user_otp(struct mtd_info *mtd,
mtd               515 drivers/mtd/devices/mtd_dataflash.c 	struct dataflash	*priv = mtd->priv;
mtd               529 drivers/mtd/devices/mtd_dataflash.c static int dataflash_write_user_otp(struct mtd_info *mtd,
mtd               536 drivers/mtd/devices/mtd_dataflash.c 	struct dataflash	*priv = mtd->priv;
mtd               638 drivers/mtd/devices/mtd_dataflash.c 	device = &priv->mtd;
mtd               919 drivers/mtd/devices/mtd_dataflash.c 	status = mtd_device_unregister(&flash->mtd);
mtd                37 drivers/mtd/devices/mtdram.c static int check_offs_len(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd                42 drivers/mtd/devices/mtdram.c 	if (mtd_mod_by_eb(ofs, mtd)) {
mtd                48 drivers/mtd/devices/mtdram.c 	if (mtd_mod_by_eb(len, mtd)) {
mtd                56 drivers/mtd/devices/mtdram.c static int ram_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd                58 drivers/mtd/devices/mtdram.c 	if (check_offs_len(mtd, instr->addr, instr->len))
mtd                60 drivers/mtd/devices/mtdram.c 	memset((char *)mtd->priv + instr->addr, 0xff, instr->len);
mtd                65 drivers/mtd/devices/mtdram.c static int ram_point(struct mtd_info *mtd, loff_t from, size_t len,
mtd                68 drivers/mtd/devices/mtdram.c 	*virt = mtd->priv + from;
mtd                94 drivers/mtd/devices/mtdram.c static int ram_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
mtd                99 drivers/mtd/devices/mtdram.c static int ram_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd               102 drivers/mtd/devices/mtdram.c 	memcpy(buf, mtd->priv + from, len);
mtd               107 drivers/mtd/devices/mtdram.c static int ram_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd               110 drivers/mtd/devices/mtdram.c 	memcpy((char *)mtd->priv + to, buf, len);
mtd               124 drivers/mtd/devices/mtdram.c int mtdram_init_device(struct mtd_info *mtd, void *mapped_address,
mtd               127 drivers/mtd/devices/mtdram.c 	memset(mtd, 0, sizeof(*mtd));
mtd               130 drivers/mtd/devices/mtdram.c 	mtd->name = name;
mtd               131 drivers/mtd/devices/mtdram.c 	mtd->type = MTD_RAM;
mtd               132 drivers/mtd/devices/mtdram.c 	mtd->flags = MTD_CAP_RAM;
mtd               133 drivers/mtd/devices/mtdram.c 	mtd->size = size;
mtd               134 drivers/mtd/devices/mtdram.c 	mtd->writesize = 1;
mtd               135 drivers/mtd/devices/mtdram.c 	mtd->writebufsize = writebuf_size;
mtd               136 drivers/mtd/devices/mtdram.c 	mtd->erasesize = MTDRAM_ERASE_SIZE;
mtd               137 drivers/mtd/devices/mtdram.c 	mtd->priv = mapped_address;
mtd               139 drivers/mtd/devices/mtdram.c 	mtd->owner = THIS_MODULE;
mtd               140 drivers/mtd/devices/mtdram.c 	mtd->_erase = ram_erase;
mtd               141 drivers/mtd/devices/mtdram.c 	mtd->_point = ram_point;
mtd               142 drivers/mtd/devices/mtdram.c 	mtd->_unpoint = ram_unpoint;
mtd               143 drivers/mtd/devices/mtdram.c 	mtd->_read = ram_read;
mtd               144 drivers/mtd/devices/mtdram.c 	mtd->_write = ram_write;
mtd               146 drivers/mtd/devices/mtdram.c 	if (mtd_device_register(mtd, NULL, 0))
mtd                31 drivers/mtd/devices/phram.c 	struct mtd_info mtd;
mtd                37 drivers/mtd/devices/phram.c static int phram_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd                39 drivers/mtd/devices/phram.c 	u_char *start = mtd->priv;
mtd                46 drivers/mtd/devices/phram.c static int phram_point(struct mtd_info *mtd, loff_t from, size_t len,
mtd                49 drivers/mtd/devices/phram.c 	*virt = mtd->priv + from;
mtd                54 drivers/mtd/devices/phram.c static int phram_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
mtd                59 drivers/mtd/devices/phram.c static int phram_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd                62 drivers/mtd/devices/phram.c 	u_char *start = mtd->priv;
mtd                69 drivers/mtd/devices/phram.c static int phram_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd                72 drivers/mtd/devices/phram.c 	u_char *start = mtd->priv;
mtd                84 drivers/mtd/devices/phram.c 		mtd_device_unregister(&this->mtd);
mtd                85 drivers/mtd/devices/phram.c 		iounmap(this->mtd.priv);
mtd                86 drivers/mtd/devices/phram.c 		kfree(this->mtd.name);
mtd               101 drivers/mtd/devices/phram.c 	new->mtd.priv = ioremap(start, len);
mtd               102 drivers/mtd/devices/phram.c 	if (!new->mtd.priv) {
mtd               108 drivers/mtd/devices/phram.c 	new->mtd.name = name;
mtd               109 drivers/mtd/devices/phram.c 	new->mtd.size = len;
mtd               110 drivers/mtd/devices/phram.c 	new->mtd.flags = MTD_CAP_RAM;
mtd               111 drivers/mtd/devices/phram.c 	new->mtd._erase = phram_erase;
mtd               112 drivers/mtd/devices/phram.c 	new->mtd._point = phram_point;
mtd               113 drivers/mtd/devices/phram.c 	new->mtd._unpoint = phram_unpoint;
mtd               114 drivers/mtd/devices/phram.c 	new->mtd._read = phram_read;
mtd               115 drivers/mtd/devices/phram.c 	new->mtd._write = phram_write;
mtd               116 drivers/mtd/devices/phram.c 	new->mtd.owner = THIS_MODULE;
mtd               117 drivers/mtd/devices/phram.c 	new->mtd.type = MTD_RAM;
mtd               118 drivers/mtd/devices/phram.c 	new->mtd.erasesize = PAGE_SIZE;
mtd               119 drivers/mtd/devices/phram.c 	new->mtd.writesize = 1;
mtd               122 drivers/mtd/devices/phram.c 	if (mtd_device_register(&new->mtd, NULL, 0)) {
mtd               131 drivers/mtd/devices/phram.c 	iounmap(new->mtd.priv);
mtd               132 drivers/mtd/devices/pmc551.c static int pmc551_point(struct mtd_info *mtd, loff_t from, size_t len,
mtd               135 drivers/mtd/devices/pmc551.c static int pmc551_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd               137 drivers/mtd/devices/pmc551.c 	struct mypriv *priv = mtd->priv;
mtd               154 drivers/mtd/devices/pmc551.c 	pmc551_point(mtd, instr->addr, instr->len, &retlen,
mtd               157 drivers/mtd/devices/pmc551.c 	if (soff_hi == eoff_hi || mtd->size == priv->asize) {
mtd               170 drivers/mtd/devices/pmc551.c 			if (soff_hi + priv->asize >= mtd->size) {
mtd               174 drivers/mtd/devices/pmc551.c 			pmc551_point(mtd, (priv->base_map0 | soff_hi),
mtd               189 drivers/mtd/devices/pmc551.c static int pmc551_point(struct mtd_info *mtd, loff_t from, size_t len,
mtd               192 drivers/mtd/devices/pmc551.c 	struct mypriv *priv = mtd->priv;
mtd               215 drivers/mtd/devices/pmc551.c static int pmc551_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
mtd               223 drivers/mtd/devices/pmc551.c static int pmc551_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd               226 drivers/mtd/devices/pmc551.c 	struct mypriv *priv = mtd->priv;
mtd               243 drivers/mtd/devices/pmc551.c 	pmc551_point(mtd, from, len, retlen, (void **)&ptr, NULL);
mtd               260 drivers/mtd/devices/pmc551.c 			if (soff_hi + priv->asize >= mtd->size) {
mtd               264 drivers/mtd/devices/pmc551.c 			pmc551_point(mtd, soff_hi, priv->asize, retlen,
mtd               279 drivers/mtd/devices/pmc551.c static int pmc551_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd               282 drivers/mtd/devices/pmc551.c 	struct mypriv *priv = mtd->priv;
mtd               299 drivers/mtd/devices/pmc551.c 	pmc551_point(mtd, to, len, retlen, (void **)&ptr, NULL);
mtd               316 drivers/mtd/devices/pmc551.c 			if (soff_hi >= mtd->size) {
mtd               320 drivers/mtd/devices/pmc551.c 			pmc551_point(mtd, soff_hi, priv->asize, retlen,
mtd               656 drivers/mtd/devices/pmc551.c 	struct mtd_info *mtd;
mtd               718 drivers/mtd/devices/pmc551.c 		mtd = kzalloc(sizeof(struct mtd_info), GFP_KERNEL);
mtd               719 drivers/mtd/devices/pmc551.c 		if (!mtd)
mtd               724 drivers/mtd/devices/pmc551.c 			kfree(mtd);
mtd               727 drivers/mtd/devices/pmc551.c 		mtd->priv = priv;
mtd               747 drivers/mtd/devices/pmc551.c 			kfree(mtd->priv);
mtd               748 drivers/mtd/devices/pmc551.c 			kfree(mtd);
mtd               768 drivers/mtd/devices/pmc551.c 		mtd->size = msize;
mtd               769 drivers/mtd/devices/pmc551.c 		mtd->flags = MTD_CAP_RAM;
mtd               770 drivers/mtd/devices/pmc551.c 		mtd->_erase = pmc551_erase;
mtd               771 drivers/mtd/devices/pmc551.c 		mtd->_read = pmc551_read;
mtd               772 drivers/mtd/devices/pmc551.c 		mtd->_write = pmc551_write;
mtd               773 drivers/mtd/devices/pmc551.c 		mtd->_point = pmc551_point;
mtd               774 drivers/mtd/devices/pmc551.c 		mtd->_unpoint = pmc551_unpoint;
mtd               775 drivers/mtd/devices/pmc551.c 		mtd->type = MTD_RAM;
mtd               776 drivers/mtd/devices/pmc551.c 		mtd->name = "PMC551 RAM board";
mtd               777 drivers/mtd/devices/pmc551.c 		mtd->erasesize = 0x10000;
mtd               778 drivers/mtd/devices/pmc551.c 		mtd->writesize = 1;
mtd               779 drivers/mtd/devices/pmc551.c 		mtd->owner = THIS_MODULE;
mtd               781 drivers/mtd/devices/pmc551.c 		if (mtd_device_register(mtd, NULL, 0)) {
mtd               784 drivers/mtd/devices/pmc551.c 			kfree(mtd->priv);
mtd               785 drivers/mtd/devices/pmc551.c 			kfree(mtd);
mtd               801 drivers/mtd/devices/pmc551.c 		pmc551list = mtd;
mtd               823 drivers/mtd/devices/pmc551.c 	struct mtd_info *mtd;
mtd               826 drivers/mtd/devices/pmc551.c 	while ((mtd = pmc551list)) {
mtd               827 drivers/mtd/devices/pmc551.c 		priv = mtd->priv;
mtd               837 drivers/mtd/devices/pmc551.c 		kfree(mtd->priv);
mtd               838 drivers/mtd/devices/pmc551.c 		mtd_device_unregister(mtd);
mtd               839 drivers/mtd/devices/pmc551.c 		kfree(mtd);
mtd                31 drivers/mtd/devices/powernv_flash.c 	struct mtd_info	mtd;
mtd                46 drivers/mtd/devices/powernv_flash.c static int powernv_flash_async_op(struct mtd_info *mtd, enum flash_op op,
mtd                49 drivers/mtd/devices/powernv_flash.c 	struct powernv_flash *info = (struct powernv_flash *)mtd->priv;
mtd                50 drivers/mtd/devices/powernv_flash.c 	struct device *dev = &mtd->dev;
mtd               137 drivers/mtd/devices/powernv_flash.c static int powernv_flash_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd               140 drivers/mtd/devices/powernv_flash.c 	return powernv_flash_async_op(mtd, FLASH_OP_READ, from,
mtd               153 drivers/mtd/devices/powernv_flash.c static int powernv_flash_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd               156 drivers/mtd/devices/powernv_flash.c 	return powernv_flash_async_op(mtd, FLASH_OP_WRITE, to,
mtd               165 drivers/mtd/devices/powernv_flash.c static int powernv_flash_erase(struct mtd_info *mtd, struct erase_info *erase)
mtd               169 drivers/mtd/devices/powernv_flash.c 	rc =  powernv_flash_async_op(mtd, FLASH_OP_ERASE, erase->addr,
mtd               183 drivers/mtd/devices/powernv_flash.c 		struct mtd_info *mtd)
mtd               206 drivers/mtd/devices/powernv_flash.c 	mtd->name = devm_kasprintf(dev, GFP_KERNEL, "%pOFP", dev->of_node);
mtd               207 drivers/mtd/devices/powernv_flash.c 	mtd->type = MTD_NORFLASH;
mtd               208 drivers/mtd/devices/powernv_flash.c 	mtd->flags = MTD_WRITEABLE;
mtd               209 drivers/mtd/devices/powernv_flash.c 	mtd->size = size;
mtd               210 drivers/mtd/devices/powernv_flash.c 	mtd->erasesize = erase_size;
mtd               211 drivers/mtd/devices/powernv_flash.c 	mtd->writebufsize = mtd->writesize = 1;
mtd               212 drivers/mtd/devices/powernv_flash.c 	mtd->owner = THIS_MODULE;
mtd               213 drivers/mtd/devices/powernv_flash.c 	mtd->_erase = powernv_flash_erase;
mtd               214 drivers/mtd/devices/powernv_flash.c 	mtd->_read = powernv_flash_read;
mtd               215 drivers/mtd/devices/powernv_flash.c 	mtd->_write = powernv_flash_write;
mtd               216 drivers/mtd/devices/powernv_flash.c 	mtd->dev.parent = dev;
mtd               217 drivers/mtd/devices/powernv_flash.c 	mtd_set_of_node(mtd, dev->of_node);
mtd               237 drivers/mtd/devices/powernv_flash.c 	data->mtd.priv = data;
mtd               245 drivers/mtd/devices/powernv_flash.c 	ret = powernv_flash_set_driver_info(dev, &data->mtd);
mtd               256 drivers/mtd/devices/powernv_flash.c 	return mtd_device_register(&data->mtd, NULL, 0);
mtd               270 drivers/mtd/devices/powernv_flash.c 	return mtd_device_unregister(&(data->mtd));
mtd                83 drivers/mtd/devices/slram.c static int slram_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd                85 drivers/mtd/devices/slram.c 	slram_priv_t *priv = mtd->priv;
mtd                92 drivers/mtd/devices/slram.c static int slram_point(struct mtd_info *mtd, loff_t from, size_t len,
mtd                95 drivers/mtd/devices/slram.c 	slram_priv_t *priv = mtd->priv;
mtd               102 drivers/mtd/devices/slram.c static int slram_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
mtd               107 drivers/mtd/devices/slram.c static int slram_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd               110 drivers/mtd/devices/slram.c 	slram_priv_t *priv = mtd->priv;
mtd               117 drivers/mtd/devices/slram.c static int slram_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd               120 drivers/mtd/devices/slram.c 	slram_priv_t *priv = mtd->priv;
mtd               199 drivers/mtd/devices/spear_smi.c 	struct mtd_info mtd;
mtd               208 drivers/mtd/devices/spear_smi.c static inline struct spear_snor_flash *get_flash_data(struct mtd_info *mtd)
mtd               210 drivers/mtd/devices/spear_smi.c 	return container_of(mtd, struct spear_snor_flash, mtd);
mtd               494 drivers/mtd/devices/spear_smi.c static int spear_mtd_erase(struct mtd_info *mtd, struct erase_info *e_info)
mtd               496 drivers/mtd/devices/spear_smi.c 	struct spear_snor_flash *flash = get_flash_data(mtd);
mtd               497 drivers/mtd/devices/spear_smi.c 	struct spear_smi *dev = mtd->priv;
mtd               524 drivers/mtd/devices/spear_smi.c 		addr += mtd->erasesize;
mtd               525 drivers/mtd/devices/spear_smi.c 		len -= mtd->erasesize;
mtd               545 drivers/mtd/devices/spear_smi.c static int spear_mtd_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd               548 drivers/mtd/devices/spear_smi.c 	struct spear_snor_flash *flash = get_flash_data(mtd);
mtd               549 drivers/mtd/devices/spear_smi.c 	struct spear_smi *dev = mtd->priv;
mtd               674 drivers/mtd/devices/spear_smi.c static int spear_mtd_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd               677 drivers/mtd/devices/spear_smi.c 	struct spear_snor_flash *flash = get_flash_data(mtd);
mtd               678 drivers/mtd/devices/spear_smi.c 	struct spear_smi *dev = mtd->priv;
mtd               884 drivers/mtd/devices/spear_smi.c 	flash->mtd.priv = dev;
mtd               887 drivers/mtd/devices/spear_smi.c 		flash->mtd.name = flash_info->name;
mtd               889 drivers/mtd/devices/spear_smi.c 		flash->mtd.name = flash_devices[flash_index].name;
mtd               891 drivers/mtd/devices/spear_smi.c 	flash->mtd.dev.parent = &pdev->dev;
mtd               892 drivers/mtd/devices/spear_smi.c 	mtd_set_of_node(&flash->mtd, np);
mtd               893 drivers/mtd/devices/spear_smi.c 	flash->mtd.type = MTD_NORFLASH;
mtd               894 drivers/mtd/devices/spear_smi.c 	flash->mtd.writesize = 1;
mtd               895 drivers/mtd/devices/spear_smi.c 	flash->mtd.flags = MTD_CAP_NORFLASH;
mtd               896 drivers/mtd/devices/spear_smi.c 	flash->mtd.size = flash_info->size;
mtd               897 drivers/mtd/devices/spear_smi.c 	flash->mtd.erasesize = flash_devices[flash_index].sectorsize;
mtd               899 drivers/mtd/devices/spear_smi.c 	flash->mtd.writebufsize = flash->page_size;
mtd               901 drivers/mtd/devices/spear_smi.c 	flash->mtd._erase = spear_mtd_erase;
mtd               902 drivers/mtd/devices/spear_smi.c 	flash->mtd._read = spear_mtd_read;
mtd               903 drivers/mtd/devices/spear_smi.c 	flash->mtd._write = spear_mtd_write;
mtd               907 drivers/mtd/devices/spear_smi.c 			flash->mtd.name, flash->mtd.size,
mtd               908 drivers/mtd/devices/spear_smi.c 			flash->mtd.size / (1024 * 1024));
mtd               911 drivers/mtd/devices/spear_smi.c 			flash->mtd.erasesize, flash->mtd.erasesize / 1024);
mtd               920 drivers/mtd/devices/spear_smi.c 	ret = mtd_device_register(&flash->mtd, parts, count);
mtd              1067 drivers/mtd/devices/spear_smi.c 		ret = mtd_device_unregister(&flash->mtd);
mtd                49 drivers/mtd/devices/sst25l.c 	struct mtd_info		mtd;
mtd                60 drivers/mtd/devices/sst25l.c #define to_sst25l_flash(x) container_of(x, struct sst25l_flash, mtd)
mtd               166 drivers/mtd/devices/sst25l.c static int sst25l_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd               168 drivers/mtd/devices/sst25l.c 	struct sst25l_flash *flash = to_sst25l_flash(mtd);
mtd               173 drivers/mtd/devices/sst25l.c 	if ((uint32_t)instr->len % mtd->erasesize)
mtd               176 drivers/mtd/devices/sst25l.c 	if ((uint32_t)instr->addr % mtd->erasesize)
mtd               198 drivers/mtd/devices/sst25l.c 		addr += mtd->erasesize;
mtd               206 drivers/mtd/devices/sst25l.c static int sst25l_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd               209 drivers/mtd/devices/sst25l.c 	struct sst25l_flash *flash = to_sst25l_flash(mtd);
mtd               249 drivers/mtd/devices/sst25l.c static int sst25l_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd               252 drivers/mtd/devices/sst25l.c 	struct sst25l_flash *flash = to_sst25l_flash(mtd);
mtd               256 drivers/mtd/devices/sst25l.c 	if ((uint32_t)to % mtd->writesize)
mtd               265 drivers/mtd/devices/sst25l.c 	for (i = 0; i < len; i += mtd->writesize) {
mtd               285 drivers/mtd/devices/sst25l.c 		bytes = min_t(uint32_t, mtd->writesize, len - i);
mtd               369 drivers/mtd/devices/sst25l.c 		flash->mtd.name = data->name;
mtd               371 drivers/mtd/devices/sst25l.c 	flash->mtd.dev.parent   = &spi->dev;
mtd               372 drivers/mtd/devices/sst25l.c 	flash->mtd.type		= MTD_NORFLASH;
mtd               373 drivers/mtd/devices/sst25l.c 	flash->mtd.flags	= MTD_CAP_NORFLASH;
mtd               374 drivers/mtd/devices/sst25l.c 	flash->mtd.erasesize	= flash_info->erase_size;
mtd               375 drivers/mtd/devices/sst25l.c 	flash->mtd.writesize	= flash_info->page_size;
mtd               376 drivers/mtd/devices/sst25l.c 	flash->mtd.writebufsize	= flash_info->page_size;
mtd               377 drivers/mtd/devices/sst25l.c 	flash->mtd.size		= flash_info->page_size * flash_info->nr_pages;
mtd               378 drivers/mtd/devices/sst25l.c 	flash->mtd._erase	= sst25l_erase;
mtd               379 drivers/mtd/devices/sst25l.c 	flash->mtd._read		= sst25l_read;
mtd               380 drivers/mtd/devices/sst25l.c 	flash->mtd._write 	= sst25l_write;
mtd               383 drivers/mtd/devices/sst25l.c 		 (long long)flash->mtd.size >> 10);
mtd               387 drivers/mtd/devices/sst25l.c 	      flash->mtd.name,
mtd               388 drivers/mtd/devices/sst25l.c 	      (long long)flash->mtd.size, (long long)(flash->mtd.size >> 20),
mtd               389 drivers/mtd/devices/sst25l.c 	      flash->mtd.erasesize, flash->mtd.erasesize / 1024,
mtd               390 drivers/mtd/devices/sst25l.c 	      flash->mtd.numeraseregions);
mtd               393 drivers/mtd/devices/sst25l.c 	ret = mtd_device_register(&flash->mtd, data ? data->parts : NULL,
mtd               405 drivers/mtd/devices/sst25l.c 	return mtd_device_unregister(&flash->mtd);
mtd               259 drivers/mtd/devices/st_spi_fsm.c 	struct mtd_info		mtd;
mtd              1670 drivers/mtd/devices/st_spi_fsm.c static int stfsm_mtd_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd              1673 drivers/mtd/devices/st_spi_fsm.c 	struct stfsm *fsm = dev_get_drvdata(mtd->dev.parent);
mtd              1746 drivers/mtd/devices/st_spi_fsm.c static int stfsm_mtd_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd              1749 drivers/mtd/devices/st_spi_fsm.c 	struct stfsm *fsm = dev_get_drvdata(mtd->dev.parent);
mtd              1792 drivers/mtd/devices/st_spi_fsm.c static int stfsm_mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd              1794 drivers/mtd/devices/st_spi_fsm.c 	struct stfsm *fsm = dev_get_drvdata(mtd->dev.parent);
mtd              1807 drivers/mtd/devices/st_spi_fsm.c 	if (len == mtd->size) {
mtd              1817 drivers/mtd/devices/st_spi_fsm.c 			addr += mtd->erasesize;
mtd              1818 drivers/mtd/devices/st_spi_fsm.c 			len -= mtd->erasesize;
mtd              2098 drivers/mtd/devices/st_spi_fsm.c 	fsm->mtd.name		= info->name;
mtd              2099 drivers/mtd/devices/st_spi_fsm.c 	fsm->mtd.dev.parent	= &pdev->dev;
mtd              2100 drivers/mtd/devices/st_spi_fsm.c 	mtd_set_of_node(&fsm->mtd, np);
mtd              2101 drivers/mtd/devices/st_spi_fsm.c 	fsm->mtd.type		= MTD_NORFLASH;
mtd              2102 drivers/mtd/devices/st_spi_fsm.c 	fsm->mtd.writesize	= 4;
mtd              2103 drivers/mtd/devices/st_spi_fsm.c 	fsm->mtd.writebufsize	= fsm->mtd.writesize;
mtd              2104 drivers/mtd/devices/st_spi_fsm.c 	fsm->mtd.flags		= MTD_CAP_NORFLASH;
mtd              2105 drivers/mtd/devices/st_spi_fsm.c 	fsm->mtd.size		= info->sector_size * info->n_sectors;
mtd              2106 drivers/mtd/devices/st_spi_fsm.c 	fsm->mtd.erasesize	= info->sector_size;
mtd              2108 drivers/mtd/devices/st_spi_fsm.c 	fsm->mtd._read  = stfsm_mtd_read;
mtd              2109 drivers/mtd/devices/st_spi_fsm.c 	fsm->mtd._write = stfsm_mtd_write;
mtd              2110 drivers/mtd/devices/st_spi_fsm.c 	fsm->mtd._erase = stfsm_mtd_erase;
mtd              2116 drivers/mtd/devices/st_spi_fsm.c 		(long long)fsm->mtd.size, (long long)(fsm->mtd.size >> 20),
mtd              2117 drivers/mtd/devices/st_spi_fsm.c 		fsm->mtd.erasesize, (fsm->mtd.erasesize >> 10));
mtd              2119 drivers/mtd/devices/st_spi_fsm.c 	return mtd_device_register(&fsm->mtd, NULL, 0);
mtd              2130 drivers/mtd/devices/st_spi_fsm.c 	return mtd_device_unregister(&fsm->mtd);
mtd               158 drivers/mtd/ftl.c     max_offset = (0x100000<part->mbd.mtd->size)?0x100000:part->mbd.mtd->size;
mtd               162 drivers/mtd/ftl.c 	 offset += part->mbd.mtd->erasesize ? : 0x2000) {
mtd               164 drivers/mtd/ftl.c 	err = mtd_read(part->mbd.mtd, offset, sizeof(header), &ret,
mtd               183 drivers/mtd/ftl.c     if ((1 << header.EraseUnitSize) != part->mbd.mtd->erasesize) {
mtd               185 drivers/mtd/ftl.c 	       1 << header.EraseUnitSize,part->mbd.mtd->erasesize);
mtd               221 drivers/mtd/ftl.c 	ret = mtd_read(part->mbd.mtd, offset, sizeof(header), &retval,
mtd               286 drivers/mtd/ftl.c 	ret = mtd_read(part->mbd.mtd, offset,
mtd               349 drivers/mtd/ftl.c     ret = mtd_erase(part->mbd.mtd, erase);
mtd               389 drivers/mtd/ftl.c     ret = mtd_write(part->mbd.mtd, xfer->Offset, sizeof(header), &retlen,
mtd               405 drivers/mtd/ftl.c 	ret = mtd_write(part->mbd.mtd, offset, sizeof(uint32_t), &retlen,
mtd               452 drivers/mtd/ftl.c 	ret = mtd_read(part->mbd.mtd, offset,
mtd               470 drivers/mtd/ftl.c     ret = mtd_write(part->mbd.mtd, offset, sizeof(uint16_t), &retlen,
mtd               490 drivers/mtd/ftl.c 	    ret = mtd_read(part->mbd.mtd, src, SECTOR_SIZE, &retlen,
mtd               498 drivers/mtd/ftl.c 	    ret = mtd_write(part->mbd.mtd, dest, SECTOR_SIZE, &retlen,
mtd               517 drivers/mtd/ftl.c     ret = mtd_write(part->mbd.mtd,
mtd               529 drivers/mtd/ftl.c     ret = mtd_write(part->mbd.mtd, xfer->Offset + 20, sizeof(uint16_t),
mtd               613 drivers/mtd/ftl.c 		mtd_sync(part->mbd.mtd);
mtd               711 drivers/mtd/ftl.c 	ret = mtd_read(part->mbd.mtd,
mtd               775 drivers/mtd/ftl.c 	    ret = mtd_read(part->mbd.mtd, offset, SECTOR_SIZE, &retlen,
mtd               814 drivers/mtd/ftl.c     ret = mtd_read(part->mbd.mtd, offset, sizeof(uint32_t), &retlen,
mtd               851 drivers/mtd/ftl.c     ret = mtd_write(part->mbd.mtd, offset, sizeof(uint32_t), &retlen,
mtd               911 drivers/mtd/ftl.c 	ret = mtd_write(part->mbd.mtd, offset, SECTOR_SIZE, &retlen, buffer);
mtd              1006 drivers/mtd/ftl.c static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
mtd              1014 drivers/mtd/ftl.c 		       mtd->name);
mtd              1018 drivers/mtd/ftl.c 	partition->mbd.mtd = mtd;
mtd               118 drivers/mtd/hyperbus/hyperbus-core.c 	hbdev->mtd = do_map_probe("cfi_probe", map);
mtd               119 drivers/mtd/hyperbus/hyperbus-core.c 	if (!hbdev->mtd) {
mtd               124 drivers/mtd/hyperbus/hyperbus-core.c 	hbdev->mtd->dev.parent = dev;
mtd               125 drivers/mtd/hyperbus/hyperbus-core.c 	mtd_set_of_node(hbdev->mtd, np);
mtd               127 drivers/mtd/hyperbus/hyperbus-core.c 	ret = mtd_device_register(hbdev->mtd, NULL, 0);
mtd               130 drivers/mtd/hyperbus/hyperbus-core.c 		map_destroy(hbdev->mtd);
mtd               142 drivers/mtd/hyperbus/hyperbus-core.c 	if (hbdev && hbdev->mtd) {
mtd               143 drivers/mtd/hyperbus/hyperbus-core.c 		ret = mtd_device_unregister(hbdev->mtd);
mtd               144 drivers/mtd/hyperbus/hyperbus-core.c 		map_destroy(hbdev->mtd);
mtd                35 drivers/mtd/inftlcore.c static void inftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
mtd                40 drivers/mtd/inftlcore.c 	if (!mtd_type_is_nand(mtd) || mtd->size > UINT_MAX)
mtd                43 drivers/mtd/inftlcore.c 	if (memcmp(mtd->name, "DiskOnChip", 10))
mtd                46 drivers/mtd/inftlcore.c 	if (!mtd->_block_isbad) {
mtd                53 drivers/mtd/inftlcore.c 	pr_debug("INFTL: add_mtd for %s\n", mtd->name);
mtd                60 drivers/mtd/inftlcore.c 	inftl->mbd.mtd = mtd;
mtd               136 drivers/mtd/inftlcore.c int inftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len,
mtd               143 drivers/mtd/inftlcore.c 	ops.ooboffs = offs & (mtd->writesize - 1);
mtd               148 drivers/mtd/inftlcore.c 	res = mtd_read_oob(mtd, offs & ~(mtd->writesize - 1), &ops);
mtd               156 drivers/mtd/inftlcore.c int inftl_write_oob(struct mtd_info *mtd, loff_t offs, size_t len,
mtd               163 drivers/mtd/inftlcore.c 	ops.ooboffs = offs & (mtd->writesize - 1);
mtd               168 drivers/mtd/inftlcore.c 	res = mtd_write_oob(mtd, offs & ~(mtd->writesize - 1), &ops);
mtd               176 drivers/mtd/inftlcore.c static int inftl_write(struct mtd_info *mtd, loff_t offs, size_t len,
mtd               184 drivers/mtd/inftlcore.c 	ops.ooblen = mtd->oobsize;
mtd               189 drivers/mtd/inftlcore.c 	res = mtd_write_oob(mtd, offs & ~(mtd->writesize - 1), &ops);
mtd               241 drivers/mtd/inftlcore.c 	struct mtd_info *mtd = inftl->mbd.mtd;
mtd               272 drivers/mtd/inftlcore.c 			if (inftl_read_oob(mtd, (thisEUN * inftl->EraseSize)
mtd               333 drivers/mtd/inftlcore.c 		ret = mtd_read(mtd,
mtd               339 drivers/mtd/inftlcore.c 			ret = mtd_read(mtd,
mtd               350 drivers/mtd/inftlcore.c 		inftl_write(inftl->mbd.mtd, (inftl->EraseSize * targetEUN) +
mtd               465 drivers/mtd/inftlcore.c 	struct mtd_info *mtd = inftl->mbd.mtd;
mtd               485 drivers/mtd/inftlcore.c 			inftl_read_oob(mtd, (thisEUN * inftl->EraseSize) +
mtd               573 drivers/mtd/inftlcore.c 			inftl_read_oob(mtd, thisEUN * inftl->EraseSize
mtd               595 drivers/mtd/inftlcore.c 		inftl_write_oob(mtd, writeEUN * inftl->EraseSize + 8, 8,
mtd               606 drivers/mtd/inftlcore.c 		inftl_write_oob(mtd, writeEUN * inftl->EraseSize +
mtd               627 drivers/mtd/inftlcore.c 	struct mtd_info *mtd = inftl->mbd.mtd;
mtd               658 drivers/mtd/inftlcore.c 			if (inftl_read_oob(mtd, (thisEUN * inftl->EraseSize)
mtd               749 drivers/mtd/inftlcore.c 	struct mtd_info *mtd = inftl->mbd.mtd;
mtd               759 drivers/mtd/inftlcore.c 		if (inftl_read_oob(mtd, (thisEUN * inftl->EraseSize) +
mtd               794 drivers/mtd/inftlcore.c 		if (inftl_read_oob(mtd, ptr, 8, &retlen, (char *)&bci) < 0)
mtd               797 drivers/mtd/inftlcore.c 		if (inftl_write_oob(mtd, ptr, 8, &retlen, (char *)&bci) < 0)
mtd               838 drivers/mtd/inftlcore.c 		inftl_write(inftl->mbd.mtd, (writeEUN * inftl->EraseSize) +
mtd               858 drivers/mtd/inftlcore.c 	struct mtd_info *mtd = inftl->mbd.mtd;
mtd               868 drivers/mtd/inftlcore.c 		if (inftl_read_oob(mtd, (thisEUN * inftl->EraseSize) +
mtd               907 drivers/mtd/inftlcore.c 		int ret = mtd_read(mtd, ptr, SECTORSIZE, &retlen, buffer);
mtd                38 drivers/mtd/inftlmount.c 	struct mtd_info *mtd = inftl->mbd.mtd;
mtd                49 drivers/mtd/inftlmount.c 	inftl->EraseSize = inftl->mbd.mtd->erasesize;
mtd                50 drivers/mtd/inftlmount.c         inftl->nb_blocks = (u32)inftl->mbd.mtd->size / inftl->EraseSize;
mtd                62 drivers/mtd/inftlmount.c 		ret = mtd_read(mtd, block * inftl->EraseSize, SECTORSIZE,
mtd                73 drivers/mtd/inftlmount.c 					inftl->mbd.mtd->index, ret);
mtd                88 drivers/mtd/inftlmount.c 		ret = inftl_read_oob(mtd,
mtd                95 drivers/mtd/inftlmount.c 				inftl->mbd.mtd->index, ret);
mtd               107 drivers/mtd/inftlmount.c 		mtd_read(mtd, block * inftl->EraseSize + 4096, SECTORSIZE,
mtd               169 drivers/mtd/inftlmount.c 			inftl->EraseSize = inftl->mbd.mtd->erasesize <<
mtd               171 drivers/mtd/inftlmount.c 			inftl->nb_blocks = (u32)inftl->mbd.mtd->size / inftl->EraseSize;
mtd               207 drivers/mtd/inftlmount.c 				mtd_erase(mtd, instr);
mtd               294 drivers/mtd/inftlmount.c 			for (physblock = 0; physblock < inftl->EraseSize; physblock += inftl->mbd.mtd->erasesize) {
mtd               295 drivers/mtd/inftlmount.c 				if (mtd_block_isbad(inftl->mbd.mtd,
mtd               326 drivers/mtd/inftlmount.c 	struct mtd_info *mtd = inftl->mbd.mtd;
mtd               331 drivers/mtd/inftlmount.c 	buf = kmalloc(SECTORSIZE + mtd->oobsize, GFP_KERNEL);
mtd               337 drivers/mtd/inftlmount.c 		if (mtd_read(mtd, address, SECTORSIZE, &retlen, buf))
mtd               343 drivers/mtd/inftlmount.c 			if(inftl_read_oob(mtd, address, mtd->oobsize,
mtd               346 drivers/mtd/inftlmount.c 			if (memcmpb(buf + SECTORSIZE, 0xff, mtd->oobsize) != 0)
mtd               373 drivers/mtd/inftlmount.c 	struct mtd_info *mtd = inftl->mbd.mtd;
mtd               385 drivers/mtd/inftlmount.c 	instr->len = inftl->mbd.mtd->erasesize;
mtd               393 drivers/mtd/inftlmount.c 		ret = mtd_erase(inftl->mbd.mtd, instr);
mtd               416 drivers/mtd/inftlmount.c 	if (inftl_write_oob(mtd, instr->addr + 8, 8, &retlen, (char *)&uci) < 0)
mtd               422 drivers/mtd/inftlmount.c 	mtd_block_markbad(inftl->mbd.mtd, instr->addr);
mtd               535 drivers/mtd/inftlmount.c 	struct mtd_info *mtd = s->mbd.mtd;
mtd               593 drivers/mtd/inftlmount.c 			if (inftl_read_oob(mtd, block * s->EraseSize + 8,
mtd               595 drivers/mtd/inftlmount.c 			    inftl_read_oob(mtd, block * s->EraseSize +
mtd               233 drivers/mtd/lpddr/lpddr2_nvm.c static int lpddr2_nvm_do_block_op(struct mtd_info *mtd, loff_t start_add,
mtd               236 drivers/mtd/lpddr/lpddr2_nvm.c 	struct map_info *map = mtd->priv;
mtd               251 drivers/mtd/lpddr/lpddr2_nvm.c 		add += mtd->erasesize;
mtd               298 drivers/mtd/lpddr/lpddr2_nvm.c static int lpddr2_nvm_read(struct mtd_info *mtd, loff_t start_add,
mtd               301 drivers/mtd/lpddr/lpddr2_nvm.c 	struct map_info *map = mtd->priv;
mtd               316 drivers/mtd/lpddr/lpddr2_nvm.c static int lpddr2_nvm_write(struct mtd_info *mtd, loff_t start_add,
mtd               319 drivers/mtd/lpddr/lpddr2_nvm.c 	struct map_info *map = mtd->priv;
mtd               335 drivers/mtd/lpddr/lpddr2_nvm.c 		if (!(IS_ALIGNED(add, mtd->writesize))) { /* do sw program */
mtd               351 drivers/mtd/lpddr/lpddr2_nvm.c 				(u_long) mtd->writesize);
mtd               372 drivers/mtd/lpddr/lpddr2_nvm.c static int lpddr2_nvm_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd               374 drivers/mtd/lpddr/lpddr2_nvm.c 	return lpddr2_nvm_do_block_op(mtd, instr->addr, instr->len,
mtd               381 drivers/mtd/lpddr/lpddr2_nvm.c static int lpddr2_nvm_unlock(struct mtd_info *mtd, loff_t start_add,
mtd               384 drivers/mtd/lpddr/lpddr2_nvm.c 	return lpddr2_nvm_do_block_op(mtd, start_add, len, LPDDR2_NVM_UNLOCK);
mtd               390 drivers/mtd/lpddr/lpddr2_nvm.c static int lpddr2_nvm_lock(struct mtd_info *mtd, loff_t start_add,
mtd               393 drivers/mtd/lpddr/lpddr2_nvm.c 	return lpddr2_nvm_do_block_op(mtd, start_add, len, LPDDR2_NVM_LOCK);
mtd               402 drivers/mtd/lpddr/lpddr2_nvm.c 	struct mtd_info *mtd;
mtd               419 drivers/mtd/lpddr/lpddr2_nvm.c 	mtd = devm_kzalloc(&pdev->dev, sizeof(*mtd), GFP_KERNEL);
mtd               420 drivers/mtd/lpddr/lpddr2_nvm.c 	if (!mtd)
mtd               447 drivers/mtd/lpddr/lpddr2_nvm.c 	*mtd = (struct mtd_info) {
mtd               470 drivers/mtd/lpddr/lpddr2_nvm.c 	return mtd_device_register(mtd, NULL, 0);
mtd                19 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_read(struct mtd_info *mtd, loff_t adr, size_t len,
mtd                21 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_write_buffers(struct mtd_info *mtd, loff_t to,
mtd                23 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_writev(struct mtd_info *mtd, const struct kvec *vecs,
mtd                25 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_erase(struct mtd_info *mtd, struct erase_info *instr);
mtd                26 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd                27 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd                28 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_point(struct mtd_info *mtd, loff_t adr, size_t len,
mtd                30 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_unpoint(struct mtd_info *mtd, loff_t adr, size_t len);
mtd                40 drivers/mtd/lpddr/lpddr_cmds.c 	struct mtd_info *mtd;
mtd                44 drivers/mtd/lpddr/lpddr_cmds.c 	mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
mtd                45 drivers/mtd/lpddr/lpddr_cmds.c 	if (!mtd)
mtd                47 drivers/mtd/lpddr/lpddr_cmds.c 	mtd->priv = map;
mtd                48 drivers/mtd/lpddr/lpddr_cmds.c 	mtd->type = MTD_NORFLASH;
mtd                51 drivers/mtd/lpddr/lpddr_cmds.c 	mtd->_read = lpddr_read;
mtd                52 drivers/mtd/lpddr/lpddr_cmds.c 	mtd->type = MTD_NORFLASH;
mtd                53 drivers/mtd/lpddr/lpddr_cmds.c 	mtd->flags = MTD_CAP_NORFLASH;
mtd                54 drivers/mtd/lpddr/lpddr_cmds.c 	mtd->flags &= ~MTD_BIT_WRITEABLE;
mtd                55 drivers/mtd/lpddr/lpddr_cmds.c 	mtd->_erase = lpddr_erase;
mtd                56 drivers/mtd/lpddr/lpddr_cmds.c 	mtd->_write = lpddr_write_buffers;
mtd                57 drivers/mtd/lpddr/lpddr_cmds.c 	mtd->_writev = lpddr_writev;
mtd                58 drivers/mtd/lpddr/lpddr_cmds.c 	mtd->_lock = lpddr_lock;
mtd                59 drivers/mtd/lpddr/lpddr_cmds.c 	mtd->_unlock = lpddr_unlock;
mtd                61 drivers/mtd/lpddr/lpddr_cmds.c 		mtd->_point = lpddr_point;
mtd                62 drivers/mtd/lpddr/lpddr_cmds.c 		mtd->_unpoint = lpddr_unpoint;
mtd                64 drivers/mtd/lpddr/lpddr_cmds.c 	mtd->size = 1 << lpddr->qinfo->DevSizeShift;
mtd                65 drivers/mtd/lpddr/lpddr_cmds.c 	mtd->erasesize = 1 << lpddr->qinfo->UniformBlockSizeShift;
mtd                66 drivers/mtd/lpddr/lpddr_cmds.c 	mtd->writesize = 1 << lpddr->qinfo->BufSizeShift;
mtd                71 drivers/mtd/lpddr/lpddr_cmds.c 		kfree(mtd);
mtd                93 drivers/mtd/lpddr/lpddr_cmds.c 	return mtd;
mtd               457 drivers/mtd/lpddr/lpddr_cmds.c static int do_erase_oneblock(struct mtd_info *mtd, loff_t adr)
mtd               459 drivers/mtd/lpddr/lpddr_cmds.c 	struct map_info *map = mtd->priv;
mtd               484 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_read(struct mtd_info *mtd, loff_t adr, size_t len,
mtd               487 drivers/mtd/lpddr/lpddr_cmds.c 	struct map_info *map = mtd->priv;
mtd               508 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_point(struct mtd_info *mtd, loff_t adr, size_t len,
mtd               511 drivers/mtd/lpddr/lpddr_cmds.c 	struct map_info *map = mtd->priv;
mtd               561 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_unpoint (struct mtd_info *mtd, loff_t adr, size_t len)
mtd               563 drivers/mtd/lpddr/lpddr_cmds.c 	struct map_info *map = mtd->priv;
mtd               606 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
mtd               614 drivers/mtd/lpddr/lpddr_cmds.c 	return lpddr_writev(mtd, &vec, 1, to, retlen);
mtd               618 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_writev(struct mtd_info *mtd, const struct kvec *vecs,
mtd               621 drivers/mtd/lpddr/lpddr_cmds.c 	struct map_info *map = mtd->priv;
mtd               665 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd               669 drivers/mtd/lpddr/lpddr_cmds.c 	struct map_info *map = mtd->priv;
mtd               677 drivers/mtd/lpddr/lpddr_cmds.c 		ret = do_erase_oneblock(mtd, ofs);
mtd               689 drivers/mtd/lpddr/lpddr_cmds.c static int do_xxlock(struct mtd_info *mtd, loff_t adr, uint32_t len, int thunk)
mtd               692 drivers/mtd/lpddr/lpddr_cmds.c 	struct map_info *map = mtd->priv;
mtd               724 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd               726 drivers/mtd/lpddr/lpddr_cmds.c 	return do_xxlock(mtd, ofs, len, DO_XXLOCK_LOCK);
mtd               729 drivers/mtd/lpddr/lpddr_cmds.c static int lpddr_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd               731 drivers/mtd/lpddr/lpddr_cmds.c 	return do_xxlock(mtd, ofs, len, DO_XXLOCK_UNLOCK);
mtd               186 drivers/mtd/lpddr/qinfo_probe.c 	struct mtd_info *mtd = NULL;
mtd               195 drivers/mtd/lpddr/qinfo_probe.c 	mtd = lpddr_cmdset(map);
mtd               196 drivers/mtd/lpddr/qinfo_probe.c 	if (mtd) {
mtd               197 drivers/mtd/lpddr/qinfo_probe.c 		if (mtd->size > map->size) {
mtd               199 drivers/mtd/lpddr/qinfo_probe.c 				"to %ldKiB\n", (unsigned long)mtd->size >> 10,
mtd               201 drivers/mtd/lpddr/qinfo_probe.c 			mtd->size = map->size;
mtd               203 drivers/mtd/lpddr/qinfo_probe.c 		return mtd;
mtd                43 drivers/mtd/maps/amd76xrom.c 	struct mtd_info *mtd;
mtd                86 drivers/mtd/maps/amd76xrom.c 		mtd_device_unregister(map->mtd);
mtd                87 drivers/mtd/maps/amd76xrom.c 		map_destroy(map->mtd);
mtd               224 drivers/mtd/maps/amd76xrom.c 				map->mtd = do_map_probe(*probe_type, &map->map);
mtd               225 drivers/mtd/maps/amd76xrom.c 				if (map->mtd)
mtd               233 drivers/mtd/maps/amd76xrom.c 		if (map->mtd->size > map->map.size) {
mtd               236 drivers/mtd/maps/amd76xrom.c 				(unsigned long long)map->mtd->size, map->map.size);
mtd               237 drivers/mtd/maps/amd76xrom.c 			map->mtd->size = map->map.size;
mtd               247 drivers/mtd/maps/amd76xrom.c 			map->rsrc.end   = map->map.phys + map->mtd->size - 1;
mtd               265 drivers/mtd/maps/amd76xrom.c 		map->mtd->owner = THIS_MODULE;
mtd               266 drivers/mtd/maps/amd76xrom.c 		if (mtd_device_register(map->mtd, NULL, 0)) {
mtd               267 drivers/mtd/maps/amd76xrom.c 			map_destroy(map->mtd);
mtd               268 drivers/mtd/maps/amd76xrom.c 			map->mtd = NULL;
mtd               274 drivers/mtd/maps/amd76xrom.c 		map_top += map->mtd->size;
mtd                47 drivers/mtd/maps/ck804xrom.c 	struct mtd_info *mtd;
mtd                98 drivers/mtd/maps/ck804xrom.c 		mtd_device_unregister(map->mtd);
mtd                99 drivers/mtd/maps/ck804xrom.c 		map_destroy(map->mtd);
mtd               254 drivers/mtd/maps/ck804xrom.c 				map->mtd = do_map_probe(*probe_type, &map->map);
mtd               255 drivers/mtd/maps/ck804xrom.c 				if (map->mtd)
mtd               263 drivers/mtd/maps/ck804xrom.c 		if (map->mtd->size > map->map.size) {
mtd               266 drivers/mtd/maps/ck804xrom.c 				(unsigned long long)map->mtd->size, map->map.size);
mtd               267 drivers/mtd/maps/ck804xrom.c 			map->mtd->size = map->map.size;
mtd               277 drivers/mtd/maps/ck804xrom.c 			map->rsrc.end   = map->map.phys + map->mtd->size - 1;
mtd               294 drivers/mtd/maps/ck804xrom.c 		map->mtd->owner = THIS_MODULE;
mtd               295 drivers/mtd/maps/ck804xrom.c 		if (mtd_device_register(map->mtd, NULL, 0)) {
mtd               296 drivers/mtd/maps/ck804xrom.c 			map_destroy(map->mtd);
mtd               297 drivers/mtd/maps/ck804xrom.c 			map->mtd = NULL;
mtd               303 drivers/mtd/maps/ck804xrom.c 		map_top += map->mtd->size;
mtd               109 drivers/mtd/maps/esb2rom.c 	struct mtd_info *mtd;
mtd               132 drivers/mtd/maps/esb2rom.c 		mtd_device_unregister(map->mtd);
mtd               133 drivers/mtd/maps/esb2rom.c 		map_destroy(map->mtd);
mtd               315 drivers/mtd/maps/esb2rom.c 				map->mtd = do_map_probe(*probe_type, &map->map);
mtd               316 drivers/mtd/maps/esb2rom.c 				if (map->mtd)
mtd               324 drivers/mtd/maps/esb2rom.c 		if (map->mtd->size > map->map.size) {
mtd               327 drivers/mtd/maps/esb2rom.c 				(unsigned long long)map->mtd->size, map->map.size);
mtd               328 drivers/mtd/maps/esb2rom.c 			map->mtd->size = map->map.size;
mtd               338 drivers/mtd/maps/esb2rom.c 			map->rsrc.end   = map->map.phys + map->mtd->size - 1;
mtd               355 drivers/mtd/maps/esb2rom.c 		map->mtd->owner = THIS_MODULE;
mtd               356 drivers/mtd/maps/esb2rom.c 		if (mtd_device_register(map->mtd, NULL, 0)) {
mtd               357 drivers/mtd/maps/esb2rom.c 			map_destroy(map->mtd);
mtd               358 drivers/mtd/maps/esb2rom.c 			map->mtd = NULL;
mtd               363 drivers/mtd/maps/esb2rom.c 		map_top += map->mtd->size;
mtd                48 drivers/mtd/maps/ichxrom.c 	struct mtd_info *mtd;
mtd                73 drivers/mtd/maps/ichxrom.c 		mtd_device_unregister(map->mtd);
mtd                74 drivers/mtd/maps/ichxrom.c 		map_destroy(map->mtd);
mtd               251 drivers/mtd/maps/ichxrom.c 				map->mtd = do_map_probe(*probe_type, &map->map);
mtd               252 drivers/mtd/maps/ichxrom.c 				if (map->mtd)
mtd               260 drivers/mtd/maps/ichxrom.c 		if (map->mtd->size > map->map.size) {
mtd               263 drivers/mtd/maps/ichxrom.c 				(unsigned long long)map->mtd->size, map->map.size);
mtd               264 drivers/mtd/maps/ichxrom.c 			map->mtd->size = map->map.size;
mtd               274 drivers/mtd/maps/ichxrom.c 			map->rsrc.end   = map->map.phys + map->mtd->size - 1;
mtd               292 drivers/mtd/maps/ichxrom.c 		map->mtd->owner = THIS_MODULE;
mtd               293 drivers/mtd/maps/ichxrom.c 		if (mtd_device_register(map->mtd, NULL, 0)) {
mtd               294 drivers/mtd/maps/ichxrom.c 			map_destroy(map->mtd);
mtd               295 drivers/mtd/maps/ichxrom.c 			map->mtd = NULL;
mtd               301 drivers/mtd/maps/ichxrom.c 		map_top += map->mtd->size;
mtd               147 drivers/mtd/maps/ixp4xx.c 	struct mtd_info *mtd;
mtd               162 drivers/mtd/maps/ixp4xx.c 	if (info->mtd) {
mtd               163 drivers/mtd/maps/ixp4xx.c 		mtd_device_unregister(info->mtd);
mtd               164 drivers/mtd/maps/ixp4xx.c 		map_destroy(info->mtd);
mtd               224 drivers/mtd/maps/ixp4xx.c 	info->mtd = do_map_probe(plat->map_name, &info->map);
mtd               225 drivers/mtd/maps/ixp4xx.c 	if (!info->mtd) {
mtd               230 drivers/mtd/maps/ixp4xx.c 	info->mtd->dev.parent = &dev->dev;
mtd               235 drivers/mtd/maps/ixp4xx.c 	err = mtd_device_parse_register(info->mtd, probes, &ppdata,
mtd                41 drivers/mtd/maps/lantiq-flash.c 	struct mtd_info *mtd;
mtd               146 drivers/mtd/maps/lantiq-flash.c 	ltq_mtd->mtd = do_map_probe("cfi_probe", ltq_mtd->map);
mtd               149 drivers/mtd/maps/lantiq-flash.c 	if (!ltq_mtd->mtd) {
mtd               154 drivers/mtd/maps/lantiq-flash.c 	ltq_mtd->mtd->dev.parent = &pdev->dev;
mtd               155 drivers/mtd/maps/lantiq-flash.c 	mtd_set_of_node(ltq_mtd->mtd, pdev->dev.of_node);
mtd               161 drivers/mtd/maps/lantiq-flash.c 	err = mtd_device_register(ltq_mtd->mtd, NULL, 0);
mtd               170 drivers/mtd/maps/lantiq-flash.c 	map_destroy(ltq_mtd->mtd);
mtd               179 drivers/mtd/maps/lantiq-flash.c 	if (ltq_mtd && ltq_mtd->mtd) {
mtd               180 drivers/mtd/maps/lantiq-flash.c 		mtd_device_unregister(ltq_mtd->mtd);
mtd               181 drivers/mtd/maps/lantiq-flash.c 		map_destroy(ltq_mtd->mtd);
mtd               256 drivers/mtd/maps/pci.c 	struct mtd_info *mtd = NULL;
mtd               282 drivers/mtd/maps/pci.c 	mtd = do_map_probe(info->map_name, &map->map);
mtd               284 drivers/mtd/maps/pci.c 	if (!mtd)
mtd               287 drivers/mtd/maps/pci.c 	mtd->owner = THIS_MODULE;
mtd               288 drivers/mtd/maps/pci.c 	mtd_device_register(mtd, NULL, 0);
mtd               290 drivers/mtd/maps/pci.c 	pci_set_drvdata(dev, mtd);
mtd               307 drivers/mtd/maps/pci.c 	struct mtd_info *mtd = pci_get_drvdata(dev);
mtd               308 drivers/mtd/maps/pci.c 	struct map_pci_info *map = mtd->priv;
mtd               310 drivers/mtd/maps/pci.c 	mtd_device_unregister(mtd);
mtd               311 drivers/mtd/maps/pci.c 	map_destroy(mtd);
mtd               466 drivers/mtd/maps/pcmciamtd.c 	struct mtd_info *mtd = NULL;
mtd               568 drivers/mtd/maps/pcmciamtd.c 		mtd = do_map_probe("map_ram", &dev->pcmcia_map);
mtd               570 drivers/mtd/maps/pcmciamtd.c 		mtd = do_map_probe("map_rom", &dev->pcmcia_map);
mtd               574 drivers/mtd/maps/pcmciamtd.c 			mtd = do_map_probe(probes[i], &dev->pcmcia_map);
mtd               575 drivers/mtd/maps/pcmciamtd.c 			if(mtd)
mtd               582 drivers/mtd/maps/pcmciamtd.c 	if(!mtd) {
mtd               588 drivers/mtd/maps/pcmciamtd.c 	dev->mtd_info = mtd;
mtd               589 drivers/mtd/maps/pcmciamtd.c 	mtd->owner = THIS_MODULE;
mtd               597 drivers/mtd/maps/pcmciamtd.c 		if(mtd->size < 1048576) { /* <1MiB in size, show size in KiB */
mtd               598 drivers/mtd/maps/pcmciamtd.c 			size = mtd->size >> 10;
mtd               601 drivers/mtd/maps/pcmciamtd.c 			size = mtd->size >> 20;
mtd               609 drivers/mtd/maps/pcmciamtd.c 	if(mtd->size <= dev->win_size) {
mtd               623 drivers/mtd/maps/pcmciamtd.c 	if (mtd_device_register(mtd, NULL, 0)) {
mtd               624 drivers/mtd/maps/pcmciamtd.c 		map_destroy(mtd);
mtd               631 drivers/mtd/maps/pcmciamtd.c 	dev_info(&dev->p_dev->dev, "mtd%d: %s\n", mtd->index, mtd->name);
mtd                31 drivers/mtd/maps/plat-ram.c 	struct mtd_info		*mtd;
mtd                77 drivers/mtd/maps/plat-ram.c 	if (info->mtd) {
mtd                78 drivers/mtd/maps/plat-ram.c 		mtd_device_unregister(info->mtd);
mtd                79 drivers/mtd/maps/plat-ram.c 		map_destroy(info->mtd);
mtd               157 drivers/mtd/maps/plat-ram.c 		for ( ; !info->mtd && *map_probes; map_probes++)
mtd               158 drivers/mtd/maps/plat-ram.c 			info->mtd = do_map_probe(*map_probes , &info->map);
mtd               162 drivers/mtd/maps/plat-ram.c 		info->mtd = do_map_probe("map_ram", &info->map);
mtd               164 drivers/mtd/maps/plat-ram.c 	if (info->mtd == NULL) {
mtd               170 drivers/mtd/maps/plat-ram.c 	info->mtd->dev.parent = &pdev->dev;
mtd               177 drivers/mtd/maps/plat-ram.c 	err = mtd_device_parse_register(info->mtd, pdata->probes, NULL,
mtd               185 drivers/mtd/maps/plat-ram.c 		err = mtd_device_register(info->mtd, NULL, 0);
mtd                40 drivers/mtd/maps/pxa2xx-flash.c 	struct mtd_info		*mtd;
mtd                84 drivers/mtd/maps/pxa2xx-flash.c 	info->mtd = do_map_probe(flash->map_name, &info->map);
mtd                86 drivers/mtd/maps/pxa2xx-flash.c 	if (!info->mtd) {
mtd                92 drivers/mtd/maps/pxa2xx-flash.c 	info->mtd->dev.parent = &pdev->dev;
mtd                94 drivers/mtd/maps/pxa2xx-flash.c 	mtd_device_parse_register(info->mtd, probes, NULL, flash->parts,
mtd               105 drivers/mtd/maps/pxa2xx-flash.c 	mtd_device_unregister(info->mtd);
mtd               107 drivers/mtd/maps/pxa2xx-flash.c 	map_destroy(info->mtd);
mtd               120 drivers/mtd/maps/pxa2xx-flash.c 	if (info && mtd_suspend(info->mtd) == 0)
mtd               121 drivers/mtd/maps/pxa2xx-flash.c 		mtd_resume(info->mtd);
mtd                22 drivers/mtd/maps/rbtx4939-flash.c 	struct mtd_info *mtd;
mtd                34 drivers/mtd/maps/rbtx4939-flash.c 	if (info->mtd) {
mtd                35 drivers/mtd/maps/rbtx4939-flash.c 		mtd_device_unregister(info->mtd);
mtd                36 drivers/mtd/maps/rbtx4939-flash.c 		map_destroy(info->mtd);
mtd                89 drivers/mtd/maps/rbtx4939-flash.c 	for (; !info->mtd && *probe_type; probe_type++)
mtd                90 drivers/mtd/maps/rbtx4939-flash.c 		info->mtd = do_map_probe(*probe_type, &info->map);
mtd                91 drivers/mtd/maps/rbtx4939-flash.c 	if (!info->mtd) {
mtd                96 drivers/mtd/maps/rbtx4939-flash.c 	info->mtd->dev.parent = &dev->dev;
mtd                97 drivers/mtd/maps/rbtx4939-flash.c 	err = mtd_device_register(info->mtd, pdata->parts, pdata->nr_parts);
mtd               113 drivers/mtd/maps/rbtx4939-flash.c 	if (mtd_suspend(info->mtd) == 0)
mtd               114 drivers/mtd/maps/rbtx4939-flash.c 		mtd_resume(info->mtd);
mtd                30 drivers/mtd/maps/sa1100-flash.c 	struct mtd_info *mtd;
mtd                35 drivers/mtd/maps/sa1100-flash.c 	struct mtd_info		*mtd;
mtd                60 drivers/mtd/maps/sa1100-flash.c 	if (subdev->mtd)
mtd                61 drivers/mtd/maps/sa1100-flash.c 		map_destroy(subdev->mtd);
mtd               117 drivers/mtd/maps/sa1100-flash.c 	subdev->mtd = do_map_probe(subdev->plat->map_name, &subdev->map);
mtd               118 drivers/mtd/maps/sa1100-flash.c 	if (subdev->mtd == NULL) {
mtd               124 drivers/mtd/maps/sa1100-flash.c 		phys, (unsigned)(subdev->mtd->size >> 20),
mtd               139 drivers/mtd/maps/sa1100-flash.c 	if (info->mtd) {
mtd               140 drivers/mtd/maps/sa1100-flash.c 		mtd_device_unregister(info->mtd);
mtd               141 drivers/mtd/maps/sa1100-flash.c 		if (info->mtd != info->subdev[0].mtd)
mtd               142 drivers/mtd/maps/sa1100-flash.c 			mtd_concat_destroy(info->mtd);
mtd               223 drivers/mtd/maps/sa1100-flash.c 		info->mtd = info->subdev[0].mtd;
mtd               238 drivers/mtd/maps/sa1100-flash.c 			cdev[i] = info->subdev[i].mtd;
mtd               240 drivers/mtd/maps/sa1100-flash.c 		info->mtd = mtd_concat_create(cdev, info->num_subdev,
mtd               243 drivers/mtd/maps/sa1100-flash.c 		if (info->mtd == NULL) {
mtd               248 drivers/mtd/maps/sa1100-flash.c 	info->mtd->dev.parent = &pdev->dev;
mtd               279 drivers/mtd/maps/sa1100-flash.c 	mtd_device_parse_register(info->mtd, part_probes, NULL, plat->parts,
mtd                72 drivers/mtd/maps/scb2_flash.c static int scb2_fixup_mtd(struct mtd_info *mtd)
mtd                76 drivers/mtd/maps/scb2_flash.c 	struct map_info *map = mtd->priv;
mtd                89 drivers/mtd/maps/scb2_flash.c 	mtd->size = map->size;
mtd               104 drivers/mtd/maps/scb2_flash.c 	mtd->erasesize /= 2;
mtd               105 drivers/mtd/maps/scb2_flash.c 	for (i = 0; i < mtd->numeraseregions; i++) {
mtd               106 drivers/mtd/maps/scb2_flash.c 		struct mtd_erase_region_info *region = &mtd->eraseregions[i];
mtd               116 drivers/mtd/maps/scb2_flash.c 	for (i = 0; !done && i < mtd->numeraseregions; i++) {
mtd               117 drivers/mtd/maps/scb2_flash.c 		struct mtd_erase_region_info *region = &mtd->eraseregions[i];
mtd               119 drivers/mtd/maps/scb2_flash.c 		if (region->numblocks * region->erasesize > mtd->size) {
mtd               120 drivers/mtd/maps/scb2_flash.c 			region->numblocks = ((unsigned long)mtd->size /
mtd                42 drivers/mtd/maps/sun_uflash.c 	struct mtd_info		*mtd;	/* mtd info */
mtd                94 drivers/mtd/maps/sun_uflash.c 	up->mtd = do_map_probe("cfi_probe", &up->map);
mtd                95 drivers/mtd/maps/sun_uflash.c 	if (!up->mtd) {
mtd               102 drivers/mtd/maps/sun_uflash.c 	up->mtd->owner = THIS_MODULE;
mtd               104 drivers/mtd/maps/sun_uflash.c 	mtd_device_register(up->mtd, NULL, 0);
mtd               128 drivers/mtd/maps/sun_uflash.c 	if (up->mtd) {
mtd               129 drivers/mtd/maps/sun_uflash.c 		mtd_device_unregister(up->mtd);
mtd               130 drivers/mtd/maps/sun_uflash.c 		map_destroy(up->mtd);
mtd                77 drivers/mtd/maps/tsunami_flash.c 	struct mtd_info *mtd;
mtd                78 drivers/mtd/maps/tsunami_flash.c 	mtd = tsunami_flash_mtd;
mtd                79 drivers/mtd/maps/tsunami_flash.c 	if (mtd) {
mtd                80 drivers/mtd/maps/tsunami_flash.c 		mtd_device_unregister(mtd);
mtd                81 drivers/mtd/maps/tsunami_flash.c 		map_destroy(mtd);
mtd                54 drivers/mtd/maps/uclinux.c static int uclinux_point(struct mtd_info *mtd, loff_t from, size_t len,
mtd                57 drivers/mtd/maps/uclinux.c 	struct map_info *map = mtd->priv;
mtd                69 drivers/mtd/maps/uclinux.c 	struct mtd_info *mtd;
mtd               101 drivers/mtd/maps/uclinux.c 	mtd = do_map_probe("map_" MAP_NAME, mapp);
mtd               102 drivers/mtd/maps/uclinux.c 	if (!mtd) {
mtd               107 drivers/mtd/maps/uclinux.c 	mtd->owner = THIS_MODULE;
mtd               108 drivers/mtd/maps/uclinux.c 	mtd->_point = uclinux_point;
mtd               109 drivers/mtd/maps/uclinux.c 	mtd->priv = mapp;
mtd               111 drivers/mtd/maps/uclinux.c 	uclinux_ram_mtdinfo = mtd;
mtd               112 drivers/mtd/maps/uclinux.c 	mtd_device_register(mtd, uclinux_romfs, NUM_PARTITIONS);
mtd                48 drivers/mtd/maps/vmu-flash.c 	struct mtd_info *mtd;
mtd                57 drivers/mtd/maps/vmu-flash.c 	struct mtd_info *mtd, int partition)
mtd                65 drivers/mtd/maps/vmu-flash.c 	mpart = mtd->priv;
mtd               110 drivers/mtd/maps/vmu-flash.c 	struct mtd_info *mtd)
mtd               120 drivers/mtd/maps/vmu-flash.c 	mpart = mtd->priv;
mtd               227 drivers/mtd/maps/vmu-flash.c 	struct mtd_info *mtd)
mtd               235 drivers/mtd/maps/vmu-flash.c 	mpart = mtd->priv;
mtd               303 drivers/mtd/maps/vmu-flash.c 	struct mtd_info *mtd)
mtd               312 drivers/mtd/maps/vmu-flash.c 	mpart = mtd->priv;
mtd               325 drivers/mtd/maps/vmu-flash.c 	vblock = ofs_to_block(ofs, mtd, partition);
mtd               332 drivers/mtd/maps/vmu-flash.c 	error = maple_vmu_read_block(vblock->num, buf, mtd);
mtd               350 drivers/mtd/maps/vmu-flash.c static int vmu_flash_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd               361 drivers/mtd/maps/vmu-flash.c 	mpart = mtd->priv;
mtd               374 drivers/mtd/maps/vmu-flash.c 		vblock =  ofs_to_block(from + index, mtd, partition);
mtd               400 drivers/mtd/maps/vmu-flash.c 			cx = vmu_flash_read_char(from + index, &retval, mtd);
mtd               416 drivers/mtd/maps/vmu-flash.c static int vmu_flash_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd               427 drivers/mtd/maps/vmu-flash.c 	mpart = mtd->priv;
mtd               440 drivers/mtd/maps/vmu-flash.c 	vblock = ofs_to_block(to, mtd, partition);
mtd               454 drivers/mtd/maps/vmu-flash.c 		error = maple_vmu_read_block(vblock->num, buffer, mtd);
mtd               467 drivers/mtd/maps/vmu-flash.c 		error = maple_vmu_write_block(vblock->num, buffer, mtd);
mtd               493 drivers/mtd/maps/vmu-flash.c static void vmu_flash_sync(struct mtd_info *mtd)
mtd               531 drivers/mtd/maps/vmu-flash.c 	mtd_cur = &card->mtd[card->partition];
mtd               586 drivers/mtd/maps/vmu-flash.c 		kfree(((card->mtd)[error]).priv);
mtd               587 drivers/mtd/maps/vmu-flash.c 		((card->mtd)[error]).priv = NULL;
mtd               637 drivers/mtd/maps/vmu-flash.c 	card->mtd = kmalloc_array(card->partitions, sizeof(struct mtd_info),
mtd               639 drivers/mtd/maps/vmu-flash.c 	if (!card->mtd) {
mtd               682 drivers/mtd/maps/vmu-flash.c 	kfree(card->mtd);
mtd               700 drivers/mtd/maps/vmu-flash.c 		mpart = ((card->mtd)[x]).priv;
mtd               702 drivers/mtd/maps/vmu-flash.c 		mtd_device_unregister(&((card->mtd)[x]));
mtd               706 drivers/mtd/maps/vmu-flash.c 	kfree(card->mtd);
mtd               717 drivers/mtd/maps/vmu-flash.c 	struct mtd_info *mtd;
mtd               721 drivers/mtd/maps/vmu-flash.c 		mtd = &((card->mtd)[x]);
mtd               722 drivers/mtd/maps/vmu-flash.c 		if (mtd->usecount > 0)
mtd               221 drivers/mtd/mtd_blkdevs.c 	if (!dev->mtd)
mtd               230 drivers/mtd/mtd_blkdevs.c 	ret = __get_mtd_device(dev->mtd);
mtd               270 drivers/mtd/mtd_blkdevs.c 	if (dev->mtd) {
mtd               273 drivers/mtd/mtd_blkdevs.c 		__put_mtd_device(dev->mtd);
mtd               291 drivers/mtd/mtd_blkdevs.c 	if (!dev->mtd)
mtd               312 drivers/mtd/mtd_blkdevs.c 	if (!dev->mtd)
mtd               460 drivers/mtd/mtd_blkdevs.c 	device_add_disk(&new->mtd->dev, gd, NULL);
mtd               511 drivers/mtd/mtd_blkdevs.c 		__put_mtd_device(old->mtd);
mtd               514 drivers/mtd/mtd_blkdevs.c 	old->mtd = NULL;
mtd               521 drivers/mtd/mtd_blkdevs.c static void blktrans_notify_remove(struct mtd_info *mtd)
mtd               528 drivers/mtd/mtd_blkdevs.c 			if (dev->mtd == mtd)
mtd               532 drivers/mtd/mtd_blkdevs.c static void blktrans_notify_add(struct mtd_info *mtd)
mtd               536 drivers/mtd/mtd_blkdevs.c 	if (mtd->type == MTD_ABSENT)
mtd               540 drivers/mtd/mtd_blkdevs.c 		tr->add_mtd(tr, mtd);
mtd               550 drivers/mtd/mtd_blkdevs.c 	struct mtd_info *mtd;
mtd               578 drivers/mtd/mtd_blkdevs.c 	mtd_for_each_device(mtd)
mtd               579 drivers/mtd/mtd_blkdevs.c 		if (mtd->type != MTD_ABSENT)
mtd               580 drivers/mtd/mtd_blkdevs.c 			tr->add_mtd(tr, mtd);
mtd                44 drivers/mtd/mtdblock.c static int erase_write (struct mtd_info *mtd, unsigned long pos,
mtd                57 drivers/mtd/mtdblock.c 	ret = mtd_erase(mtd, &erase);
mtd                61 drivers/mtd/mtdblock.c 			pos, len, mtd->name);
mtd                69 drivers/mtd/mtdblock.c 	ret = mtd_write(mtd, pos, len, &retlen, buf);
mtd                80 drivers/mtd/mtdblock.c 	struct mtd_info *mtd = mtdblk->mbd.mtd;
mtd                87 drivers/mtd/mtdblock.c 			"at 0x%lx, size 0x%x\n", mtd->name,
mtd                90 drivers/mtd/mtdblock.c 	ret = erase_write (mtd, mtdblk->cache_offset,
mtd               110 drivers/mtd/mtdblock.c 	struct mtd_info *mtd = mtdblk->mbd.mtd;
mtd               116 drivers/mtd/mtdblock.c 		mtd->name, pos, len);
mtd               119 drivers/mtd/mtdblock.c 		return mtd_write(mtd, pos, len, &retlen, buf);
mtd               134 drivers/mtd/mtdblock.c 			ret = erase_write (mtd, pos, size, buf);
mtd               151 drivers/mtd/mtdblock.c 				ret = mtd_read(mtd, sect_start, sect_size,
mtd               180 drivers/mtd/mtdblock.c 	struct mtd_info *mtd = mtdblk->mbd.mtd;
mtd               186 drivers/mtd/mtdblock.c 			mtd->name, pos, len);
mtd               189 drivers/mtd/mtdblock.c 		return mtd_read(mtd, pos, len, &retlen, buf);
mtd               208 drivers/mtd/mtdblock.c 			ret = mtd_read(mtd, pos, size, &retlen, buf);
mtd               235 drivers/mtd/mtdblock.c 		mtdblk->cache_data = vmalloc(mtdblk->mbd.mtd->erasesize);
mtd               261 drivers/mtd/mtdblock.c 	if (!(mbd->mtd->flags & MTD_NO_ERASE) && mbd->mtd->erasesize) {
mtd               262 drivers/mtd/mtdblock.c 		mtdblk->cache_size = mbd->mtd->erasesize;
mtd               287 drivers/mtd/mtdblock.c 			mtd_sync(mbd->mtd);
mtd               301 drivers/mtd/mtdblock.c 	mtd_sync(dev->mtd);
mtd               305 drivers/mtd/mtdblock.c static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
mtd               312 drivers/mtd/mtdblock.c 	dev->mbd.mtd = mtd;
mtd               313 drivers/mtd/mtdblock.c 	dev->mbd.devnum = mtd->index;
mtd               315 drivers/mtd/mtdblock.c 	dev->mbd.size = mtd->size >> 9;
mtd               318 drivers/mtd/mtdblock.c 	if (!(mtd->flags & MTD_WRITEABLE))
mtd                20 drivers/mtd/mtdblock_ro.c 	if (mtd_read(dev->mtd, (block * 512), 512, &retlen, buf))
mtd                30 drivers/mtd/mtdblock_ro.c 	if (mtd_write(dev->mtd, (block * 512), 512, &retlen, buf))
mtd                35 drivers/mtd/mtdblock_ro.c static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
mtd                42 drivers/mtd/mtdblock_ro.c 	dev->mtd = mtd;
mtd                43 drivers/mtd/mtdblock_ro.c 	dev->devnum = mtd->index;
mtd                45 drivers/mtd/mtdblock_ro.c 	dev->size = mtd->size >> 9;
mtd                37 drivers/mtd/mtdchar.c 	struct mtd_info *mtd;
mtd                44 drivers/mtd/mtdchar.c 	return fixed_size_llseek(file, offset, orig, mfi->mtd->size);
mtd                52 drivers/mtd/mtdchar.c 	struct mtd_info *mtd;
mtd                62 drivers/mtd/mtdchar.c 	mtd = get_mtd_device(NULL, devnum);
mtd                64 drivers/mtd/mtdchar.c 	if (IS_ERR(mtd)) {
mtd                65 drivers/mtd/mtdchar.c 		ret = PTR_ERR(mtd);
mtd                69 drivers/mtd/mtdchar.c 	if (mtd->type == MTD_ABSENT) {
mtd                75 drivers/mtd/mtdchar.c 	if ((file->f_mode & FMODE_WRITE) && !(mtd->flags & MTD_WRITEABLE)) {
mtd                85 drivers/mtd/mtdchar.c 	mfi->mtd = mtd;
mtd                91 drivers/mtd/mtdchar.c 	put_mtd_device(mtd);
mtd               102 drivers/mtd/mtdchar.c 	struct mtd_info *mtd = mfi->mtd;
mtd               108 drivers/mtd/mtdchar.c 		mtd_sync(mtd);
mtd               110 drivers/mtd/mtdchar.c 	put_mtd_device(mtd);
mtd               139 drivers/mtd/mtdchar.c 	struct mtd_info *mtd = mfi->mtd;
mtd               149 drivers/mtd/mtdchar.c 	if (*ppos + count > mtd->size) {
mtd               150 drivers/mtd/mtdchar.c 		if (*ppos < mtd->size)
mtd               151 drivers/mtd/mtdchar.c 			count = mtd->size - *ppos;
mtd               159 drivers/mtd/mtdchar.c 	kbuf = mtd_kmalloc_up_to(mtd, &size);
mtd               168 drivers/mtd/mtdchar.c 			ret = mtd_read_fact_prot_reg(mtd, *ppos, len,
mtd               172 drivers/mtd/mtdchar.c 			ret = mtd_read_user_prot_reg(mtd, *ppos, len,
mtd               184 drivers/mtd/mtdchar.c 			ret = mtd_read_oob(mtd, *ppos, &ops);
mtd               189 drivers/mtd/mtdchar.c 			ret = mtd_read(mtd, *ppos, len, &retlen, kbuf);
mtd               229 drivers/mtd/mtdchar.c 	struct mtd_info *mtd = mfi->mtd;
mtd               239 drivers/mtd/mtdchar.c 	if (*ppos >= mtd->size)
mtd               242 drivers/mtd/mtdchar.c 	if (*ppos + count > mtd->size)
mtd               243 drivers/mtd/mtdchar.c 		count = mtd->size - *ppos;
mtd               248 drivers/mtd/mtdchar.c 	kbuf = mtd_kmalloc_up_to(mtd, &size);
mtd               265 drivers/mtd/mtdchar.c 			ret = mtd_write_user_prot_reg(mtd, *ppos, len,
mtd               279 drivers/mtd/mtdchar.c 			ret = mtd_write_oob(mtd, *ppos, &ops);
mtd               285 drivers/mtd/mtdchar.c 			ret = mtd_write(mtd, *ppos, len, &retlen, kbuf);
mtd               320 drivers/mtd/mtdchar.c 	struct mtd_info *mtd = mfi->mtd;
mtd               325 drivers/mtd/mtdchar.c 		if (mtd_read_fact_prot_reg(mtd, -1, 0, &retlen, NULL) ==
mtd               332 drivers/mtd/mtdchar.c 		if (mtd_read_user_prot_reg(mtd, -1, 0, &retlen, NULL) ==
mtd               348 drivers/mtd/mtdchar.c static int mtdchar_writeoob(struct file *file, struct mtd_info *mtd,
mtd               363 drivers/mtd/mtdchar.c 	if (!mtd->_write_oob)
mtd               367 drivers/mtd/mtdchar.c 	ops.ooboffs = start & (mtd->writesize - 1);
mtd               372 drivers/mtd/mtdchar.c 	if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs))
mtd               379 drivers/mtd/mtdchar.c 	start &= ~((uint64_t)mtd->writesize - 1);
mtd               380 drivers/mtd/mtdchar.c 	ret = mtd_write_oob(mtd, start, &ops);
mtd               392 drivers/mtd/mtdchar.c static int mtdchar_readoob(struct file *file, struct mtd_info *mtd,
mtd               404 drivers/mtd/mtdchar.c 	ops.ooboffs = start & (mtd->writesize - 1);
mtd               409 drivers/mtd/mtdchar.c 	if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs))
mtd               416 drivers/mtd/mtdchar.c 	start &= ~((uint64_t)mtd->writesize - 1);
mtd               417 drivers/mtd/mtdchar.c 	ret = mtd_read_oob(mtd, start, &ops);
mtd               453 drivers/mtd/mtdchar.c static int shrink_ecclayout(struct mtd_info *mtd,
mtd               459 drivers/mtd/mtdchar.c 	if (!mtd || !to)
mtd               468 drivers/mtd/mtdchar.c 		ret = mtd_ooblayout_ecc(mtd, section++, &oobregion);
mtd               485 drivers/mtd/mtdchar.c 		ret = mtd_ooblayout_free(mtd, i, &oobregion);
mtd               501 drivers/mtd/mtdchar.c static int get_oobinfo(struct mtd_info *mtd, struct nand_oobinfo *to)
mtd               506 drivers/mtd/mtdchar.c 	if (!mtd || !to)
mtd               515 drivers/mtd/mtdchar.c 		ret = mtd_ooblayout_ecc(mtd, section++, &oobregion);
mtd               534 drivers/mtd/mtdchar.c 		ret = mtd_ooblayout_free(mtd, i, &oobregion);
mtd               551 drivers/mtd/mtdchar.c static int mtdchar_blkpg_ioctl(struct mtd_info *mtd,
mtd               566 drivers/mtd/mtdchar.c 		if (mtd_is_partition(mtd))
mtd               572 drivers/mtd/mtdchar.c 		return mtd_add_partition(mtd, p.devname, p.start, p.length);
mtd               579 drivers/mtd/mtdchar.c 		return mtd_del_partition(mtd, p.pno);
mtd               586 drivers/mtd/mtdchar.c static int mtdchar_write_ioctl(struct mtd_info *mtd,
mtd               600 drivers/mtd/mtdchar.c 	if (!mtd->_write_oob)
mtd               626 drivers/mtd/mtdchar.c 	ret = mtd_write_oob(mtd, (loff_t)req.start, &ops);
mtd               637 drivers/mtd/mtdchar.c 	struct mtd_info *mtd = mfi->mtd;
mtd               646 drivers/mtd/mtdchar.c 		if (copy_to_user(argp, &(mtd->numeraseregions), sizeof(int)))
mtd               659 drivers/mtd/mtdchar.c 		if (ur_idx >= mtd->numeraseregions)
mtd               662 drivers/mtd/mtdchar.c 		kr = &(mtd->eraseregions[ur_idx]);
mtd               674 drivers/mtd/mtdchar.c 		info.type	= mtd->type;
mtd               675 drivers/mtd/mtdchar.c 		info.flags	= mtd->flags;
mtd               676 drivers/mtd/mtdchar.c 		info.size	= mtd->size;
mtd               677 drivers/mtd/mtdchar.c 		info.erasesize	= mtd->erasesize;
mtd               678 drivers/mtd/mtdchar.c 		info.writesize	= mtd->writesize;
mtd               679 drivers/mtd/mtdchar.c 		info.oobsize	= mtd->oobsize;
mtd               720 drivers/mtd/mtdchar.c 			ret = mtd_erase(mtd, erase);
mtd               735 drivers/mtd/mtdchar.c 			ret = mtdchar_writeoob(file, mtd, buf.start, buf.length,
mtd               749 drivers/mtd/mtdchar.c 			ret = mtdchar_readoob(file, mtd, buf.start, buf.length,
mtd               762 drivers/mtd/mtdchar.c 			ret = mtdchar_writeoob(file, mtd, buf.start, buf.length,
mtd               776 drivers/mtd/mtdchar.c 			ret = mtdchar_readoob(file, mtd, buf.start, buf.length,
mtd               784 drivers/mtd/mtdchar.c 		ret = mtdchar_write_ioctl(mtd,
mtd               796 drivers/mtd/mtdchar.c 		ret = mtd_lock(mtd, einfo.start, einfo.length);
mtd               807 drivers/mtd/mtdchar.c 		ret = mtd_unlock(mtd, einfo.start, einfo.length);
mtd               818 drivers/mtd/mtdchar.c 		ret = mtd_is_locked(mtd, einfo.start, einfo.length);
mtd               827 drivers/mtd/mtdchar.c 		if (!mtd->ooblayout)
mtd               830 drivers/mtd/mtdchar.c 		ret = get_oobinfo(mtd, &oi);
mtd               845 drivers/mtd/mtdchar.c 		return mtd_block_isbad(mtd, offs);
mtd               855 drivers/mtd/mtdchar.c 		return mtd_block_markbad(mtd, offs);
mtd               882 drivers/mtd/mtdchar.c 			ret = mtd_get_fact_prot_info(mtd, 4096, &retlen, buf);
mtd               885 drivers/mtd/mtdchar.c 			ret = mtd_get_user_prot_info(mtd, 4096, &retlen, buf);
mtd               912 drivers/mtd/mtdchar.c 		ret = mtd_lock_user_prot_reg(mtd, oinfo.start, oinfo.length);
mtd               921 drivers/mtd/mtdchar.c 		if (!mtd->ooblayout)
mtd               928 drivers/mtd/mtdchar.c 		shrink_ecclayout(mtd, usrlay);
mtd               938 drivers/mtd/mtdchar.c 		if (copy_to_user(argp, &mtd->ecc_stats,
mtd               955 drivers/mtd/mtdchar.c 			if (!mtd_has_oob(mtd))
mtd               976 drivers/mtd/mtdchar.c 			ret = mtdchar_blkpg_ioctl(mtd, &a);
mtd              1020 drivers/mtd/mtdchar.c 	struct mtd_info *mtd = mfi->mtd;
mtd              1035 drivers/mtd/mtdchar.c 			ret = mtdchar_writeoob(file, mtd, buf.start,
mtd              1050 drivers/mtd/mtdchar.c 			ret = mtdchar_readoob(file, mtd, buf.start,
mtd              1074 drivers/mtd/mtdchar.c 		ret = mtdchar_blkpg_ioctl(mtd, &a);
mtd              1102 drivers/mtd/mtdchar.c 	struct mtd_info *mtd = mfi->mtd;
mtd              1109 drivers/mtd/mtdchar.c 	if (len > mtd->size || pgoff >= (mtd->size >> PAGE_SHIFT))
mtd              1113 drivers/mtd/mtdchar.c 	if (offset > mtd->size - len)
mtd              1116 drivers/mtd/mtdchar.c 	ret = mtd_get_unmapped_area(mtd, len, offset, flags);
mtd              1124 drivers/mtd/mtdchar.c 	return mtd_mmap_capabilities(mfi->mtd);
mtd              1135 drivers/mtd/mtdchar.c 	struct mtd_info *mtd = mfi->mtd;
mtd              1136 drivers/mtd/mtdchar.c 	struct map_info *map = mtd->priv;
mtd                30 drivers/mtd/mtdconcat.c 	struct mtd_info mtd;
mtd                54 drivers/mtd/mtdconcat.c concat_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd                57 drivers/mtd/mtdconcat.c 	struct mtd_concat *concat = CONCAT(mtd);
mtd                83 drivers/mtd/mtdconcat.c 				mtd->ecc_stats.failed++;
mtd                86 drivers/mtd/mtdconcat.c 				mtd->ecc_stats.corrected++;
mtd               106 drivers/mtd/mtdconcat.c concat_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd               109 drivers/mtd/mtdconcat.c 	struct mtd_concat *concat = CONCAT(mtd);
mtd               144 drivers/mtd/mtdconcat.c concat_writev(struct mtd_info *mtd, const struct kvec *vecs,
mtd               147 drivers/mtd/mtdconcat.c 	struct mtd_concat *concat = CONCAT(mtd);
mtd               159 drivers/mtd/mtdconcat.c 	if (mtd->writesize > 1) {
mtd               161 drivers/mtd/mtdconcat.c 		if (do_div(__to, mtd->writesize) || (total_len % mtd->writesize))
mtd               219 drivers/mtd/mtdconcat.c concat_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops)
mtd               221 drivers/mtd/mtdconcat.c 	struct mtd_concat *concat = CONCAT(mtd);
mtd               246 drivers/mtd/mtdconcat.c 				mtd->ecc_stats.failed++;
mtd               249 drivers/mtd/mtdconcat.c 				mtd->ecc_stats.corrected++;
mtd               276 drivers/mtd/mtdconcat.c concat_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops)
mtd               278 drivers/mtd/mtdconcat.c 	struct mtd_concat *concat = CONCAT(mtd);
mtd               282 drivers/mtd/mtdconcat.c 	if (!(mtd->flags & MTD_WRITEABLE))
mtd               322 drivers/mtd/mtdconcat.c static int concat_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd               324 drivers/mtd/mtdconcat.c 	struct mtd_concat *concat = CONCAT(mtd);
mtd               336 drivers/mtd/mtdconcat.c 	if (!concat->mtd.numeraseregions) {
mtd               338 drivers/mtd/mtdconcat.c 		if (instr->addr & (concat->mtd.erasesize - 1))
mtd               340 drivers/mtd/mtdconcat.c 		if (instr->len & (concat->mtd.erasesize - 1))
mtd               345 drivers/mtd/mtdconcat.c 		    concat->mtd.eraseregions;
mtd               350 drivers/mtd/mtdconcat.c 		for (i = 0; i < concat->mtd.numeraseregions &&
mtd               365 drivers/mtd/mtdconcat.c 		for (; i < concat->mtd.numeraseregions &&
mtd               440 drivers/mtd/mtdconcat.c static int concat_xxlock(struct mtd_info *mtd, loff_t ofs, uint64_t len,
mtd               443 drivers/mtd/mtdconcat.c 	struct mtd_concat *concat = CONCAT(mtd);
mtd               478 drivers/mtd/mtdconcat.c static int concat_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd               480 drivers/mtd/mtdconcat.c 	return concat_xxlock(mtd, ofs, len, true);
mtd               483 drivers/mtd/mtdconcat.c static int concat_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd               485 drivers/mtd/mtdconcat.c 	return concat_xxlock(mtd, ofs, len, false);
mtd               488 drivers/mtd/mtdconcat.c static int concat_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd               490 drivers/mtd/mtdconcat.c 	struct mtd_concat *concat = CONCAT(mtd);
mtd               510 drivers/mtd/mtdconcat.c static void concat_sync(struct mtd_info *mtd)
mtd               512 drivers/mtd/mtdconcat.c 	struct mtd_concat *concat = CONCAT(mtd);
mtd               521 drivers/mtd/mtdconcat.c static int concat_suspend(struct mtd_info *mtd)
mtd               523 drivers/mtd/mtdconcat.c 	struct mtd_concat *concat = CONCAT(mtd);
mtd               534 drivers/mtd/mtdconcat.c static void concat_resume(struct mtd_info *mtd)
mtd               536 drivers/mtd/mtdconcat.c 	struct mtd_concat *concat = CONCAT(mtd);
mtd               545 drivers/mtd/mtdconcat.c static int concat_block_isbad(struct mtd_info *mtd, loff_t ofs)
mtd               547 drivers/mtd/mtdconcat.c 	struct mtd_concat *concat = CONCAT(mtd);
mtd               568 drivers/mtd/mtdconcat.c static int concat_block_markbad(struct mtd_info *mtd, loff_t ofs)
mtd               570 drivers/mtd/mtdconcat.c 	struct mtd_concat *concat = CONCAT(mtd);
mtd               583 drivers/mtd/mtdconcat.c 			mtd->ecc_stats.badblocks++;
mtd               627 drivers/mtd/mtdconcat.c 	concat->mtd.type = subdev[0]->type;
mtd               628 drivers/mtd/mtdconcat.c 	concat->mtd.flags = subdev[0]->flags;
mtd               629 drivers/mtd/mtdconcat.c 	concat->mtd.size = subdev[0]->size;
mtd               630 drivers/mtd/mtdconcat.c 	concat->mtd.erasesize = subdev[0]->erasesize;
mtd               631 drivers/mtd/mtdconcat.c 	concat->mtd.writesize = subdev[0]->writesize;
mtd               636 drivers/mtd/mtdconcat.c 	concat->mtd.writebufsize = max_writebufsize;
mtd               638 drivers/mtd/mtdconcat.c 	concat->mtd.subpage_sft = subdev[0]->subpage_sft;
mtd               639 drivers/mtd/mtdconcat.c 	concat->mtd.oobsize = subdev[0]->oobsize;
mtd               640 drivers/mtd/mtdconcat.c 	concat->mtd.oobavail = subdev[0]->oobavail;
mtd               642 drivers/mtd/mtdconcat.c 		concat->mtd._writev = concat_writev;
mtd               644 drivers/mtd/mtdconcat.c 		concat->mtd._read_oob = concat_read_oob;
mtd               646 drivers/mtd/mtdconcat.c 		concat->mtd._write_oob = concat_write_oob;
mtd               648 drivers/mtd/mtdconcat.c 		concat->mtd._block_isbad = concat_block_isbad;
mtd               650 drivers/mtd/mtdconcat.c 		concat->mtd._block_markbad = concat_block_markbad;
mtd               652 drivers/mtd/mtdconcat.c 	concat->mtd.ecc_stats.badblocks = subdev[0]->ecc_stats.badblocks;
mtd               657 drivers/mtd/mtdconcat.c 		if (concat->mtd.type != subdev[i]->type) {
mtd               663 drivers/mtd/mtdconcat.c 		if (concat->mtd.flags != subdev[i]->flags) {
mtd               668 drivers/mtd/mtdconcat.c 			if ((concat->mtd.flags ^ subdev[i]->
mtd               677 drivers/mtd/mtdconcat.c 				concat->mtd.flags |=
mtd               681 drivers/mtd/mtdconcat.c 		concat->mtd.size += subdev[i]->size;
mtd               682 drivers/mtd/mtdconcat.c 		concat->mtd.ecc_stats.badblocks +=
mtd               684 drivers/mtd/mtdconcat.c 		if (concat->mtd.writesize   !=  subdev[i]->writesize ||
mtd               685 drivers/mtd/mtdconcat.c 		    concat->mtd.subpage_sft != subdev[i]->subpage_sft ||
mtd               686 drivers/mtd/mtdconcat.c 		    concat->mtd.oobsize    !=  subdev[i]->oobsize ||
mtd               687 drivers/mtd/mtdconcat.c 		    !concat->mtd._read_oob  != !subdev[i]->_read_oob ||
mtd               688 drivers/mtd/mtdconcat.c 		    !concat->mtd._write_oob != !subdev[i]->_write_oob) {
mtd               698 drivers/mtd/mtdconcat.c 	mtd_set_ooblayout(&concat->mtd, subdev[0]->ooblayout);
mtd               701 drivers/mtd/mtdconcat.c 	concat->mtd.name = name;
mtd               703 drivers/mtd/mtdconcat.c 	concat->mtd._erase = concat_erase;
mtd               704 drivers/mtd/mtdconcat.c 	concat->mtd._read = concat_read;
mtd               705 drivers/mtd/mtdconcat.c 	concat->mtd._write = concat_write;
mtd               706 drivers/mtd/mtdconcat.c 	concat->mtd._sync = concat_sync;
mtd               707 drivers/mtd/mtdconcat.c 	concat->mtd._lock = concat_lock;
mtd               708 drivers/mtd/mtdconcat.c 	concat->mtd._unlock = concat_unlock;
mtd               709 drivers/mtd/mtdconcat.c 	concat->mtd._is_locked = concat_is_locked;
mtd               710 drivers/mtd/mtdconcat.c 	concat->mtd._suspend = concat_suspend;
mtd               711 drivers/mtd/mtdconcat.c 	concat->mtd._resume = concat_resume;
mtd               755 drivers/mtd/mtdconcat.c 		concat->mtd.erasesize = curr_erasesize;
mtd               756 drivers/mtd/mtdconcat.c 		concat->mtd.numeraseregions = 0;
mtd               767 drivers/mtd/mtdconcat.c 		concat->mtd.erasesize = max_erasesize;
mtd               768 drivers/mtd/mtdconcat.c 		concat->mtd.numeraseregions = num_erase_region;
mtd               769 drivers/mtd/mtdconcat.c 		concat->mtd.eraseregions = erase_region_p =
mtd               841 drivers/mtd/mtdconcat.c 	return &concat->mtd;
mtd               848 drivers/mtd/mtdconcat.c void mtd_concat_destroy(struct mtd_info *mtd)
mtd               850 drivers/mtd/mtdconcat.c 	struct mtd_concat *concat = CONCAT(mtd);
mtd               851 drivers/mtd/mtdconcat.c 	if (concat->mtd.numeraseregions)
mtd               852 drivers/mtd/mtdconcat.c 		kfree(concat->mtd.eraseregions);
mtd                43 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd                45 drivers/mtd/mtdcore.c 	return mtd ? mtd_suspend(mtd) : 0;
mtd                50 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd                52 drivers/mtd/mtdcore.c 	if (mtd)
mtd                53 drivers/mtd/mtdcore.c 		mtd_resume(mtd);
mtd                92 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd                93 drivers/mtd/mtdcore.c 	dev_t index = MTD_DEVT(mtd->index);
mtd               102 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               105 drivers/mtd/mtdcore.c 	switch (mtd->type) {
mtd               141 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               143 drivers/mtd/mtdcore.c 	return snprintf(buf, PAGE_SIZE, "0x%lx\n", (unsigned long)mtd->flags);
mtd               150 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               153 drivers/mtd/mtdcore.c 		(unsigned long long)mtd->size);
mtd               160 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               162 drivers/mtd/mtdcore.c 	return snprintf(buf, PAGE_SIZE, "%lu\n", (unsigned long)mtd->erasesize);
mtd               169 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               171 drivers/mtd/mtdcore.c 	return snprintf(buf, PAGE_SIZE, "%lu\n", (unsigned long)mtd->writesize);
mtd               178 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               179 drivers/mtd/mtdcore.c 	unsigned int subpagesize = mtd->writesize >> mtd->subpage_sft;
mtd               188 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               190 drivers/mtd/mtdcore.c 	return snprintf(buf, PAGE_SIZE, "%lu\n", (unsigned long)mtd->oobsize);
mtd               197 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               199 drivers/mtd/mtdcore.c 	return snprintf(buf, PAGE_SIZE, "%u\n", mtd->oobavail);
mtd               206 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               208 drivers/mtd/mtdcore.c 	return snprintf(buf, PAGE_SIZE, "%u\n", mtd->numeraseregions);
mtd               216 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               218 drivers/mtd/mtdcore.c 	return snprintf(buf, PAGE_SIZE, "%s\n", mtd->name);
mtd               225 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               227 drivers/mtd/mtdcore.c 	return snprintf(buf, PAGE_SIZE, "%u\n", mtd->ecc_strength);
mtd               235 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               237 drivers/mtd/mtdcore.c 	return snprintf(buf, PAGE_SIZE, "%u\n", mtd->bitflip_threshold);
mtd               244 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               252 drivers/mtd/mtdcore.c 	mtd->bitflip_threshold = bitflip_threshold;
mtd               262 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               264 drivers/mtd/mtdcore.c 	return snprintf(buf, PAGE_SIZE, "%u\n", mtd->ecc_step_size);
mtd               272 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               273 drivers/mtd/mtdcore.c 	struct mtd_ecc_stats *ecc_stats = &mtd->ecc_stats;
mtd               283 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               284 drivers/mtd/mtdcore.c 	struct mtd_ecc_stats *ecc_stats = &mtd->ecc_stats;
mtd               293 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               294 drivers/mtd/mtdcore.c 	struct mtd_ecc_stats *ecc_stats = &mtd->ecc_stats;
mtd               303 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               304 drivers/mtd/mtdcore.c 	struct mtd_ecc_stats *ecc_stats = &mtd->ecc_stats;
mtd               330 drivers/mtd/mtdcore.c ATTRIBUTE_GROUPS(mtd);
mtd               340 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = s->private;
mtd               342 drivers/mtd/mtdcore.c 	seq_printf(s, "%s\n", mtd->dbg.partid);
mtd               361 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = s->private;
mtd               363 drivers/mtd/mtdcore.c 	seq_printf(s, "%s\n", mtd->dbg.partname);
mtd               382 drivers/mtd/mtdcore.c static void mtd_debugfs_populate(struct mtd_info *mtd)
mtd               384 drivers/mtd/mtdcore.c 	struct device *dev = &mtd->dev;
mtd               396 drivers/mtd/mtdcore.c 	mtd->dbg.dfs_dir = root;
mtd               398 drivers/mtd/mtdcore.c 	if (mtd->dbg.partid) {
mtd               399 drivers/mtd/mtdcore.c 		dent = debugfs_create_file("partid", 0400, root, mtd,
mtd               405 drivers/mtd/mtdcore.c 	if (mtd->dbg.partname) {
mtd               406 drivers/mtd/mtdcore.c 		dent = debugfs_create_file("partname", 0400, root, mtd,
mtd               415 drivers/mtd/mtdcore.c unsigned mtd_mmap_capabilities(struct mtd_info *mtd)
mtd               417 drivers/mtd/mtdcore.c 	switch (mtd->type) {
mtd               434 drivers/mtd/mtdcore.c 	struct mtd_info *mtd;
mtd               436 drivers/mtd/mtdcore.c 	mtd = container_of(n, struct mtd_info, reboot_notifier);
mtd               437 drivers/mtd/mtdcore.c 	mtd->_reboot(mtd);
mtd               468 drivers/mtd/mtdcore.c int mtd_wunit_to_pairing_info(struct mtd_info *mtd, int wunit,
mtd               471 drivers/mtd/mtdcore.c 	int npairs = mtd_wunit_per_eb(mtd) / mtd_pairing_groups(mtd);
mtd               476 drivers/mtd/mtdcore.c 	if (mtd->pairing && mtd->pairing->get_info)
mtd               477 drivers/mtd/mtdcore.c 		return mtd->pairing->get_info(mtd, wunit, info);
mtd               510 drivers/mtd/mtdcore.c int mtd_pairing_info_to_wunit(struct mtd_info *mtd,
mtd               513 drivers/mtd/mtdcore.c 	int ngroups = mtd_pairing_groups(mtd);
mtd               514 drivers/mtd/mtdcore.c 	int npairs = mtd_wunit_per_eb(mtd) / ngroups;
mtd               520 drivers/mtd/mtdcore.c 	if (mtd->pairing && mtd->pairing->get_wunit)
mtd               521 drivers/mtd/mtdcore.c 		return mtd->pairing->get_wunit(mtd, info);
mtd               537 drivers/mtd/mtdcore.c int mtd_pairing_groups(struct mtd_info *mtd)
mtd               539 drivers/mtd/mtdcore.c 	if (!mtd->pairing || !mtd->pairing->ngroups)
mtd               542 drivers/mtd/mtdcore.c 	return mtd->pairing->ngroups;
mtd               549 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = priv;
mtd               553 drivers/mtd/mtdcore.c 	err = mtd_read(mtd, offset, bytes, &retlen, val);
mtd               560 drivers/mtd/mtdcore.c static int mtd_nvmem_add(struct mtd_info *mtd)
mtd               565 drivers/mtd/mtdcore.c 	config.dev = &mtd->dev;
mtd               566 drivers/mtd/mtdcore.c 	config.name = dev_name(&mtd->dev);
mtd               569 drivers/mtd/mtdcore.c 	config.size = mtd->size;
mtd               575 drivers/mtd/mtdcore.c 	config.priv = mtd;
mtd               577 drivers/mtd/mtdcore.c 	mtd->nvmem = nvmem_register(&config);
mtd               578 drivers/mtd/mtdcore.c 	if (IS_ERR(mtd->nvmem)) {
mtd               580 drivers/mtd/mtdcore.c 		if (PTR_ERR(mtd->nvmem) == -EOPNOTSUPP) {
mtd               581 drivers/mtd/mtdcore.c 			mtd->nvmem = NULL;
mtd               583 drivers/mtd/mtdcore.c 			dev_err(&mtd->dev, "Failed to register NVMEM device\n");
mtd               584 drivers/mtd/mtdcore.c 			return PTR_ERR(mtd->nvmem);
mtd               600 drivers/mtd/mtdcore.c int add_mtd_device(struct mtd_info *mtd)
mtd               610 drivers/mtd/mtdcore.c 	if (WARN_ONCE(mtd->dev.type, "MTD already registered\n"))
mtd               613 drivers/mtd/mtdcore.c 	BUG_ON(mtd->writesize == 0);
mtd               619 drivers/mtd/mtdcore.c 	if (WARN_ON((mtd->_write && mtd->_write_oob) ||
mtd               620 drivers/mtd/mtdcore.c 		    (mtd->_read && mtd->_read_oob)))
mtd               623 drivers/mtd/mtdcore.c 	if (WARN_ON((!mtd->erasesize || !mtd->_erase) &&
mtd               624 drivers/mtd/mtdcore.c 		    !(mtd->flags & MTD_NO_ERASE)))
mtd               629 drivers/mtd/mtdcore.c 	i = idr_alloc(&mtd_idr, mtd, 0, 0, GFP_KERNEL);
mtd               635 drivers/mtd/mtdcore.c 	mtd->index = i;
mtd               636 drivers/mtd/mtdcore.c 	mtd->usecount = 0;
mtd               639 drivers/mtd/mtdcore.c 	if (mtd->bitflip_threshold == 0)
mtd               640 drivers/mtd/mtdcore.c 		mtd->bitflip_threshold = mtd->ecc_strength;
mtd               642 drivers/mtd/mtdcore.c 	if (is_power_of_2(mtd->erasesize))
mtd               643 drivers/mtd/mtdcore.c 		mtd->erasesize_shift = ffs(mtd->erasesize) - 1;
mtd               645 drivers/mtd/mtdcore.c 		mtd->erasesize_shift = 0;
mtd               647 drivers/mtd/mtdcore.c 	if (is_power_of_2(mtd->writesize))
mtd               648 drivers/mtd/mtdcore.c 		mtd->writesize_shift = ffs(mtd->writesize) - 1;
mtd               650 drivers/mtd/mtdcore.c 		mtd->writesize_shift = 0;
mtd               652 drivers/mtd/mtdcore.c 	mtd->erasesize_mask = (1 << mtd->erasesize_shift) - 1;
mtd               653 drivers/mtd/mtdcore.c 	mtd->writesize_mask = (1 << mtd->writesize_shift) - 1;
mtd               656 drivers/mtd/mtdcore.c 	if ((mtd->flags & MTD_WRITEABLE) && (mtd->flags & MTD_POWERUP_LOCK)) {
mtd               657 drivers/mtd/mtdcore.c 		error = mtd_unlock(mtd, 0, mtd->size);
mtd               661 drivers/mtd/mtdcore.c 			       mtd->name);
mtd               669 drivers/mtd/mtdcore.c 	mtd->dev.type = &mtd_devtype;
mtd               670 drivers/mtd/mtdcore.c 	mtd->dev.class = &mtd_class;
mtd               671 drivers/mtd/mtdcore.c 	mtd->dev.devt = MTD_DEVT(i);
mtd               672 drivers/mtd/mtdcore.c 	dev_set_name(&mtd->dev, "mtd%d", i);
mtd               673 drivers/mtd/mtdcore.c 	dev_set_drvdata(&mtd->dev, mtd);
mtd               674 drivers/mtd/mtdcore.c 	of_node_get(mtd_get_of_node(mtd));
mtd               675 drivers/mtd/mtdcore.c 	error = device_register(&mtd->dev);
mtd               680 drivers/mtd/mtdcore.c 	error = mtd_nvmem_add(mtd);
mtd               684 drivers/mtd/mtdcore.c 	mtd_debugfs_populate(mtd);
mtd               686 drivers/mtd/mtdcore.c 	device_create(&mtd_class, mtd->dev.parent, MTD_DEVT(i) + 1, NULL,
mtd               689 drivers/mtd/mtdcore.c 	pr_debug("mtd: Giving out device %d to %s\n", i, mtd->name);
mtd               693 drivers/mtd/mtdcore.c 		not->add(mtd);
mtd               704 drivers/mtd/mtdcore.c 	device_unregister(&mtd->dev);
mtd               706 drivers/mtd/mtdcore.c 	of_node_put(mtd_get_of_node(mtd));
mtd               723 drivers/mtd/mtdcore.c int del_mtd_device(struct mtd_info *mtd)
mtd               730 drivers/mtd/mtdcore.c 	debugfs_remove_recursive(mtd->dbg.dfs_dir);
mtd               732 drivers/mtd/mtdcore.c 	if (idr_find(&mtd_idr, mtd->index) != mtd) {
mtd               740 drivers/mtd/mtdcore.c 		not->remove(mtd);
mtd               742 drivers/mtd/mtdcore.c 	if (mtd->usecount) {
mtd               744 drivers/mtd/mtdcore.c 		       mtd->index, mtd->name, mtd->usecount);
mtd               748 drivers/mtd/mtdcore.c 		if (mtd->nvmem)
mtd               749 drivers/mtd/mtdcore.c 			nvmem_unregister(mtd->nvmem);
mtd               751 drivers/mtd/mtdcore.c 		device_unregister(&mtd->dev);
mtd               753 drivers/mtd/mtdcore.c 		idr_remove(&mtd_idr, mtd->index);
mtd               754 drivers/mtd/mtdcore.c 		of_node_put(mtd_get_of_node(mtd));
mtd               769 drivers/mtd/mtdcore.c static void mtd_set_dev_defaults(struct mtd_info *mtd)
mtd               771 drivers/mtd/mtdcore.c 	if (mtd->dev.parent) {
mtd               772 drivers/mtd/mtdcore.c 		if (!mtd->owner && mtd->dev.parent->driver)
mtd               773 drivers/mtd/mtdcore.c 			mtd->owner = mtd->dev.parent->driver->owner;
mtd               774 drivers/mtd/mtdcore.c 		if (!mtd->name)
mtd               775 drivers/mtd/mtdcore.c 			mtd->name = dev_name(mtd->dev.parent);
mtd               780 drivers/mtd/mtdcore.c 	mtd->orig_flags = mtd->flags;
mtd               811 drivers/mtd/mtdcore.c int mtd_device_parse_register(struct mtd_info *mtd, const char * const *types,
mtd               818 drivers/mtd/mtdcore.c 	mtd_set_dev_defaults(mtd);
mtd               821 drivers/mtd/mtdcore.c 		ret = add_mtd_device(mtd);
mtd               827 drivers/mtd/mtdcore.c 	ret = parse_mtd_partitions(mtd, types, parser_data);
mtd               831 drivers/mtd/mtdcore.c 		ret = add_mtd_partitions(mtd, parts, nr_parts);
mtd               832 drivers/mtd/mtdcore.c 	else if (!device_is_registered(&mtd->dev))
mtd               833 drivers/mtd/mtdcore.c 		ret = add_mtd_device(mtd);
mtd               848 drivers/mtd/mtdcore.c 	WARN_ONCE(mtd->_reboot && mtd->reboot_notifier.notifier_call,
mtd               850 drivers/mtd/mtdcore.c 	if (mtd->_reboot && !mtd->reboot_notifier.notifier_call) {
mtd               851 drivers/mtd/mtdcore.c 		mtd->reboot_notifier.notifier_call = mtd_reboot_notifier;
mtd               852 drivers/mtd/mtdcore.c 		register_reboot_notifier(&mtd->reboot_notifier);
mtd               856 drivers/mtd/mtdcore.c 	if (ret && device_is_registered(&mtd->dev))
mtd               857 drivers/mtd/mtdcore.c 		del_mtd_device(mtd);
mtd               897 drivers/mtd/mtdcore.c 	struct mtd_info *mtd;
mtd               905 drivers/mtd/mtdcore.c 	mtd_for_each_device(mtd)
mtd               906 drivers/mtd/mtdcore.c 		new->add(mtd);
mtd               923 drivers/mtd/mtdcore.c 	struct mtd_info *mtd;
mtd               929 drivers/mtd/mtdcore.c 	mtd_for_each_device(mtd)
mtd               930 drivers/mtd/mtdcore.c 		old->remove(mtd);
mtd               949 drivers/mtd/mtdcore.c struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num)
mtd               958 drivers/mtd/mtdcore.c 			if (other == mtd) {
mtd               959 drivers/mtd/mtdcore.c 				ret = mtd;
mtd               965 drivers/mtd/mtdcore.c 		if (mtd && mtd != ret)
mtd               984 drivers/mtd/mtdcore.c int __get_mtd_device(struct mtd_info *mtd)
mtd               988 drivers/mtd/mtdcore.c 	if (!try_module_get(mtd->owner))
mtd               991 drivers/mtd/mtdcore.c 	if (mtd->_get_device) {
mtd               992 drivers/mtd/mtdcore.c 		err = mtd->_get_device(mtd);
mtd               995 drivers/mtd/mtdcore.c 			module_put(mtd->owner);
mtd               999 drivers/mtd/mtdcore.c 	mtd->usecount++;
mtd              1015 drivers/mtd/mtdcore.c 	struct mtd_info *mtd = NULL, *other;
mtd              1021 drivers/mtd/mtdcore.c 			mtd = other;
mtd              1026 drivers/mtd/mtdcore.c 	if (!mtd)
mtd              1029 drivers/mtd/mtdcore.c 	err = __get_mtd_device(mtd);
mtd              1034 drivers/mtd/mtdcore.c 	return mtd;
mtd              1042 drivers/mtd/mtdcore.c void put_mtd_device(struct mtd_info *mtd)
mtd              1045 drivers/mtd/mtdcore.c 	__put_mtd_device(mtd);
mtd              1051 drivers/mtd/mtdcore.c void __put_mtd_device(struct mtd_info *mtd)
mtd              1053 drivers/mtd/mtdcore.c 	--mtd->usecount;
mtd              1054 drivers/mtd/mtdcore.c 	BUG_ON(mtd->usecount < 0);
mtd              1056 drivers/mtd/mtdcore.c 	if (mtd->_put_device)
mtd              1057 drivers/mtd/mtdcore.c 		mtd->_put_device(mtd);
mtd              1059 drivers/mtd/mtdcore.c 	module_put(mtd->owner);
mtd              1068 drivers/mtd/mtdcore.c int mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd              1072 drivers/mtd/mtdcore.c 	if (!mtd->erasesize || !mtd->_erase)
mtd              1075 drivers/mtd/mtdcore.c 	if (instr->addr >= mtd->size || instr->len > mtd->size - instr->addr)
mtd              1077 drivers/mtd/mtdcore.c 	if (!(mtd->flags & MTD_WRITEABLE))
mtd              1084 drivers/mtd/mtdcore.c 	return mtd->_erase(mtd, instr);
mtd              1091 drivers/mtd/mtdcore.c int mtd_point(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen,
mtd              1098 drivers/mtd/mtdcore.c 	if (!mtd->_point)
mtd              1100 drivers/mtd/mtdcore.c 	if (from < 0 || from >= mtd->size || len > mtd->size - from)
mtd              1104 drivers/mtd/mtdcore.c 	return mtd->_point(mtd, from, len, retlen, virt, phys);
mtd              1109 drivers/mtd/mtdcore.c int mtd_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
mtd              1111 drivers/mtd/mtdcore.c 	if (!mtd->_unpoint)
mtd              1113 drivers/mtd/mtdcore.c 	if (from < 0 || from >= mtd->size || len > mtd->size - from)
mtd              1117 drivers/mtd/mtdcore.c 	return mtd->_unpoint(mtd, from, len);
mtd              1126 drivers/mtd/mtdcore.c unsigned long mtd_get_unmapped_area(struct mtd_info *mtd, unsigned long len,
mtd              1133 drivers/mtd/mtdcore.c 	ret = mtd_point(mtd, offset, len, &retlen, &virt, NULL);
mtd              1137 drivers/mtd/mtdcore.c 		mtd_unpoint(mtd, offset, retlen);
mtd              1144 drivers/mtd/mtdcore.c int mtd_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen,
mtd              1153 drivers/mtd/mtdcore.c 	ret = mtd_read_oob(mtd, from, &ops);
mtd              1160 drivers/mtd/mtdcore.c int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
mtd              1169 drivers/mtd/mtdcore.c 	ret = mtd_write_oob(mtd, to, &ops);
mtd              1183 drivers/mtd/mtdcore.c int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
mtd              1187 drivers/mtd/mtdcore.c 	if (!mtd->_panic_write)
mtd              1189 drivers/mtd/mtdcore.c 	if (to < 0 || to >= mtd->size || len > mtd->size - to)
mtd              1191 drivers/mtd/mtdcore.c 	if (!(mtd->flags & MTD_WRITEABLE))
mtd              1195 drivers/mtd/mtdcore.c 	if (!mtd->oops_panic_write)
mtd              1196 drivers/mtd/mtdcore.c 		mtd->oops_panic_write = true;
mtd              1198 drivers/mtd/mtdcore.c 	return mtd->_panic_write(mtd, to, len, retlen, buf);
mtd              1202 drivers/mtd/mtdcore.c static int mtd_check_oob_ops(struct mtd_info *mtd, loff_t offs,
mtd              1216 drivers/mtd/mtdcore.c 	if (offs < 0 || offs + ops->len > mtd->size)
mtd              1222 drivers/mtd/mtdcore.c 		if (ops->ooboffs >= mtd_oobavail(mtd, ops))
mtd              1225 drivers/mtd/mtdcore.c 		maxooblen = ((size_t)(mtd_div_by_ws(mtd->size, mtd) -
mtd              1226 drivers/mtd/mtdcore.c 				      mtd_div_by_ws(offs, mtd)) *
mtd              1227 drivers/mtd/mtdcore.c 			     mtd_oobavail(mtd, ops)) - ops->ooboffs;
mtd              1235 drivers/mtd/mtdcore.c int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops)
mtd              1240 drivers/mtd/mtdcore.c 	ret_code = mtd_check_oob_ops(mtd, from, ops);
mtd              1247 drivers/mtd/mtdcore.c 	if (!mtd->_read_oob && (!mtd->_read || ops->oobbuf))
mtd              1250 drivers/mtd/mtdcore.c 	if (mtd->_read_oob)
mtd              1251 drivers/mtd/mtdcore.c 		ret_code = mtd->_read_oob(mtd, from, ops);
mtd              1253 drivers/mtd/mtdcore.c 		ret_code = mtd->_read(mtd, from, ops->len, &ops->retlen,
mtd              1264 drivers/mtd/mtdcore.c 	if (mtd->ecc_strength == 0)
mtd              1266 drivers/mtd/mtdcore.c 	return ret_code >= mtd->bitflip_threshold ? -EUCLEAN : 0;
mtd              1270 drivers/mtd/mtdcore.c int mtd_write_oob(struct mtd_info *mtd, loff_t to,
mtd              1277 drivers/mtd/mtdcore.c 	if (!(mtd->flags & MTD_WRITEABLE))
mtd              1280 drivers/mtd/mtdcore.c 	ret = mtd_check_oob_ops(mtd, to, ops);
mtd              1287 drivers/mtd/mtdcore.c 	if (!mtd->_write_oob && (!mtd->_write || ops->oobbuf))
mtd              1290 drivers/mtd/mtdcore.c 	if (mtd->_write_oob)
mtd              1291 drivers/mtd/mtdcore.c 		return mtd->_write_oob(mtd, to, ops);
mtd              1293 drivers/mtd/mtdcore.c 		return mtd->_write(mtd, to, ops->len, &ops->retlen,
mtd              1314 drivers/mtd/mtdcore.c int mtd_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd              1319 drivers/mtd/mtdcore.c 	if (!mtd || section < 0)
mtd              1322 drivers/mtd/mtdcore.c 	if (!mtd->ooblayout || !mtd->ooblayout->ecc)
mtd              1325 drivers/mtd/mtdcore.c 	return mtd->ooblayout->ecc(mtd, section, oobecc);
mtd              1346 drivers/mtd/mtdcore.c int mtd_ooblayout_free(struct mtd_info *mtd, int section,
mtd              1351 drivers/mtd/mtdcore.c 	if (!mtd || section < 0)
mtd              1354 drivers/mtd/mtdcore.c 	if (!mtd->ooblayout || !mtd->ooblayout->free)
mtd              1357 drivers/mtd/mtdcore.c 	return mtd->ooblayout->free(mtd, section, oobfree);
mtd              1378 drivers/mtd/mtdcore.c static int mtd_ooblayout_find_region(struct mtd_info *mtd, int byte,
mtd              1389 drivers/mtd/mtdcore.c 		ret = iter(mtd, section, oobregion);
mtd              1424 drivers/mtd/mtdcore.c int mtd_ooblayout_find_eccregion(struct mtd_info *mtd, int eccbyte,
mtd              1428 drivers/mtd/mtdcore.c 	return mtd_ooblayout_find_region(mtd, eccbyte, section, oobregion,
mtd              1447 drivers/mtd/mtdcore.c static int mtd_ooblayout_get_bytes(struct mtd_info *mtd, u8 *buf,
mtd              1456 drivers/mtd/mtdcore.c 	ret = mtd_ooblayout_find_region(mtd, start, &section,
mtd              1470 drivers/mtd/mtdcore.c 		ret = iter(mtd, ++section, &oobregion);
mtd              1490 drivers/mtd/mtdcore.c static int mtd_ooblayout_set_bytes(struct mtd_info *mtd, const u8 *buf,
mtd              1499 drivers/mtd/mtdcore.c 	ret = mtd_ooblayout_find_region(mtd, start, &section,
mtd              1513 drivers/mtd/mtdcore.c 		ret = iter(mtd, ++section, &oobregion);
mtd              1528 drivers/mtd/mtdcore.c static int mtd_ooblayout_count_bytes(struct mtd_info *mtd,
mtd              1537 drivers/mtd/mtdcore.c 		ret = iter(mtd, section++, &oobregion);
mtd              1562 drivers/mtd/mtdcore.c int mtd_ooblayout_get_eccbytes(struct mtd_info *mtd, u8 *eccbuf,
mtd              1565 drivers/mtd/mtdcore.c 	return mtd_ooblayout_get_bytes(mtd, eccbuf, oobbuf, start, nbytes,
mtd              1582 drivers/mtd/mtdcore.c int mtd_ooblayout_set_eccbytes(struct mtd_info *mtd, const u8 *eccbuf,
mtd              1585 drivers/mtd/mtdcore.c 	return mtd_ooblayout_set_bytes(mtd, eccbuf, oobbuf, start, nbytes,
mtd              1602 drivers/mtd/mtdcore.c int mtd_ooblayout_get_databytes(struct mtd_info *mtd, u8 *databuf,
mtd              1605 drivers/mtd/mtdcore.c 	return mtd_ooblayout_get_bytes(mtd, databuf, oobbuf, start, nbytes,
mtd              1622 drivers/mtd/mtdcore.c int mtd_ooblayout_set_databytes(struct mtd_info *mtd, const u8 *databuf,
mtd              1625 drivers/mtd/mtdcore.c 	return mtd_ooblayout_set_bytes(mtd, databuf, oobbuf, start, nbytes,
mtd              1638 drivers/mtd/mtdcore.c int mtd_ooblayout_count_freebytes(struct mtd_info *mtd)
mtd              1640 drivers/mtd/mtdcore.c 	return mtd_ooblayout_count_bytes(mtd, mtd_ooblayout_free);
mtd              1652 drivers/mtd/mtdcore.c int mtd_ooblayout_count_eccbytes(struct mtd_info *mtd)
mtd              1654 drivers/mtd/mtdcore.c 	return mtd_ooblayout_count_bytes(mtd, mtd_ooblayout_ecc);
mtd              1663 drivers/mtd/mtdcore.c int mtd_get_fact_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen,
mtd              1666 drivers/mtd/mtdcore.c 	if (!mtd->_get_fact_prot_info)
mtd              1670 drivers/mtd/mtdcore.c 	return mtd->_get_fact_prot_info(mtd, len, retlen, buf);
mtd              1674 drivers/mtd/mtdcore.c int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from, size_t len,
mtd              1678 drivers/mtd/mtdcore.c 	if (!mtd->_read_fact_prot_reg)
mtd              1682 drivers/mtd/mtdcore.c 	return mtd->_read_fact_prot_reg(mtd, from, len, retlen, buf);
mtd              1686 drivers/mtd/mtdcore.c int mtd_get_user_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen,
mtd              1689 drivers/mtd/mtdcore.c 	if (!mtd->_get_user_prot_info)
mtd              1693 drivers/mtd/mtdcore.c 	return mtd->_get_user_prot_info(mtd, len, retlen, buf);
mtd              1697 drivers/mtd/mtdcore.c int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len,
mtd              1701 drivers/mtd/mtdcore.c 	if (!mtd->_read_user_prot_reg)
mtd              1705 drivers/mtd/mtdcore.c 	return mtd->_read_user_prot_reg(mtd, from, len, retlen, buf);
mtd              1709 drivers/mtd/mtdcore.c int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to, size_t len,
mtd              1715 drivers/mtd/mtdcore.c 	if (!mtd->_write_user_prot_reg)
mtd              1719 drivers/mtd/mtdcore.c 	ret = mtd->_write_user_prot_reg(mtd, to, len, retlen, buf);
mtd              1731 drivers/mtd/mtdcore.c int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len)
mtd              1733 drivers/mtd/mtdcore.c 	if (!mtd->_lock_user_prot_reg)
mtd              1737 drivers/mtd/mtdcore.c 	return mtd->_lock_user_prot_reg(mtd, from, len);
mtd              1742 drivers/mtd/mtdcore.c int mtd_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd              1744 drivers/mtd/mtdcore.c 	if (!mtd->_lock)
mtd              1746 drivers/mtd/mtdcore.c 	if (ofs < 0 || ofs >= mtd->size || len > mtd->size - ofs)
mtd              1750 drivers/mtd/mtdcore.c 	return mtd->_lock(mtd, ofs, len);
mtd              1754 drivers/mtd/mtdcore.c int mtd_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd              1756 drivers/mtd/mtdcore.c 	if (!mtd->_unlock)
mtd              1758 drivers/mtd/mtdcore.c 	if (ofs < 0 || ofs >= mtd->size || len > mtd->size - ofs)
mtd              1762 drivers/mtd/mtdcore.c 	return mtd->_unlock(mtd, ofs, len);
mtd              1766 drivers/mtd/mtdcore.c int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd              1768 drivers/mtd/mtdcore.c 	if (!mtd->_is_locked)
mtd              1770 drivers/mtd/mtdcore.c 	if (ofs < 0 || ofs >= mtd->size || len > mtd->size - ofs)
mtd              1774 drivers/mtd/mtdcore.c 	return mtd->_is_locked(mtd, ofs, len);
mtd              1778 drivers/mtd/mtdcore.c int mtd_block_isreserved(struct mtd_info *mtd, loff_t ofs)
mtd              1780 drivers/mtd/mtdcore.c 	if (ofs < 0 || ofs >= mtd->size)
mtd              1782 drivers/mtd/mtdcore.c 	if (!mtd->_block_isreserved)
mtd              1784 drivers/mtd/mtdcore.c 	return mtd->_block_isreserved(mtd, ofs);
mtd              1788 drivers/mtd/mtdcore.c int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs)
mtd              1790 drivers/mtd/mtdcore.c 	if (ofs < 0 || ofs >= mtd->size)
mtd              1792 drivers/mtd/mtdcore.c 	if (!mtd->_block_isbad)
mtd              1794 drivers/mtd/mtdcore.c 	return mtd->_block_isbad(mtd, ofs);
mtd              1798 drivers/mtd/mtdcore.c int mtd_block_markbad(struct mtd_info *mtd, loff_t ofs)
mtd              1800 drivers/mtd/mtdcore.c 	if (!mtd->_block_markbad)
mtd              1802 drivers/mtd/mtdcore.c 	if (ofs < 0 || ofs >= mtd->size)
mtd              1804 drivers/mtd/mtdcore.c 	if (!(mtd->flags & MTD_WRITEABLE))
mtd              1806 drivers/mtd/mtdcore.c 	return mtd->_block_markbad(mtd, ofs);
mtd              1821 drivers/mtd/mtdcore.c static int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
mtd              1831 drivers/mtd/mtdcore.c 		ret = mtd_write(mtd, to, vecs[i].iov_len, &thislen,
mtd              1853 drivers/mtd/mtdcore.c int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
mtd              1857 drivers/mtd/mtdcore.c 	if (!(mtd->flags & MTD_WRITEABLE))
mtd              1859 drivers/mtd/mtdcore.c 	if (!mtd->_writev)
mtd              1860 drivers/mtd/mtdcore.c 		return default_mtd_writev(mtd, vecs, count, to, retlen);
mtd              1861 drivers/mtd/mtdcore.c 	return mtd->_writev(mtd, vecs, count, to, retlen);
mtd              1889 drivers/mtd/mtdcore.c void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size)
mtd              1892 drivers/mtd/mtdcore.c 	size_t min_alloc = max_t(size_t, mtd->writesize, PAGE_SIZE);
mtd              1903 drivers/mtd/mtdcore.c 		*size = ALIGN(*size, mtd->writesize);
mtd              1921 drivers/mtd/mtdcore.c 	struct mtd_info *mtd;
mtd              1925 drivers/mtd/mtdcore.c 	mtd_for_each_device(mtd) {
mtd              1927 drivers/mtd/mtdcore.c 			   mtd->index, (unsigned long long)mtd->size,
mtd              1928 drivers/mtd/mtdcore.c 			   mtd->erasesize, mtd->name);
mtd                11 drivers/mtd/mtdcore.h int __must_check add_mtd_device(struct mtd_info *mtd);
mtd                12 drivers/mtd/mtdcore.h int del_mtd_device(struct mtd_info *mtd);
mtd                26 drivers/mtd/mtdcore.h #define mtd_for_each_device(mtd)			\
mtd                27 drivers/mtd/mtdcore.h 	for ((mtd) = __mtd_next_device(0);		\
mtd                28 drivers/mtd/mtdcore.h 	     (mtd) != NULL;				\
mtd                29 drivers/mtd/mtdcore.h 	     (mtd) = __mtd_next_device(mtd->index + 1))
mtd                49 drivers/mtd/mtdoops.c 	struct mtd_info *mtd;
mtd                75 drivers/mtd/mtdoops.c 	struct mtd_info *mtd = cxt->mtd;
mtd                76 drivers/mtd/mtdoops.c 	u32 start_page_offset = mtd_div_by_eb(offset, mtd) * mtd->erasesize;
mtd                78 drivers/mtd/mtdoops.c 	u32 erase_pages = mtd->erasesize / record_size;
mtd                84 drivers/mtd/mtdoops.c 	erase.len = mtd->erasesize;
mtd                86 drivers/mtd/mtdoops.c 	ret = mtd_erase(mtd, &erase);
mtd               124 drivers/mtd/mtdoops.c 	struct mtd_info *mtd = cxt->mtd;
mtd               128 drivers/mtd/mtdoops.c 	if (!mtd)
mtd               131 drivers/mtd/mtdoops.c 	mod = (cxt->nextpage * record_size) % mtd->erasesize;
mtd               133 drivers/mtd/mtdoops.c 		cxt->nextpage = cxt->nextpage + ((mtd->erasesize - mod) / record_size);
mtd               138 drivers/mtd/mtdoops.c 	while ((ret = mtd_block_isbad(mtd, cxt->nextpage * record_size)) > 0) {
mtd               143 drivers/mtd/mtdoops.c 		cxt->nextpage = cxt->nextpage + (mtd->erasesize / record_size);
mtd               146 drivers/mtd/mtdoops.c 		if (i == cxt->oops_pages / (mtd->erasesize / record_size)) {
mtd               167 drivers/mtd/mtdoops.c 		ret = mtd_block_markbad(mtd, cxt->nextpage * record_size);
mtd               178 drivers/mtd/mtdoops.c 	struct mtd_info *mtd = cxt->mtd;
mtd               189 drivers/mtd/mtdoops.c 		ret = mtd_panic_write(mtd, cxt->nextpage * record_size,
mtd               196 drivers/mtd/mtdoops.c 		ret = mtd_write(mtd, cxt->nextpage * record_size,
mtd               218 drivers/mtd/mtdoops.c 	struct mtd_info *mtd = cxt->mtd;
mtd               224 drivers/mtd/mtdoops.c 		if (mtd_block_isbad(mtd, page * record_size))
mtd               228 drivers/mtd/mtdoops.c 		ret = mtd_read(mtd, page * record_size, MTDOOPS_HEADER_SIZE,
mtd               290 drivers/mtd/mtdoops.c static void mtdoops_notify_add(struct mtd_info *mtd)
mtd               293 drivers/mtd/mtdoops.c 	u64 mtdoops_pages = div_u64(mtd->size, record_size);
mtd               296 drivers/mtd/mtdoops.c 	if (!strcmp(mtd->name, mtddev))
mtd               297 drivers/mtd/mtdoops.c 		cxt->mtd_index = mtd->index;
mtd               299 drivers/mtd/mtdoops.c 	if (mtd->index != cxt->mtd_index || cxt->mtd_index < 0)
mtd               302 drivers/mtd/mtdoops.c 	if (mtd->size < mtd->erasesize * 2) {
mtd               304 drivers/mtd/mtdoops.c 		       mtd->index);
mtd               307 drivers/mtd/mtdoops.c 	if (mtd->erasesize < record_size) {
mtd               309 drivers/mtd/mtdoops.c 		       mtd->index);
mtd               312 drivers/mtd/mtdoops.c 	if (mtd->size > MTDOOPS_MAX_MTD_SIZE) {
mtd               314 drivers/mtd/mtdoops.c 		       mtd->index, MTDOOPS_MAX_MTD_SIZE / 1024 / 1024);
mtd               338 drivers/mtd/mtdoops.c 	cxt->mtd = mtd;
mtd               339 drivers/mtd/mtdoops.c 	cxt->oops_pages = (int)mtd->size / record_size;
mtd               341 drivers/mtd/mtdoops.c 	printk(KERN_INFO "mtdoops: Attached to MTD device %d\n", mtd->index);
mtd               344 drivers/mtd/mtdoops.c static void mtdoops_notify_remove(struct mtd_info *mtd)
mtd               348 drivers/mtd/mtdoops.c 	if (mtd->index != cxt->mtd_index || cxt->mtd_index < 0)
mtd               354 drivers/mtd/mtdoops.c 	cxt->mtd = NULL;
mtd                35 drivers/mtd/mtdpart.c 	struct mtd_info mtd;
mtd                45 drivers/mtd/mtdpart.c static inline struct mtd_part *mtd_to_part(const struct mtd_info *mtd)
mtd                47 drivers/mtd/mtdpart.c 	return container_of(mtd, struct mtd_part, mtd);
mtd                50 drivers/mtd/mtdpart.c static u64 part_absolute_offset(struct mtd_info *mtd)
mtd                52 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd                54 drivers/mtd/mtdpart.c 	if (!mtd_is_partition(mtd))
mtd                65 drivers/mtd/mtdpart.c static int part_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd                68 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd                76 drivers/mtd/mtdpart.c 		mtd->ecc_stats.failed +=
mtd                79 drivers/mtd/mtdpart.c 		mtd->ecc_stats.corrected +=
mtd                84 drivers/mtd/mtdpart.c static int part_point(struct mtd_info *mtd, loff_t from, size_t len,
mtd                87 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd                93 drivers/mtd/mtdpart.c static int part_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
mtd                95 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               100 drivers/mtd/mtdpart.c static int part_read_oob(struct mtd_info *mtd, loff_t from,
mtd               103 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               110 drivers/mtd/mtdpart.c 		mtd->ecc_stats.failed +=
mtd               113 drivers/mtd/mtdpart.c 		mtd->ecc_stats.corrected +=
mtd               118 drivers/mtd/mtdpart.c static int part_read_user_prot_reg(struct mtd_info *mtd, loff_t from,
mtd               121 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               126 drivers/mtd/mtdpart.c static int part_get_user_prot_info(struct mtd_info *mtd, size_t len,
mtd               129 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               134 drivers/mtd/mtdpart.c static int part_read_fact_prot_reg(struct mtd_info *mtd, loff_t from,
mtd               137 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               142 drivers/mtd/mtdpart.c static int part_get_fact_prot_info(struct mtd_info *mtd, size_t len,
mtd               145 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               150 drivers/mtd/mtdpart.c static int part_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd               153 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               158 drivers/mtd/mtdpart.c static int part_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd               161 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               166 drivers/mtd/mtdpart.c static int part_write_oob(struct mtd_info *mtd, loff_t to,
mtd               169 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               174 drivers/mtd/mtdpart.c static int part_write_user_prot_reg(struct mtd_info *mtd, loff_t from,
mtd               177 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               182 drivers/mtd/mtdpart.c static int part_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
mtd               185 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               189 drivers/mtd/mtdpart.c static int part_writev(struct mtd_info *mtd, const struct kvec *vecs,
mtd               192 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               197 drivers/mtd/mtdpart.c static int part_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd               199 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               211 drivers/mtd/mtdpart.c static int part_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd               213 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               217 drivers/mtd/mtdpart.c static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd               219 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               223 drivers/mtd/mtdpart.c static int part_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd               225 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               229 drivers/mtd/mtdpart.c static void part_sync(struct mtd_info *mtd)
mtd               231 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               235 drivers/mtd/mtdpart.c static int part_suspend(struct mtd_info *mtd)
mtd               237 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               241 drivers/mtd/mtdpart.c static void part_resume(struct mtd_info *mtd)
mtd               243 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               247 drivers/mtd/mtdpart.c static int part_block_isreserved(struct mtd_info *mtd, loff_t ofs)
mtd               249 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               254 drivers/mtd/mtdpart.c static int part_block_isbad(struct mtd_info *mtd, loff_t ofs)
mtd               256 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               261 drivers/mtd/mtdpart.c static int part_block_markbad(struct mtd_info *mtd, loff_t ofs)
mtd               263 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               269 drivers/mtd/mtdpart.c 		mtd->ecc_stats.badblocks++;
mtd               273 drivers/mtd/mtdpart.c static int part_get_device(struct mtd_info *mtd)
mtd               275 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               279 drivers/mtd/mtdpart.c static void part_put_device(struct mtd_info *mtd)
mtd               281 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               285 drivers/mtd/mtdpart.c static int part_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               288 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               293 drivers/mtd/mtdpart.c static int part_ooblayout_free(struct mtd_info *mtd, int section,
mtd               296 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               306 drivers/mtd/mtdpart.c static int part_max_bad_blocks(struct mtd_info *mtd, loff_t ofs, size_t len)
mtd               308 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               316 drivers/mtd/mtdpart.c 	kfree(p->mtd.name);
mtd               343 drivers/mtd/mtdpart.c 	slave->mtd.type = parent->type;
mtd               344 drivers/mtd/mtdpart.c 	slave->mtd.flags = parent->orig_flags & ~part->mask_flags;
mtd               345 drivers/mtd/mtdpart.c 	slave->mtd.orig_flags = slave->mtd.flags;
mtd               346 drivers/mtd/mtdpart.c 	slave->mtd.size = part->size;
mtd               347 drivers/mtd/mtdpart.c 	slave->mtd.writesize = parent->writesize;
mtd               348 drivers/mtd/mtdpart.c 	slave->mtd.writebufsize = parent->writebufsize;
mtd               349 drivers/mtd/mtdpart.c 	slave->mtd.oobsize = parent->oobsize;
mtd               350 drivers/mtd/mtdpart.c 	slave->mtd.oobavail = parent->oobavail;
mtd               351 drivers/mtd/mtdpart.c 	slave->mtd.subpage_sft = parent->subpage_sft;
mtd               352 drivers/mtd/mtdpart.c 	slave->mtd.pairing = parent->pairing;
mtd               354 drivers/mtd/mtdpart.c 	slave->mtd.name = name;
mtd               355 drivers/mtd/mtdpart.c 	slave->mtd.owner = parent->owner;
mtd               365 drivers/mtd/mtdpart.c 	slave->mtd.dev.parent = IS_ENABLED(CONFIG_MTD_PARTITIONED_MASTER) || mtd_is_partition(parent) ?
mtd               368 drivers/mtd/mtdpart.c 	slave->mtd.dev.of_node = part->of_node;
mtd               371 drivers/mtd/mtdpart.c 		slave->mtd._read = part_read;
mtd               373 drivers/mtd/mtdpart.c 		slave->mtd._write = part_write;
mtd               376 drivers/mtd/mtdpart.c 		slave->mtd._panic_write = part_panic_write;
mtd               379 drivers/mtd/mtdpart.c 		slave->mtd._point = part_point;
mtd               380 drivers/mtd/mtdpart.c 		slave->mtd._unpoint = part_unpoint;
mtd               384 drivers/mtd/mtdpart.c 		slave->mtd._read_oob = part_read_oob;
mtd               386 drivers/mtd/mtdpart.c 		slave->mtd._write_oob = part_write_oob;
mtd               388 drivers/mtd/mtdpart.c 		slave->mtd._read_user_prot_reg = part_read_user_prot_reg;
mtd               390 drivers/mtd/mtdpart.c 		slave->mtd._read_fact_prot_reg = part_read_fact_prot_reg;
mtd               392 drivers/mtd/mtdpart.c 		slave->mtd._write_user_prot_reg = part_write_user_prot_reg;
mtd               394 drivers/mtd/mtdpart.c 		slave->mtd._lock_user_prot_reg = part_lock_user_prot_reg;
mtd               396 drivers/mtd/mtdpart.c 		slave->mtd._get_user_prot_info = part_get_user_prot_info;
mtd               398 drivers/mtd/mtdpart.c 		slave->mtd._get_fact_prot_info = part_get_fact_prot_info;
mtd               400 drivers/mtd/mtdpart.c 		slave->mtd._sync = part_sync;
mtd               403 drivers/mtd/mtdpart.c 		slave->mtd._suspend = part_suspend;
mtd               404 drivers/mtd/mtdpart.c 		slave->mtd._resume = part_resume;
mtd               407 drivers/mtd/mtdpart.c 		slave->mtd._writev = part_writev;
mtd               409 drivers/mtd/mtdpart.c 		slave->mtd._lock = part_lock;
mtd               411 drivers/mtd/mtdpart.c 		slave->mtd._unlock = part_unlock;
mtd               413 drivers/mtd/mtdpart.c 		slave->mtd._is_locked = part_is_locked;
mtd               415 drivers/mtd/mtdpart.c 		slave->mtd._block_isreserved = part_block_isreserved;
mtd               417 drivers/mtd/mtdpart.c 		slave->mtd._block_isbad = part_block_isbad;
mtd               419 drivers/mtd/mtdpart.c 		slave->mtd._block_markbad = part_block_markbad;
mtd               421 drivers/mtd/mtdpart.c 		slave->mtd._max_bad_blocks = part_max_bad_blocks;
mtd               424 drivers/mtd/mtdpart.c 		slave->mtd._get_device = part_get_device;
mtd               426 drivers/mtd/mtdpart.c 		slave->mtd._put_device = part_put_device;
mtd               428 drivers/mtd/mtdpart.c 	slave->mtd._erase = part_erase;
mtd               447 drivers/mtd/mtdpart.c 		if (parent->size - slave->offset >= slave->mtd.size) {
mtd               448 drivers/mtd/mtdpart.c 			slave->mtd.size = parent->size - slave->offset
mtd               449 drivers/mtd/mtdpart.c 							- slave->mtd.size;
mtd               453 drivers/mtd/mtdpart.c 				slave->mtd.size);
mtd               458 drivers/mtd/mtdpart.c 	if (slave->mtd.size == MTDPART_SIZ_FULL)
mtd               459 drivers/mtd/mtdpart.c 		slave->mtd.size = parent->size - slave->offset;
mtd               462 drivers/mtd/mtdpart.c 		(unsigned long long)(slave->offset + slave->mtd.size), slave->mtd.name);
mtd               468 drivers/mtd/mtdpart.c 		slave->mtd.size = 0;
mtd               471 drivers/mtd/mtdpart.c 		slave->mtd.erasesize = parent->erasesize;
mtd               477 drivers/mtd/mtdpart.c 	if (slave->offset + slave->mtd.size > parent->size) {
mtd               478 drivers/mtd/mtdpart.c 		slave->mtd.size = parent->size - slave->offset;
mtd               480 drivers/mtd/mtdpart.c 			part->name, parent->name, (unsigned long long)slave->mtd.size);
mtd               485 drivers/mtd/mtdpart.c 		u64 end = slave->offset + slave->mtd.size;
mtd               498 drivers/mtd/mtdpart.c 			if (slave->mtd.erasesize < regions[i].erasesize) {
mtd               499 drivers/mtd/mtdpart.c 				slave->mtd.erasesize = regions[i].erasesize;
mtd               502 drivers/mtd/mtdpart.c 		BUG_ON(slave->mtd.erasesize == 0);
mtd               505 drivers/mtd/mtdpart.c 		slave->mtd.erasesize = parent->erasesize;
mtd               513 drivers/mtd/mtdpart.c 	if (!(slave->mtd.flags & MTD_NO_ERASE))
mtd               514 drivers/mtd/mtdpart.c 		wr_alignment = slave->mtd.erasesize;
mtd               518 drivers/mtd/mtdpart.c 	if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) {
mtd               522 drivers/mtd/mtdpart.c 		slave->mtd.flags &= ~MTD_WRITEABLE;
mtd               527 drivers/mtd/mtdpart.c 	tmp = part_absolute_offset(parent) + slave->mtd.size;
mtd               529 drivers/mtd/mtdpart.c 	if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) {
mtd               530 drivers/mtd/mtdpart.c 		slave->mtd.flags &= ~MTD_WRITEABLE;
mtd               535 drivers/mtd/mtdpart.c 	mtd_set_ooblayout(&slave->mtd, &part_ooblayout_ops);
mtd               536 drivers/mtd/mtdpart.c 	slave->mtd.ecc_step_size = parent->ecc_step_size;
mtd               537 drivers/mtd/mtdpart.c 	slave->mtd.ecc_strength = parent->ecc_strength;
mtd               538 drivers/mtd/mtdpart.c 	slave->mtd.bitflip_threshold = parent->bitflip_threshold;
mtd               543 drivers/mtd/mtdpart.c 		while (offs < slave->mtd.size) {
mtd               545 drivers/mtd/mtdpart.c 				slave->mtd.ecc_stats.bbtblocks++;
mtd               547 drivers/mtd/mtdpart.c 				slave->mtd.ecc_stats.badblocks++;
mtd               548 drivers/mtd/mtdpart.c 			offs += slave->mtd.erasesize;
mtd               559 drivers/mtd/mtdpart.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               560 drivers/mtd/mtdpart.c 	struct mtd_part *part = mtd_to_part(mtd);
mtd               573 drivers/mtd/mtdpart.c 	int ret = sysfs_create_files(&new->mtd.dev.kobj, mtd_partition_attrs);
mtd               611 drivers/mtd/mtdpart.c 	ret = add_mtd_device(&new->mtd);
mtd               643 drivers/mtd/mtdpart.c 		if (child->parent == &priv->mtd) {
mtd               650 drivers/mtd/mtdpart.c 	sysfs_remove_files(&priv->mtd.dev.kobj, mtd_partition_attrs);
mtd               652 drivers/mtd/mtdpart.c 	err = del_mtd_device(&priv->mtd);
mtd               666 drivers/mtd/mtdpart.c int del_mtd_partitions(struct mtd_info *mtd)
mtd               673 drivers/mtd/mtdpart.c 		if (slave->parent == mtd) {
mtd               683 drivers/mtd/mtdpart.c int mtd_del_partition(struct mtd_info *mtd, int partno)
mtd               690 drivers/mtd/mtdpart.c 		if ((slave->parent == mtd) &&
mtd               691 drivers/mtd/mtdpart.c 		    (slave->mtd.index == partno)) {
mtd               731 drivers/mtd/mtdpart.c 		ret = add_mtd_device(&slave->mtd);
mtd               743 drivers/mtd/mtdpart.c 		parse_mtd_partitions(&slave->mtd, parts[i].types, NULL);
mtd               745 drivers/mtd/mtdpart.c 		cur_offset = slave->offset + slave->mtd.size;
mtd              1026 drivers/mtd/mtdpart.c int mtd_is_partition(const struct mtd_info *mtd)
mtd              1033 drivers/mtd/mtdpart.c 		if (&part->mtd == mtd) {
mtd              1044 drivers/mtd/mtdpart.c uint64_t mtd_get_device_size(const struct mtd_info *mtd)
mtd              1046 drivers/mtd/mtdpart.c 	if (!mtd_is_partition(mtd))
mtd              1047 drivers/mtd/mtdpart.c 		return mtd->size;
mtd              1049 drivers/mtd/mtdpart.c 	return mtd_get_device_size(mtd_to_part(mtd)->parent);
mtd                27 drivers/mtd/mtdsuper.c 	struct mtd_info *mtd = fc->sget_key;
mtd                31 drivers/mtd/mtdsuper.c 			 mtd->index, mtd->name);
mtd                36 drivers/mtd/mtdsuper.c 		 sb->s_mtd->index, sb->s_mtd->name, mtd->index, mtd->name);
mtd                57 drivers/mtd/mtdsuper.c 		      struct mtd_info *mtd,
mtd                64 drivers/mtd/mtdsuper.c 	fc->sget_key = mtd;
mtd                72 drivers/mtd/mtdsuper.c 			 mtd->index, mtd->name);
mtd                73 drivers/mtd/mtdsuper.c 		put_mtd_device(mtd);
mtd                77 drivers/mtd/mtdsuper.c 			 mtd->index, mtd->name);
mtd               102 drivers/mtd/mtdsuper.c 	struct mtd_info *mtd;
mtd               104 drivers/mtd/mtdsuper.c 	mtd = get_mtd_device(NULL, mtdnr);
mtd               105 drivers/mtd/mtdsuper.c 	if (IS_ERR(mtd)) {
mtd               107 drivers/mtd/mtdsuper.c 		return PTR_ERR(mtd);
mtd               110 drivers/mtd/mtdsuper.c 	return mtd_get_sb(fc, mtd, fill_super);
mtd               142 drivers/mtd/mtdsuper.c 			struct mtd_info *mtd;
mtd               148 drivers/mtd/mtdsuper.c 			mtd = get_mtd_device_nm(fc->source + 4);
mtd               149 drivers/mtd/mtdsuper.c 			if (!IS_ERR(mtd))
mtd               150 drivers/mtd/mtdsuper.c 				return mtd_get_sb(fc, mtd, fill_super);
mtd               102 drivers/mtd/mtdswap.c 	struct mtd_info *mtd;
mtd               186 drivers/mtd/mtdswap.c 	return (loff_t)(eb - d->eb_data) * d->mtd->erasesize;
mtd               262 drivers/mtd/mtdswap.c 	if (!mtd_can_have_bb(d->mtd))
mtd               267 drivers/mtd/mtdswap.c 	ret = mtd_block_markbad(d->mtd, offset);
mtd               300 drivers/mtd/mtdswap.c 	int ret = mtd_read_oob(d->mtd, from, ops);
mtd               331 drivers/mtd/mtdswap.c 	if (mtd_can_have_bb(d->mtd) && mtd_block_isbad(d->mtd, offset))
mtd               334 drivers/mtd/mtdswap.c 	ops.ooblen = 2 * d->mtd->oobavail;
mtd               347 drivers/mtd/mtdswap.c 		(d->oob_buf + d->mtd->oobavail);
mtd               388 drivers/mtd/mtdswap.c 		offset = mtdswap_eb_offset(d, eb) + d->mtd->writesize;
mtd               391 drivers/mtd/mtdswap.c 	ret = mtd_write_oob(d->mtd, offset, &ops);
mtd               528 drivers/mtd/mtdswap.c 	struct mtd_info *mtd = d->mtd;
mtd               540 drivers/mtd/mtdswap.c 	erase.len	= mtd->erasesize;
mtd               542 drivers/mtd/mtdswap.c 	ret = mtd_erase(mtd, &erase);
mtd               547 drivers/mtd/mtdswap.c 				erase.addr, mtd->name);
mtd               553 drivers/mtd/mtdswap.c 			erase.addr, mtd->name);
mtd               617 drivers/mtd/mtdswap.c 	struct mtd_info *mtd = d->mtd;
mtd               643 drivers/mtd/mtdswap.c 	ret =  mtd_write(mtd, writepos, PAGE_SIZE, &retlen, buf);
mtd               678 drivers/mtd/mtdswap.c 	struct mtd_info *mtd = d->mtd;
mtd               690 drivers/mtd/mtdswap.c 	ret = mtd_read(mtd, readpos, PAGE_SIZE, &retlen, d->page_buf);
mtd               877 drivers/mtd/mtdswap.c 	struct mtd_info *mtd = d->mtd;
mtd               886 drivers/mtd/mtdswap.c 	ops.len = mtd->writesize;
mtd               887 drivers/mtd/mtdswap.c 	ops.ooblen = mtd->oobavail;
mtd               892 drivers/mtd/mtdswap.c 	mtd_pages = d->pages_per_eblk * PAGE_SIZE / mtd->writesize;
mtd               898 drivers/mtd/mtdswap.c 			memset(d->page_buf, patt, mtd->writesize);
mtd               899 drivers/mtd/mtdswap.c 			memset(d->oob_buf, patt, mtd->oobavail);
mtd               900 drivers/mtd/mtdswap.c 			ret = mtd_write_oob(mtd, pos, &ops);
mtd               904 drivers/mtd/mtdswap.c 			pos += mtd->writesize;
mtd               909 drivers/mtd/mtdswap.c 			ret = mtd_read_oob(mtd, pos, &ops);
mtd               914 drivers/mtd/mtdswap.c 			for (j = 0; j < mtd->writesize/sizeof(int); j++)
mtd               918 drivers/mtd/mtdswap.c 			for (j = 0; j < mtd->oobavail; j++)
mtd               922 drivers/mtd/mtdswap.c 			pos += mtd->writesize;
mtd              1001 drivers/mtd/mtdswap.c 	mtd_sync(d->mtd);
mtd              1005 drivers/mtd/mtdswap.c static unsigned int mtdswap_badblocks(struct mtd_info *mtd, uint64_t size)
mtd              1012 drivers/mtd/mtdswap.c 	if (mtd_can_have_bb(mtd))
mtd              1013 drivers/mtd/mtdswap.c 		for (offset = 0; offset < size; offset += mtd->erasesize)
mtd              1014 drivers/mtd/mtdswap.c 			if (mtd_block_isbad(mtd, offset))
mtd              1082 drivers/mtd/mtdswap.c 	struct mtd_info *mtd = d->mtd;
mtd              1114 drivers/mtd/mtdswap.c 	ret = mtd_read(mtd, readpos, PAGE_SIZE, &retlen, buf);
mtd              1206 drivers/mtd/mtdswap.c 	use_size = (uint64_t)d->eblks * d->mtd->erasesize;
mtd              1207 drivers/mtd/mtdswap.c 	bb_cnt = mtdswap_badblocks(d->mtd, use_size);
mtd              1259 drivers/mtd/mtdswap.c 	struct dentry *root = d->mtd->dbg.dfs_dir;
mtd              1281 drivers/mtd/mtdswap.c 	struct mtd_info *mtd = d->mbd_dev->mtd;
mtd              1285 drivers/mtd/mtdswap.c 	d->mtd = mtd;
mtd              1288 drivers/mtd/mtdswap.c 	d->pages_per_eblk = mtd->erasesize >> PAGE_SHIFT;
mtd              1319 drivers/mtd/mtdswap.c 	d->oob_buf = kmalloc_array(2, mtd->oobavail, GFP_KERNEL);
mtd              1340 drivers/mtd/mtdswap.c static void mtdswap_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
mtd              1359 drivers/mtd/mtdswap.c 		if (mtd->index == part)
mtd              1363 drivers/mtd/mtdswap.c 	if (mtd->index != part)
mtd              1366 drivers/mtd/mtdswap.c 	if (mtd->erasesize < PAGE_SIZE || mtd->erasesize % PAGE_SIZE) {
mtd              1368 drivers/mtd/mtdswap.c 			"%lu\n", MTDSWAP_PREFIX, mtd->erasesize, PAGE_SIZE);
mtd              1372 drivers/mtd/mtdswap.c 	if (PAGE_SIZE % mtd->writesize || mtd->writesize > PAGE_SIZE) {
mtd              1374 drivers/mtd/mtdswap.c 			" %u\n", MTDSWAP_PREFIX, PAGE_SIZE, mtd->writesize);
mtd              1378 drivers/mtd/mtdswap.c 	if (!mtd->oobsize || mtd->oobavail < MTDSWAP_OOBSIZE) {
mtd              1381 drivers/mtd/mtdswap.c 			MTDSWAP_PREFIX, mtd->oobavail, MTDSWAP_OOBSIZE);
mtd              1388 drivers/mtd/mtdswap.c 	use_size = mtd->size;
mtd              1391 drivers/mtd/mtdswap.c 	if (mtd->size > size_limit) {
mtd              1397 drivers/mtd/mtdswap.c 	eblocks = mtd_div_by_eb(use_size, mtd);
mtd              1398 drivers/mtd/mtdswap.c 	use_size = (uint64_t)eblocks * mtd->erasesize;
mtd              1399 drivers/mtd/mtdswap.c 	bad_blocks = mtdswap_badblocks(mtd, use_size);
mtd              1417 drivers/mtd/mtdswap.c 	swap_size = (uint64_t)(eavailable - spare_cnt) * mtd->erasesize +
mtd              1437 drivers/mtd/mtdswap.c 	mbd_dev->mtd = mtd;
mtd              1438 drivers/mtd/mtdswap.c 	mbd_dev->devnum = mtd->index;
mtd              1442 drivers/mtd/mtdswap.c 	if (!(mtd->flags & MTD_WRITEABLE))
mtd                63 drivers/mtd/nand/core.c 	struct mtd_info *mtd = nanddev_to_mtd(nand);
mtd                87 drivers/mtd/nand/core.c 		mtd->ecc_stats.badblocks++;
mtd               153 drivers/mtd/nand/core.c int nanddev_mtd_erase(struct mtd_info *mtd, struct erase_info *einfo)
mtd               155 drivers/mtd/nand/core.c 	struct nand_device *nand = mtd_to_nanddev(mtd);
mtd               189 drivers/mtd/nand/core.c int nanddev_mtd_max_bad_blocks(struct mtd_info *mtd, loff_t offs, size_t len)
mtd               191 drivers/mtd/nand/core.c 	struct nand_device *nand = mtd_to_nanddev(mtd);
mtd               224 drivers/mtd/nand/core.c 	struct mtd_info *mtd = nanddev_to_mtd(nand);
mtd               246 drivers/mtd/nand/core.c 	mtd->type = memorg->bits_per_cell == 1 ?
mtd               248 drivers/mtd/nand/core.c 	mtd->flags = MTD_CAP_NANDFLASH;
mtd               249 drivers/mtd/nand/core.c 	mtd->erasesize = memorg->pagesize * memorg->pages_per_eraseblock;
mtd               250 drivers/mtd/nand/core.c 	mtd->writesize = memorg->pagesize;
mtd               251 drivers/mtd/nand/core.c 	mtd->writebufsize = memorg->pagesize;
mtd               252 drivers/mtd/nand/core.c 	mtd->oobsize = memorg->oobsize;
mtd               253 drivers/mtd/nand/core.c 	mtd->size = nanddev_size(nand);
mtd               254 drivers/mtd/nand/core.c 	mtd->owner = owner;
mtd                28 drivers/mtd/nand/onenand/generic.c 	struct mtd_info		mtd;
mtd                58 drivers/mtd/nand/onenand/generic.c 	info->mtd.dev.parent = &pdev->dev;
mtd                59 drivers/mtd/nand/onenand/generic.c 	info->mtd.priv = &info->onenand;
mtd                61 drivers/mtd/nand/onenand/generic.c 	if (onenand_scan(&info->mtd, 1)) {
mtd                66 drivers/mtd/nand/onenand/generic.c 	err = mtd_device_register(&info->mtd, pdata ? pdata->parts : NULL,
mtd                90 drivers/mtd/nand/onenand/generic.c 		onenand_release(&info->mtd);
mtd                38 drivers/mtd/nand/onenand/omap2.c 	struct mtd_info mtd;
mtd               142 drivers/mtd/nand/onenand/omap2.c static int omap2_onenand_wait(struct mtd_info *mtd, int state)
mtd               144 drivers/mtd/nand/onenand/omap2.c 	struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd);
mtd               145 drivers/mtd/nand/onenand/omap2.c 	struct onenand_chip *this = mtd->priv;
mtd               278 drivers/mtd/nand/onenand/omap2.c 				mtd->ecc_stats.failed++;
mtd               284 drivers/mtd/nand/onenand/omap2.c 				mtd->ecc_stats.corrected++;
mtd               310 drivers/mtd/nand/onenand/omap2.c static inline int omap2_onenand_bufferram_offset(struct mtd_info *mtd, int area)
mtd               312 drivers/mtd/nand/onenand/omap2.c 	struct onenand_chip *this = mtd->priv;
mtd               318 drivers/mtd/nand/onenand/omap2.c 			return mtd->oobsize;
mtd               360 drivers/mtd/nand/onenand/omap2.c static int omap2_onenand_read_bufferram(struct mtd_info *mtd, int area,
mtd               364 drivers/mtd/nand/onenand/omap2.c 	struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd);
mtd               365 drivers/mtd/nand/onenand/omap2.c 	struct onenand_chip *this = mtd->priv;
mtd               372 drivers/mtd/nand/onenand/omap2.c 	bram_offset = omap2_onenand_bufferram_offset(mtd, area) + area + offset;
mtd               408 drivers/mtd/nand/onenand/omap2.c static int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area,
mtd               412 drivers/mtd/nand/onenand/omap2.c 	struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd);
mtd               413 drivers/mtd/nand/onenand/omap2.c 	struct onenand_chip *this = mtd->priv;
mtd               419 drivers/mtd/nand/onenand/omap2.c 	bram_offset = omap2_onenand_bufferram_offset(mtd, area) + area + offset;
mtd               524 drivers/mtd/nand/onenand/omap2.c 	c->mtd.priv = &c->onenand;
mtd               525 drivers/mtd/nand/onenand/omap2.c 	c->mtd.dev.parent = dev;
mtd               526 drivers/mtd/nand/onenand/omap2.c 	mtd_set_of_node(&c->mtd, dev->of_node);
mtd               532 drivers/mtd/nand/onenand/omap2.c 	if ((r = onenand_scan(&c->mtd, 1)) < 0)
mtd               569 drivers/mtd/nand/onenand/omap2.c 	r = mtd_device_register(&c->mtd, NULL, 0);
mtd               578 drivers/mtd/nand/onenand/omap2.c 	onenand_release(&c->mtd);
mtd               590 drivers/mtd/nand/onenand/omap2.c 	onenand_release(&c->mtd);
mtd                66 drivers/mtd/nand/onenand/onenand_base.c static int flexonenand_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd                78 drivers/mtd/nand/onenand/onenand_base.c static int flexonenand_ooblayout_free(struct mtd_info *mtd, int section,
mtd               102 drivers/mtd/nand/onenand/onenand_base.c static int onenand_ooblayout_128_ecc(struct mtd_info *mtd, int section,
mtd               114 drivers/mtd/nand/onenand/onenand_base.c static int onenand_ooblayout_128_free(struct mtd_info *mtd, int section,
mtd               138 drivers/mtd/nand/onenand/onenand_base.c static int onenand_ooblayout_32_64_ecc(struct mtd_info *mtd, int section,
mtd               150 drivers/mtd/nand/onenand/onenand_base.c static int onenand_ooblayout_32_64_free(struct mtd_info *mtd, int section,
mtd               153 drivers/mtd/nand/onenand/onenand_base.c 	int sections = (mtd->oobsize / 32) * 2;
mtd               377 drivers/mtd/nand/onenand/onenand_base.c int flexonenand_region(struct mtd_info *mtd, loff_t addr)
mtd               381 drivers/mtd/nand/onenand/onenand_base.c 	for (i = 0; i < mtd->numeraseregions; i++)
mtd               382 drivers/mtd/nand/onenand/onenand_base.c 		if (addr < mtd->eraseregions[i].offset)
mtd               398 drivers/mtd/nand/onenand/onenand_base.c static int onenand_command(struct mtd_info *mtd, int cmd, loff_t addr, size_t len)
mtd               400 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd               553 drivers/mtd/nand/onenand/onenand_base.c static int onenand_wait(struct mtd_info *mtd, int state)
mtd               555 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip * this = mtd->priv;
mtd               588 drivers/mtd/nand/onenand/onenand_base.c 				mtd->ecc_stats.failed++;
mtd               593 drivers/mtd/nand/onenand/onenand_base.c 				mtd->ecc_stats.corrected++;
mtd               651 drivers/mtd/nand/onenand/onenand_base.c static int onenand_interrupt_wait(struct mtd_info *mtd, int state)
mtd               653 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd               657 drivers/mtd/nand/onenand/onenand_base.c 	return onenand_wait(mtd, state);
mtd               667 drivers/mtd/nand/onenand/onenand_base.c static int onenand_try_interrupt_wait(struct mtd_info *mtd, int state)
mtd               669 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd               687 drivers/mtd/nand/onenand/onenand_base.c 	return onenand_wait(mtd, state);
mtd               698 drivers/mtd/nand/onenand/onenand_base.c static void onenand_setup_wait(struct mtd_info *mtd)
mtd               700 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd               733 drivers/mtd/nand/onenand/onenand_base.c static inline int onenand_bufferram_offset(struct mtd_info *mtd, int area)
mtd               735 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd               742 drivers/mtd/nand/onenand/onenand_base.c 			return mtd->oobsize;
mtd               758 drivers/mtd/nand/onenand/onenand_base.c static int onenand_read_bufferram(struct mtd_info *mtd, int area,
mtd               761 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd               766 drivers/mtd/nand/onenand/onenand_base.c 	bufferram += onenand_bufferram_offset(mtd, area);
mtd               794 drivers/mtd/nand/onenand/onenand_base.c static int onenand_sync_read_bufferram(struct mtd_info *mtd, int area,
mtd               797 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd               802 drivers/mtd/nand/onenand/onenand_base.c 	bufferram += onenand_bufferram_offset(mtd, area);
mtd               804 drivers/mtd/nand/onenand/onenand_base.c 	this->mmcontrol(mtd, ONENAND_SYS_CFG1_SYNC_READ);
mtd               819 drivers/mtd/nand/onenand/onenand_base.c 	this->mmcontrol(mtd, 0);
mtd               834 drivers/mtd/nand/onenand/onenand_base.c static int onenand_write_bufferram(struct mtd_info *mtd, int area,
mtd               837 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd               842 drivers/mtd/nand/onenand/onenand_base.c 	bufferram += onenand_bufferram_offset(mtd, area);
mtd               873 drivers/mtd/nand/onenand/onenand_base.c static int onenand_get_2x_blockpage(struct mtd_info *mtd, loff_t addr)
mtd               875 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd               897 drivers/mtd/nand/onenand/onenand_base.c static int onenand_check_bufferram(struct mtd_info *mtd, loff_t addr)
mtd               899 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd               904 drivers/mtd/nand/onenand/onenand_base.c 		blockpage = onenand_get_2x_blockpage(mtd, addr);
mtd               939 drivers/mtd/nand/onenand/onenand_base.c static void onenand_update_bufferram(struct mtd_info *mtd, loff_t addr,
mtd               942 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd               947 drivers/mtd/nand/onenand/onenand_base.c 		blockpage = onenand_get_2x_blockpage(mtd, addr);
mtd               972 drivers/mtd/nand/onenand/onenand_base.c static void onenand_invalidate_bufferram(struct mtd_info *mtd, loff_t addr,
mtd               975 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd               994 drivers/mtd/nand/onenand/onenand_base.c static int onenand_get_device(struct mtd_info *mtd, int new_state)
mtd               996 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1008 drivers/mtd/nand/onenand/onenand_base.c 				this->enable(mtd);
mtd              1031 drivers/mtd/nand/onenand/onenand_base.c static void onenand_release_device(struct mtd_info *mtd)
mtd              1033 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1036 drivers/mtd/nand/onenand/onenand_base.c 		this->disable(mtd);
mtd              1051 drivers/mtd/nand/onenand/onenand_base.c static int onenand_transfer_auto_oob(struct mtd_info *mtd, uint8_t *buf, int column,
mtd              1054 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1057 drivers/mtd/nand/onenand/onenand_base.c 	this->read_bufferram(mtd, ONENAND_SPARERAM, this->oob_buf, 0,
mtd              1058 drivers/mtd/nand/onenand/onenand_base.c 			     mtd->oobsize);
mtd              1059 drivers/mtd/nand/onenand/onenand_base.c 	ret = mtd_ooblayout_get_databytes(mtd, buf, this->oob_buf,
mtd              1080 drivers/mtd/nand/onenand/onenand_base.c static int onenand_recover_lsb(struct mtd_info *mtd, loff_t addr, int status)
mtd              1082 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1094 drivers/mtd/nand/onenand/onenand_base.c 	i = flexonenand_region(mtd, addr);
mtd              1095 drivers/mtd/nand/onenand/onenand_base.c 	if (mtd->eraseregions[i].erasesize < (1 << this->erase_shift))
mtd              1103 drivers/mtd/nand/onenand/onenand_base.c 	mtd->ecc_stats.failed--;
mtd              1106 drivers/mtd/nand/onenand/onenand_base.c 	this->command(mtd, FLEXONENAND_CMD_RECOVER_LSB, addr, this->writesize);
mtd              1107 drivers/mtd/nand/onenand/onenand_base.c 	return this->wait(mtd, FL_READING);
mtd              1119 drivers/mtd/nand/onenand/onenand_base.c static int onenand_mlc_read_ops_nolock(struct mtd_info *mtd, loff_t from,
mtd              1122 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1136 drivers/mtd/nand/onenand/onenand_base.c 	oobsize = mtd_oobavail(mtd, ops);
mtd              1137 drivers/mtd/nand/onenand/onenand_base.c 	oobcolumn = from & (mtd->oobsize - 1);
mtd              1140 drivers/mtd/nand/onenand/onenand_base.c 	if (from + len > mtd->size) {
mtd              1148 drivers/mtd/nand/onenand/onenand_base.c 	stats = mtd->ecc_stats;
mtd              1159 drivers/mtd/nand/onenand/onenand_base.c 		if (!onenand_check_bufferram(mtd, from)) {
mtd              1160 drivers/mtd/nand/onenand/onenand_base.c 			this->command(mtd, ONENAND_CMD_READ, from, writesize);
mtd              1162 drivers/mtd/nand/onenand/onenand_base.c 			ret = this->wait(mtd, FL_READING);
mtd              1164 drivers/mtd/nand/onenand/onenand_base.c 				ret = onenand_recover_lsb(mtd, from, ret);
mtd              1165 drivers/mtd/nand/onenand/onenand_base.c 			onenand_update_bufferram(mtd, from, !ret);
mtd              1172 drivers/mtd/nand/onenand/onenand_base.c 		this->read_bufferram(mtd, ONENAND_DATARAM, buf, column, thislen);
mtd              1178 drivers/mtd/nand/onenand/onenand_base.c 				onenand_transfer_auto_oob(mtd, oobbuf, oobcolumn, thisooblen);
mtd              1180 drivers/mtd/nand/onenand/onenand_base.c 				this->read_bufferram(mtd, ONENAND_SPARERAM, oobbuf, oobcolumn, thisooblen);
mtd              1205 drivers/mtd/nand/onenand/onenand_base.c 	if (mtd->ecc_stats.failed - stats.failed)
mtd              1209 drivers/mtd/nand/onenand/onenand_base.c 	return mtd->ecc_stats.corrected != stats.corrected ? 1 : 0;
mtd              1220 drivers/mtd/nand/onenand/onenand_base.c static int onenand_read_ops_nolock(struct mtd_info *mtd, loff_t from,
mtd              1223 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1237 drivers/mtd/nand/onenand/onenand_base.c 	oobsize = mtd_oobavail(mtd, ops);
mtd              1238 drivers/mtd/nand/onenand/onenand_base.c 	oobcolumn = from & (mtd->oobsize - 1);
mtd              1241 drivers/mtd/nand/onenand/onenand_base.c 	if ((from + len) > mtd->size) {
mtd              1249 drivers/mtd/nand/onenand/onenand_base.c 	stats = mtd->ecc_stats;
mtd              1255 drivers/mtd/nand/onenand/onenand_base.c 		if (!onenand_check_bufferram(mtd, from)) {
mtd              1256 drivers/mtd/nand/onenand/onenand_base.c 			this->command(mtd, ONENAND_CMD_READ, from, writesize);
mtd              1257 drivers/mtd/nand/onenand/onenand_base.c 			ret = this->wait(mtd, FL_READING);
mtd              1258 drivers/mtd/nand/onenand/onenand_base.c 			onenand_update_bufferram(mtd, from, !ret);
mtd              1273 drivers/mtd/nand/onenand/onenand_base.c 			this->command(mtd, ONENAND_CMD_READ, from, writesize);
mtd              1288 drivers/mtd/nand/onenand/onenand_base.c 		this->read_bufferram(mtd, ONENAND_DATARAM, buf, column, thislen);
mtd              1296 drivers/mtd/nand/onenand/onenand_base.c 				onenand_transfer_auto_oob(mtd, oobbuf, oobcolumn, thisooblen);
mtd              1298 drivers/mtd/nand/onenand/onenand_base.c 				this->read_bufferram(mtd, ONENAND_SPARERAM, oobbuf, oobcolumn, thisooblen);
mtd              1317 drivers/mtd/nand/onenand/onenand_base.c 		ret = this->wait(mtd, FL_READING);
mtd              1318 drivers/mtd/nand/onenand/onenand_base.c 		onenand_update_bufferram(mtd, from, !ret);
mtd              1334 drivers/mtd/nand/onenand/onenand_base.c 	if (mtd->ecc_stats.failed - stats.failed)
mtd              1338 drivers/mtd/nand/onenand/onenand_base.c 	return mtd->ecc_stats.corrected != stats.corrected ? 1 : 0;
mtd              1349 drivers/mtd/nand/onenand/onenand_base.c static int onenand_read_oob_nolock(struct mtd_info *mtd, loff_t from,
mtd              1352 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1369 drivers/mtd/nand/onenand/onenand_base.c 		oobsize = mtd->oobavail;
mtd              1371 drivers/mtd/nand/onenand/onenand_base.c 		oobsize = mtd->oobsize;
mtd              1373 drivers/mtd/nand/onenand/onenand_base.c 	column = from & (mtd->oobsize - 1);
mtd              1381 drivers/mtd/nand/onenand/onenand_base.c 	stats = mtd->ecc_stats;
mtd              1391 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, readcmd, from, mtd->oobsize);
mtd              1393 drivers/mtd/nand/onenand/onenand_base.c 		onenand_update_bufferram(mtd, from, 0);
mtd              1395 drivers/mtd/nand/onenand/onenand_base.c 		ret = this->wait(mtd, FL_READING);
mtd              1397 drivers/mtd/nand/onenand/onenand_base.c 			ret = onenand_recover_lsb(mtd, from, ret);
mtd              1406 drivers/mtd/nand/onenand/onenand_base.c 			onenand_transfer_auto_oob(mtd, buf, column, thislen);
mtd              1408 drivers/mtd/nand/onenand/onenand_base.c 			this->read_bufferram(mtd, ONENAND_SPARERAM, buf, column, thislen);
mtd              1420 drivers/mtd/nand/onenand/onenand_base.c 			from += mtd->writesize;
mtd              1430 drivers/mtd/nand/onenand/onenand_base.c 	if (mtd->ecc_stats.failed - stats.failed)
mtd              1444 drivers/mtd/nand/onenand/onenand_base.c static int onenand_read_oob(struct mtd_info *mtd, loff_t from,
mtd              1447 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1460 drivers/mtd/nand/onenand/onenand_base.c 	onenand_get_device(mtd, FL_READING);
mtd              1463 drivers/mtd/nand/onenand/onenand_base.c 			onenand_mlc_read_ops_nolock(mtd, from, ops) :
mtd              1464 drivers/mtd/nand/onenand/onenand_base.c 			onenand_read_ops_nolock(mtd, from, ops);
mtd              1466 drivers/mtd/nand/onenand/onenand_base.c 		ret = onenand_read_oob_nolock(mtd, from, ops);
mtd              1467 drivers/mtd/nand/onenand/onenand_base.c 	onenand_release_device(mtd);
mtd              1479 drivers/mtd/nand/onenand/onenand_base.c static int onenand_bbt_wait(struct mtd_info *mtd, int state)
mtd              1481 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1531 drivers/mtd/nand/onenand/onenand_base.c int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from, 
mtd              1534 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1547 drivers/mtd/nand/onenand/onenand_base.c 	if (unlikely((from + len) > mtd->size)) {
mtd              1554 drivers/mtd/nand/onenand/onenand_base.c 	onenand_get_device(mtd, FL_READING);
mtd              1556 drivers/mtd/nand/onenand/onenand_base.c 	column = from & (mtd->oobsize - 1);
mtd              1563 drivers/mtd/nand/onenand/onenand_base.c 		thislen = mtd->oobsize - column;
mtd              1566 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, readcmd, from, mtd->oobsize);
mtd              1568 drivers/mtd/nand/onenand/onenand_base.c 		onenand_update_bufferram(mtd, from, 0);
mtd              1570 drivers/mtd/nand/onenand/onenand_base.c 		ret = this->bbt_wait(mtd, FL_READING);
mtd              1572 drivers/mtd/nand/onenand/onenand_base.c 			ret = onenand_recover_lsb(mtd, from, ret);
mtd              1577 drivers/mtd/nand/onenand/onenand_base.c 		this->read_bufferram(mtd, ONENAND_SPARERAM, buf, column, thislen);
mtd              1593 drivers/mtd/nand/onenand/onenand_base.c 	onenand_release_device(mtd);
mtd              1606 drivers/mtd/nand/onenand/onenand_base.c static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to)
mtd              1608 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1614 drivers/mtd/nand/onenand/onenand_base.c 	this->command(mtd, readcmd, to, mtd->oobsize);
mtd              1615 drivers/mtd/nand/onenand/onenand_base.c 	onenand_update_bufferram(mtd, to, 0);
mtd              1616 drivers/mtd/nand/onenand/onenand_base.c 	status = this->wait(mtd, FL_READING);
mtd              1620 drivers/mtd/nand/onenand/onenand_base.c 	this->read_bufferram(mtd, ONENAND_SPARERAM, oob_buf, 0, mtd->oobsize);
mtd              1621 drivers/mtd/nand/onenand/onenand_base.c 	for (i = 0; i < mtd->oobsize; i++)
mtd              1635 drivers/mtd/nand/onenand/onenand_base.c static int onenand_verify(struct mtd_info *mtd, const u_char *buf, loff_t addr, size_t len)
mtd              1637 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1646 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, ONENAND_CMD_READ, addr, this->writesize);
mtd              1648 drivers/mtd/nand/onenand/onenand_base.c 		onenand_update_bufferram(mtd, addr, 0);
mtd              1650 drivers/mtd/nand/onenand/onenand_base.c 		ret = this->wait(mtd, FL_READING);
mtd              1654 drivers/mtd/nand/onenand/onenand_base.c 		onenand_update_bufferram(mtd, addr, 1);
mtd              1656 drivers/mtd/nand/onenand/onenand_base.c 		this->read_bufferram(mtd, ONENAND_DATARAM, this->verify_buf, 0, mtd->writesize);
mtd              1676 drivers/mtd/nand/onenand/onenand_base.c static void onenand_panic_wait(struct mtd_info *mtd)
mtd              1678 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1700 drivers/mtd/nand/onenand/onenand_base.c static int onenand_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd              1703 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1711 drivers/mtd/nand/onenand/onenand_base.c 	onenand_panic_wait(mtd);
mtd              1723 drivers/mtd/nand/onenand/onenand_base.c 	column = to & (mtd->writesize - 1);
mtd              1727 drivers/mtd/nand/onenand/onenand_base.c 		int thislen = min_t(int, mtd->writesize - column, len - written);
mtd              1730 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, ONENAND_CMD_BUFFERRAM, to, thislen);
mtd              1733 drivers/mtd/nand/onenand/onenand_base.c 		subpage = thislen < mtd->writesize;
mtd              1735 drivers/mtd/nand/onenand/onenand_base.c 			memset(this->page_buf, 0xff, mtd->writesize);
mtd              1740 drivers/mtd/nand/onenand/onenand_base.c 		this->write_bufferram(mtd, ONENAND_DATARAM, wbuf, 0, mtd->writesize);
mtd              1741 drivers/mtd/nand/onenand/onenand_base.c 		this->write_bufferram(mtd, ONENAND_SPARERAM, ffchars, 0, mtd->oobsize);
mtd              1743 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, ONENAND_CMD_PROG, to, mtd->writesize);
mtd              1745 drivers/mtd/nand/onenand/onenand_base.c 		onenand_panic_wait(mtd);
mtd              1748 drivers/mtd/nand/onenand/onenand_base.c 		onenand_update_bufferram(mtd, to, !subpage);
mtd              1751 drivers/mtd/nand/onenand/onenand_base.c 			onenand_update_bufferram(mtd, to + this->writesize, !subpage);
mtd              1776 drivers/mtd/nand/onenand/onenand_base.c static int onenand_fill_auto_oob(struct mtd_info *mtd, u_char *oob_buf,
mtd              1779 drivers/mtd/nand/onenand/onenand_base.c 	return mtd_ooblayout_set_databytes(mtd, buf, oob_buf, column, thislen);
mtd              1790 drivers/mtd/nand/onenand/onenand_base.c static int onenand_write_ops_nolock(struct mtd_info *mtd, loff_t to,
mtd              1793 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1821 drivers/mtd/nand/onenand/onenand_base.c 	oobsize = mtd_oobavail(mtd, ops);
mtd              1822 drivers/mtd/nand/onenand/onenand_base.c 	oobcolumn = to & (mtd->oobsize - 1);
mtd              1824 drivers/mtd/nand/onenand/onenand_base.c 	column = to & (mtd->writesize - 1);
mtd              1831 drivers/mtd/nand/onenand/onenand_base.c 			thislen = min_t(int, mtd->writesize - column, len - written);
mtd              1836 drivers/mtd/nand/onenand/onenand_base.c 			this->command(mtd, ONENAND_CMD_BUFFERRAM, to, thislen);
mtd              1839 drivers/mtd/nand/onenand/onenand_base.c 			subpage = thislen < mtd->writesize;
mtd              1841 drivers/mtd/nand/onenand/onenand_base.c 				memset(this->page_buf, 0xff, mtd->writesize);
mtd              1846 drivers/mtd/nand/onenand/onenand_base.c 			this->write_bufferram(mtd, ONENAND_DATARAM, wbuf, 0, mtd->writesize);
mtd              1853 drivers/mtd/nand/onenand/onenand_base.c 				memset(oobbuf, 0xff, mtd->oobsize);
mtd              1855 drivers/mtd/nand/onenand/onenand_base.c 					onenand_fill_auto_oob(mtd, oobbuf, oob, oobcolumn, thisooblen);
mtd              1865 drivers/mtd/nand/onenand/onenand_base.c 			this->write_bufferram(mtd, ONENAND_SPARERAM, oobbuf, 0, mtd->oobsize);
mtd              1876 drivers/mtd/nand/onenand/onenand_base.c 			ret = this->wait(mtd, FL_WRITING);
mtd              1879 drivers/mtd/nand/onenand/onenand_base.c 			onenand_update_bufferram(mtd, prev, !ret && !prev_subpage);
mtd              1889 drivers/mtd/nand/onenand/onenand_base.c 				ret = onenand_verify(mtd, buf - len, to - len, len);
mtd              1911 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, cmd, to, mtd->writesize);
mtd              1917 drivers/mtd/nand/onenand/onenand_base.c 			ret = this->wait(mtd, FL_WRITING);
mtd              1920 drivers/mtd/nand/onenand/onenand_base.c 			onenand_update_bufferram(mtd, to, !ret && !subpage);
mtd              1928 drivers/mtd/nand/onenand/onenand_base.c 			ret = onenand_verify(mtd, buf, to, thislen);
mtd              1954 drivers/mtd/nand/onenand/onenand_base.c 		onenand_invalidate_bufferram(mtd, 0, -1);
mtd              1974 drivers/mtd/nand/onenand/onenand_base.c static int onenand_write_oob_nolock(struct mtd_info *mtd, loff_t to,
mtd              1977 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              1994 drivers/mtd/nand/onenand/onenand_base.c 		oobsize = mtd->oobavail;
mtd              1996 drivers/mtd/nand/onenand/onenand_base.c 		oobsize = mtd->oobsize;
mtd              1998 drivers/mtd/nand/onenand/onenand_base.c 	column = to & (mtd->oobsize - 1);
mtd              2023 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, ONENAND_CMD_BUFFERRAM, to, mtd->oobsize);
mtd              2027 drivers/mtd/nand/onenand/onenand_base.c 		memset(oobbuf, 0xff, mtd->oobsize);
mtd              2029 drivers/mtd/nand/onenand/onenand_base.c 			onenand_fill_auto_oob(mtd, oobbuf, buf, column, thislen);
mtd              2032 drivers/mtd/nand/onenand/onenand_base.c 		this->write_bufferram(mtd, ONENAND_SPARERAM, oobbuf, 0, mtd->oobsize);
mtd              2036 drivers/mtd/nand/onenand/onenand_base.c 			memset(this->page_buf, 0xff, mtd->writesize);
mtd              2037 drivers/mtd/nand/onenand/onenand_base.c 			this->write_bufferram(mtd, ONENAND_DATARAM,
mtd              2038 drivers/mtd/nand/onenand/onenand_base.c 					 this->page_buf, 0, mtd->writesize);
mtd              2041 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, oobcmd, to, mtd->oobsize);
mtd              2043 drivers/mtd/nand/onenand/onenand_base.c 		onenand_update_bufferram(mtd, to, 0);
mtd              2046 drivers/mtd/nand/onenand/onenand_base.c 			onenand_update_bufferram(mtd, to + this->writesize, 0);
mtd              2049 drivers/mtd/nand/onenand/onenand_base.c 		ret = this->wait(mtd, FL_WRITING);
mtd              2055 drivers/mtd/nand/onenand/onenand_base.c 		ret = onenand_verify_oob(mtd, oobbuf, to);
mtd              2066 drivers/mtd/nand/onenand/onenand_base.c 		to += mtd->writesize;
mtd              2082 drivers/mtd/nand/onenand/onenand_base.c static int onenand_write_oob(struct mtd_info *mtd, loff_t to,
mtd              2097 drivers/mtd/nand/onenand/onenand_base.c 	onenand_get_device(mtd, FL_WRITING);
mtd              2099 drivers/mtd/nand/onenand/onenand_base.c 		ret = onenand_write_ops_nolock(mtd, to, ops);
mtd              2101 drivers/mtd/nand/onenand/onenand_base.c 		ret = onenand_write_oob_nolock(mtd, to, ops);
mtd              2102 drivers/mtd/nand/onenand/onenand_base.c 	onenand_release_device(mtd);
mtd              2116 drivers/mtd/nand/onenand/onenand_base.c static int onenand_block_isbad_nolock(struct mtd_info *mtd, loff_t ofs, int allowbbt)
mtd              2118 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              2122 drivers/mtd/nand/onenand/onenand_base.c 	return bbm->isbad_bbt(mtd, ofs, allowbbt);
mtd              2126 drivers/mtd/nand/onenand/onenand_base.c static int onenand_multiblock_erase_verify(struct mtd_info *mtd,
mtd              2129 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              2136 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, ONENAND_CMD_ERASE_VERIFY, addr, block_size);
mtd              2137 drivers/mtd/nand/onenand/onenand_base.c 		ret = this->wait(mtd, FL_VERIFYING_ERASE);
mtd              2158 drivers/mtd/nand/onenand/onenand_base.c static int onenand_multiblock_erase(struct mtd_info *mtd,
mtd              2162 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              2178 drivers/mtd/nand/onenand/onenand_base.c 		if (onenand_block_isbad_nolock(mtd, addr, 0)) {
mtd              2212 drivers/mtd/nand/onenand/onenand_base.c 			this->command(mtd, ONENAND_CMD_MULTIBLOCK_ERASE,
mtd              2214 drivers/mtd/nand/onenand/onenand_base.c 			onenand_invalidate_bufferram(mtd, addr, block_size);
mtd              2216 drivers/mtd/nand/onenand/onenand_base.c 			ret = this->wait(mtd, FL_PREPARING_ERASE);
mtd              2232 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, ONENAND_CMD_ERASE, addr, block_size);
mtd              2233 drivers/mtd/nand/onenand/onenand_base.c 		onenand_invalidate_bufferram(mtd, addr, block_size);
mtd              2235 drivers/mtd/nand/onenand/onenand_base.c 		ret = this->wait(mtd, FL_ERASING);
mtd              2250 drivers/mtd/nand/onenand/onenand_base.c 		if (onenand_multiblock_erase_verify(mtd, &verify_instr)) {
mtd              2269 drivers/mtd/nand/onenand/onenand_base.c static int onenand_block_by_block_erase(struct mtd_info *mtd,
mtd              2274 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              2290 drivers/mtd/nand/onenand/onenand_base.c 		if (onenand_block_isbad_nolock(mtd, addr, 0)) {
mtd              2297 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, ONENAND_CMD_ERASE, addr, block_size);
mtd              2299 drivers/mtd/nand/onenand/onenand_base.c 		onenand_invalidate_bufferram(mtd, addr, block_size);
mtd              2301 drivers/mtd/nand/onenand/onenand_base.c 		ret = this->wait(mtd, FL_ERASING);
mtd              2339 drivers/mtd/nand/onenand/onenand_base.c static int onenand_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd              2341 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              2355 drivers/mtd/nand/onenand/onenand_base.c 		int i = flexonenand_region(mtd, addr);
mtd              2357 drivers/mtd/nand/onenand/onenand_base.c 		region = &mtd->eraseregions[i];
mtd              2380 drivers/mtd/nand/onenand/onenand_base.c 	onenand_get_device(mtd, FL_ERASING);
mtd              2385 drivers/mtd/nand/onenand/onenand_base.c 		ret = onenand_block_by_block_erase(mtd, instr,
mtd              2388 drivers/mtd/nand/onenand/onenand_base.c 		ret = onenand_multiblock_erase(mtd, instr, block_size);
mtd              2392 drivers/mtd/nand/onenand/onenand_base.c 	onenand_release_device(mtd);
mtd              2403 drivers/mtd/nand/onenand/onenand_base.c static void onenand_sync(struct mtd_info *mtd)
mtd              2408 drivers/mtd/nand/onenand/onenand_base.c 	onenand_get_device(mtd, FL_SYNCING);
mtd              2411 drivers/mtd/nand/onenand/onenand_base.c 	onenand_release_device(mtd);
mtd              2421 drivers/mtd/nand/onenand/onenand_base.c static int onenand_block_isbad(struct mtd_info *mtd, loff_t ofs)
mtd              2425 drivers/mtd/nand/onenand/onenand_base.c 	onenand_get_device(mtd, FL_READING);
mtd              2426 drivers/mtd/nand/onenand/onenand_base.c 	ret = onenand_block_isbad_nolock(mtd, ofs, 0);
mtd              2427 drivers/mtd/nand/onenand/onenand_base.c 	onenand_release_device(mtd);
mtd              2439 drivers/mtd/nand/onenand/onenand_base.c static int onenand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
mtd              2441 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              2458 drivers/mtd/nand/onenand/onenand_base.c         ofs += mtd->oobsize + (this->badblockpos & ~0x01);
mtd              2463 drivers/mtd/nand/onenand/onenand_base.c 	return onenand_write_oob_nolock(mtd, ofs, &ops);
mtd              2473 drivers/mtd/nand/onenand/onenand_base.c static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs)
mtd              2475 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              2478 drivers/mtd/nand/onenand/onenand_base.c 	ret = onenand_block_isbad(mtd, ofs);
mtd              2486 drivers/mtd/nand/onenand/onenand_base.c 	onenand_get_device(mtd, FL_WRITING);
mtd              2487 drivers/mtd/nand/onenand/onenand_base.c 	ret = this->block_markbad(mtd, ofs);
mtd              2488 drivers/mtd/nand/onenand/onenand_base.c 	onenand_release_device(mtd);
mtd              2501 drivers/mtd/nand/onenand/onenand_base.c static int onenand_do_lock_cmd(struct mtd_info *mtd, loff_t ofs, size_t len, int cmd)
mtd              2503 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              2522 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, cmd, 0, 0);
mtd              2525 drivers/mtd/nand/onenand/onenand_base.c 		this->wait(mtd, FL_LOCKING);
mtd              2552 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, cmd, 0, 0);
mtd              2555 drivers/mtd/nand/onenand/onenand_base.c 		this->wait(mtd, FL_LOCKING);
mtd              2580 drivers/mtd/nand/onenand/onenand_base.c static int onenand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd              2584 drivers/mtd/nand/onenand/onenand_base.c 	onenand_get_device(mtd, FL_LOCKING);
mtd              2585 drivers/mtd/nand/onenand/onenand_base.c 	ret = onenand_do_lock_cmd(mtd, ofs, len, ONENAND_CMD_LOCK);
mtd              2586 drivers/mtd/nand/onenand/onenand_base.c 	onenand_release_device(mtd);
mtd              2598 drivers/mtd/nand/onenand/onenand_base.c static int onenand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd              2602 drivers/mtd/nand/onenand/onenand_base.c 	onenand_get_device(mtd, FL_LOCKING);
mtd              2603 drivers/mtd/nand/onenand/onenand_base.c 	ret = onenand_do_lock_cmd(mtd, ofs, len, ONENAND_CMD_UNLOCK);
mtd              2604 drivers/mtd/nand/onenand/onenand_base.c 	onenand_release_device(mtd);
mtd              2648 drivers/mtd/nand/onenand/onenand_base.c static void onenand_unlock_all(struct mtd_info *mtd)
mtd              2650 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              2652 drivers/mtd/nand/onenand/onenand_base.c 	loff_t len = mtd->size;
mtd              2658 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, ONENAND_CMD_UNLOCK_ALL, 0, 0);
mtd              2661 drivers/mtd/nand/onenand/onenand_base.c 		this->wait(mtd, FL_LOCKING);
mtd              2684 drivers/mtd/nand/onenand/onenand_base.c 	onenand_do_lock_cmd(mtd, ofs, len, ONENAND_CMD_UNLOCK);
mtd              2696 drivers/mtd/nand/onenand/onenand_base.c static int onenand_otp_command(struct mtd_info *mtd, int cmd, loff_t addr,
mtd              2699 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              2774 drivers/mtd/nand/onenand/onenand_base.c static int onenand_otp_write_oob_nolock(struct mtd_info *mtd, loff_t to,
mtd              2777 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              2790 drivers/mtd/nand/onenand/onenand_base.c 	oobsize = mtd->oobsize;
mtd              2792 drivers/mtd/nand/onenand/onenand_base.c 	column = to & (mtd->oobsize - 1);
mtd              2825 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, ONENAND_CMD_OTP_ACCESS, 0, 0);
mtd              2826 drivers/mtd/nand/onenand/onenand_base.c 		this->wait(mtd, FL_OTPING);
mtd              2838 drivers/mtd/nand/onenand/onenand_base.c 		this->write_bufferram(mtd, ONENAND_SPARERAM,
mtd              2839 drivers/mtd/nand/onenand/onenand_base.c 					oobbuf, 0, mtd->oobsize);
mtd              2841 drivers/mtd/nand/onenand/onenand_base.c 		onenand_otp_command(mtd, ONENAND_CMD_PROGOOB, to, mtd->oobsize);
mtd              2842 drivers/mtd/nand/onenand/onenand_base.c 		onenand_update_bufferram(mtd, to, 0);
mtd              2845 drivers/mtd/nand/onenand/onenand_base.c 			onenand_update_bufferram(mtd, to + this->writesize, 0);
mtd              2848 drivers/mtd/nand/onenand/onenand_base.c 		ret = this->wait(mtd, FL_WRITING);
mtd              2855 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, ONENAND_CMD_RESET, 0, 0);
mtd              2856 drivers/mtd/nand/onenand/onenand_base.c 		this->wait(mtd, FL_RESETING);
mtd              2881 drivers/mtd/nand/onenand/onenand_base.c 		to += mtd->writesize;
mtd              2892 drivers/mtd/nand/onenand/onenand_base.c typedef int (*otp_op_t)(struct mtd_info *mtd, loff_t form, size_t len,
mtd              2905 drivers/mtd/nand/onenand/onenand_base.c static int do_otp_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd              2908 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              2918 drivers/mtd/nand/onenand/onenand_base.c 	this->command(mtd, ONENAND_CMD_OTP_ACCESS, 0, 0);
mtd              2919 drivers/mtd/nand/onenand/onenand_base.c 	this->wait(mtd, FL_OTPING);
mtd              2922 drivers/mtd/nand/onenand/onenand_base.c 		onenand_mlc_read_ops_nolock(mtd, from, &ops) :
mtd              2923 drivers/mtd/nand/onenand/onenand_base.c 		onenand_read_ops_nolock(mtd, from, &ops);
mtd              2926 drivers/mtd/nand/onenand/onenand_base.c 	this->command(mtd, ONENAND_CMD_RESET, 0, 0);
mtd              2927 drivers/mtd/nand/onenand/onenand_base.c 	this->wait(mtd, FL_RESETING);
mtd              2942 drivers/mtd/nand/onenand/onenand_base.c static int do_otp_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd              2945 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              2951 drivers/mtd/nand/onenand/onenand_base.c 	if (len < mtd->writesize) {
mtd              2953 drivers/mtd/nand/onenand/onenand_base.c 		memset(this->page_buf + len, 0xff, mtd->writesize - len);
mtd              2955 drivers/mtd/nand/onenand/onenand_base.c 		len = mtd->writesize;
mtd              2959 drivers/mtd/nand/onenand/onenand_base.c 	this->command(mtd, ONENAND_CMD_OTP_ACCESS, 0, 0);
mtd              2960 drivers/mtd/nand/onenand/onenand_base.c 	this->wait(mtd, FL_OTPING);
mtd              2966 drivers/mtd/nand/onenand/onenand_base.c 	ret = onenand_write_ops_nolock(mtd, to, &ops);
mtd              2970 drivers/mtd/nand/onenand/onenand_base.c 	this->command(mtd, ONENAND_CMD_RESET, 0, 0);
mtd              2971 drivers/mtd/nand/onenand/onenand_base.c 	this->wait(mtd, FL_RESETING);
mtd              2986 drivers/mtd/nand/onenand/onenand_base.c static int do_otp_lock(struct mtd_info *mtd, loff_t from, size_t len,
mtd              2989 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              2996 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, ONENAND_CMD_OTP_ACCESS, 0, 0);
mtd              2997 drivers/mtd/nand/onenand/onenand_base.c 		this->wait(mtd, FL_OTPING);
mtd              3002 drivers/mtd/nand/onenand/onenand_base.c 		ops.len = mtd->writesize;
mtd              3006 drivers/mtd/nand/onenand/onenand_base.c 		ret = onenand_write_ops_nolock(mtd, mtd->writesize * 49, &ops);
mtd              3010 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, ONENAND_CMD_RESET, 0, 0);
mtd              3011 drivers/mtd/nand/onenand/onenand_base.c 		this->wait(mtd, FL_RESETING);
mtd              3017 drivers/mtd/nand/onenand/onenand_base.c 		ret = onenand_otp_write_oob_nolock(mtd, from, &ops);
mtd              3036 drivers/mtd/nand/onenand/onenand_base.c static int onenand_otp_walk(struct mtd_info *mtd, loff_t from, size_t len,
mtd              3040 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              3054 drivers/mtd/nand/onenand/onenand_base.c 		from += mtd->writesize * otp_pages;
mtd              3060 drivers/mtd/nand/onenand/onenand_base.c 		if (mtd->writesize * otp_pages < from + len)
mtd              3063 drivers/mtd/nand/onenand/onenand_base.c 		if (mtd->writesize * otp_pages <  len)
mtd              3067 drivers/mtd/nand/onenand/onenand_base.c 	onenand_get_device(mtd, FL_OTPING);
mtd              3080 drivers/mtd/nand/onenand/onenand_base.c 			otpinfo->length = mtd->writesize;
mtd              3083 drivers/mtd/nand/onenand/onenand_base.c 			from += mtd->writesize;
mtd              3089 drivers/mtd/nand/onenand/onenand_base.c 			ret = action(mtd, from, len, &tmp_retlen, buf);
mtd              3100 drivers/mtd/nand/onenand/onenand_base.c 	onenand_release_device(mtd);
mtd              3114 drivers/mtd/nand/onenand/onenand_base.c static int onenand_get_fact_prot_info(struct mtd_info *mtd, size_t len,
mtd              3117 drivers/mtd/nand/onenand/onenand_base.c 	return onenand_otp_walk(mtd, 0, len, retlen, (u_char *) buf, NULL,
mtd              3131 drivers/mtd/nand/onenand/onenand_base.c static int onenand_read_fact_prot_reg(struct mtd_info *mtd, loff_t from,
mtd              3134 drivers/mtd/nand/onenand/onenand_base.c 	return onenand_otp_walk(mtd, from, len, retlen, buf, do_otp_read, MTD_OTP_FACTORY);
mtd              3146 drivers/mtd/nand/onenand/onenand_base.c static int onenand_get_user_prot_info(struct mtd_info *mtd, size_t len,
mtd              3149 drivers/mtd/nand/onenand/onenand_base.c 	return onenand_otp_walk(mtd, 0, len, retlen, (u_char *) buf, NULL,
mtd              3163 drivers/mtd/nand/onenand/onenand_base.c static int onenand_read_user_prot_reg(struct mtd_info *mtd, loff_t from,
mtd              3166 drivers/mtd/nand/onenand/onenand_base.c 	return onenand_otp_walk(mtd, from, len, retlen, buf, do_otp_read, MTD_OTP_USER);
mtd              3179 drivers/mtd/nand/onenand/onenand_base.c static int onenand_write_user_prot_reg(struct mtd_info *mtd, loff_t from,
mtd              3182 drivers/mtd/nand/onenand/onenand_base.c 	return onenand_otp_walk(mtd, from, len, retlen, buf, do_otp_write, MTD_OTP_USER);
mtd              3193 drivers/mtd/nand/onenand/onenand_base.c static int onenand_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
mtd              3196 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              3203 drivers/mtd/nand/onenand/onenand_base.c 						 : mtd->oobsize);
mtd              3212 drivers/mtd/nand/onenand/onenand_base.c 	len = FLEXONENAND(this) ? mtd->writesize : 16;
mtd              3233 drivers/mtd/nand/onenand/onenand_base.c 	ret = onenand_otp_walk(mtd, from, len, &retlen, buf, do_otp_lock, MTD_OTP_USER);
mtd              3248 drivers/mtd/nand/onenand/onenand_base.c static void onenand_check_features(struct mtd_info *mtd)
mtd              3250 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              3391 drivers/mtd/nand/onenand/onenand_base.c static int flexonenand_get_boundary(struct mtd_info *mtd)
mtd              3393 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              3402 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, FLEXONENAND_CMD_PI_ACCESS, die, 0);
mtd              3403 drivers/mtd/nand/onenand/onenand_base.c 		this->wait(mtd, FL_SYNCING);
mtd              3405 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, FLEXONENAND_CMD_READ_PI, die, 0);
mtd              3406 drivers/mtd/nand/onenand/onenand_base.c 		this->wait(mtd, FL_READING);
mtd              3415 drivers/mtd/nand/onenand/onenand_base.c 		this->command(mtd, ONENAND_CMD_RESET, 0, 0);
mtd              3416 drivers/mtd/nand/onenand/onenand_base.c 		this->wait(mtd, FL_RESETING);
mtd              3432 drivers/mtd/nand/onenand/onenand_base.c static void flexonenand_get_size(struct mtd_info *mtd)
mtd              3434 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              3445 drivers/mtd/nand/onenand/onenand_base.c 	mtd->numeraseregions = this->dies << 1;
mtd              3448 drivers/mtd/nand/onenand/onenand_base.c 	flexonenand_get_boundary(mtd);
mtd              3454 drivers/mtd/nand/onenand/onenand_base.c 			mtd->eraseregions[i].offset = ofs;
mtd              3455 drivers/mtd/nand/onenand/onenand_base.c 			mtd->eraseregions[i].erasesize = 1 << eraseshift;
mtd              3456 drivers/mtd/nand/onenand/onenand_base.c 			mtd->eraseregions[i].numblocks =
mtd              3458 drivers/mtd/nand/onenand/onenand_base.c 			ofs += mtd->eraseregions[i].numblocks << eraseshift;
mtd              3461 drivers/mtd/nand/onenand/onenand_base.c 			mtd->numeraseregions -= 1;
mtd              3462 drivers/mtd/nand/onenand/onenand_base.c 			mtd->eraseregions[i].numblocks +=
mtd              3468 drivers/mtd/nand/onenand/onenand_base.c 			mtd->eraseregions[i].offset = ofs;
mtd              3469 drivers/mtd/nand/onenand/onenand_base.c 			mtd->eraseregions[i].erasesize = 1 << eraseshift;
mtd              3470 drivers/mtd/nand/onenand/onenand_base.c 			mtd->eraseregions[i].numblocks = maxbdry ^
mtd              3472 drivers/mtd/nand/onenand/onenand_base.c 			ofs += mtd->eraseregions[i].numblocks << eraseshift;
mtd              3475 drivers/mtd/nand/onenand/onenand_base.c 			mtd->numeraseregions -= 1;
mtd              3479 drivers/mtd/nand/onenand/onenand_base.c 	mtd->erasesize = 1 << this->erase_shift;
mtd              3480 drivers/mtd/nand/onenand/onenand_base.c 	if (mtd->numeraseregions == 1)
mtd              3481 drivers/mtd/nand/onenand/onenand_base.c 		mtd->erasesize >>= 1;
mtd              3483 drivers/mtd/nand/onenand/onenand_base.c 	printk(KERN_INFO "Device has %d eraseregions\n", mtd->numeraseregions);
mtd              3484 drivers/mtd/nand/onenand/onenand_base.c 	for (i = 0; i < mtd->numeraseregions; i++)
mtd              3487 drivers/mtd/nand/onenand/onenand_base.c 			(unsigned int) mtd->eraseregions[i].offset,
mtd              3488 drivers/mtd/nand/onenand/onenand_base.c 			mtd->eraseregions[i].erasesize,
mtd              3489 drivers/mtd/nand/onenand/onenand_base.c 			mtd->eraseregions[i].numblocks);
mtd              3491 drivers/mtd/nand/onenand/onenand_base.c 	for (die = 0, mtd->size = 0; die < this->dies; die++) {
mtd              3495 drivers/mtd/nand/onenand/onenand_base.c 		mtd->size += this->diesize[die];
mtd              3513 drivers/mtd/nand/onenand/onenand_base.c static int flexonenand_check_blocks_erased(struct mtd_info *mtd, int start, int end)
mtd              3515 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              3521 drivers/mtd/nand/onenand/onenand_base.c 		.ooblen	= mtd->oobsize,
mtd              3531 drivers/mtd/nand/onenand/onenand_base.c 		if (onenand_block_isbad_nolock(mtd, addr, 0))
mtd              3538 drivers/mtd/nand/onenand/onenand_base.c 		ret = onenand_read_oob_nolock(mtd, addr, &ops);
mtd              3542 drivers/mtd/nand/onenand/onenand_base.c 		for (i = 0; i < mtd->oobsize; i++)
mtd              3546 drivers/mtd/nand/onenand/onenand_base.c 		if (i != mtd->oobsize) {
mtd              3560 drivers/mtd/nand/onenand/onenand_base.c static int flexonenand_set_boundary(struct mtd_info *mtd, int die,
mtd              3563 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              3588 drivers/mtd/nand/onenand/onenand_base.c 	ret = flexonenand_check_blocks_erased(mtd, min(old, new) + 1, max(old, new));
mtd              3595 drivers/mtd/nand/onenand/onenand_base.c 	this->command(mtd, FLEXONENAND_CMD_PI_ACCESS, die, 0);
mtd              3596 drivers/mtd/nand/onenand/onenand_base.c 	this->wait(mtd, FL_SYNCING);
mtd              3599 drivers/mtd/nand/onenand/onenand_base.c 	this->command(mtd, FLEXONENAND_CMD_READ_PI, die, 0);
mtd              3600 drivers/mtd/nand/onenand/onenand_base.c 	this->wait(mtd, FL_READING);
mtd              3617 drivers/mtd/nand/onenand/onenand_base.c 	this->command(mtd, ONENAND_CMD_ERASE, addr, 0);
mtd              3618 drivers/mtd/nand/onenand/onenand_base.c 	ret = this->wait(mtd, FL_ERASING);
mtd              3626 drivers/mtd/nand/onenand/onenand_base.c 	this->command(mtd, ONENAND_CMD_PROG, addr, 0);
mtd              3627 drivers/mtd/nand/onenand/onenand_base.c 	ret = this->wait(mtd, FL_WRITING);
mtd              3634 drivers/mtd/nand/onenand/onenand_base.c 	this->command(mtd, FLEXONENAND_CMD_PI_UPDATE, die, 0);
mtd              3635 drivers/mtd/nand/onenand/onenand_base.c 	ret = this->wait(mtd, FL_WRITING);
mtd              3638 drivers/mtd/nand/onenand/onenand_base.c 	this->wait(mtd, FL_RESETING);
mtd              3641 drivers/mtd/nand/onenand/onenand_base.c 		flexonenand_get_size(mtd);
mtd              3653 drivers/mtd/nand/onenand/onenand_base.c static int onenand_chip_probe(struct mtd_info *mtd)
mtd              3655 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              3674 drivers/mtd/nand/onenand/onenand_base.c 	this->wait(mtd, FL_RESETING);
mtd              3698 drivers/mtd/nand/onenand/onenand_base.c static int onenand_probe(struct mtd_info *mtd)
mtd              3700 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              3705 drivers/mtd/nand/onenand/onenand_base.c 	ret = this->chip_probe(mtd);
mtd              3720 drivers/mtd/nand/onenand/onenand_base.c 	onenand_check_features(mtd);
mtd              3726 drivers/mtd/nand/onenand/onenand_base.c 		mtd->numeraseregions = this->dies << 1;
mtd              3727 drivers/mtd/nand/onenand/onenand_base.c 		mtd->eraseregions =
mtd              3731 drivers/mtd/nand/onenand/onenand_base.c 		if (!mtd->eraseregions)
mtd              3743 drivers/mtd/nand/onenand/onenand_base.c 	mtd->writesize = this->read_word(this->base + ONENAND_REG_DATA_BUFFER_SIZE);
mtd              3746 drivers/mtd/nand/onenand/onenand_base.c 		mtd->writesize <<= 1;
mtd              3748 drivers/mtd/nand/onenand/onenand_base.c 	mtd->oobsize = mtd->writesize >> 5;
mtd              3750 drivers/mtd/nand/onenand/onenand_base.c 	mtd->erasesize = mtd->writesize << 6;
mtd              3757 drivers/mtd/nand/onenand/onenand_base.c 		mtd->erasesize <<= 1;
mtd              3759 drivers/mtd/nand/onenand/onenand_base.c 	this->erase_shift = ffs(mtd->erasesize) - 1;
mtd              3760 drivers/mtd/nand/onenand/onenand_base.c 	this->page_shift = ffs(mtd->writesize) - 1;
mtd              3766 drivers/mtd/nand/onenand/onenand_base.c 	this->writesize = mtd->writesize;
mtd              3771 drivers/mtd/nand/onenand/onenand_base.c 		flexonenand_get_size(mtd);
mtd              3773 drivers/mtd/nand/onenand/onenand_base.c 		mtd->size = this->chipsize;
mtd              3782 drivers/mtd/nand/onenand/onenand_base.c 		mtd->writesize <<= 1;
mtd              3783 drivers/mtd/nand/onenand/onenand_base.c 		mtd->erasesize <<= 1;
mtd              3793 drivers/mtd/nand/onenand/onenand_base.c static int onenand_suspend(struct mtd_info *mtd)
mtd              3795 drivers/mtd/nand/onenand/onenand_base.c 	return onenand_get_device(mtd, FL_PM_SUSPENDED);
mtd              3802 drivers/mtd/nand/onenand/onenand_base.c static void onenand_resume(struct mtd_info *mtd)
mtd              3804 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              3807 drivers/mtd/nand/onenand/onenand_base.c 		onenand_release_device(mtd);
mtd              3823 drivers/mtd/nand/onenand/onenand_base.c int onenand_scan(struct mtd_info *mtd, int maxchips)
mtd              3826 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              3836 drivers/mtd/nand/onenand/onenand_base.c 		onenand_setup_wait(mtd);
mtd              3855 drivers/mtd/nand/onenand/onenand_base.c 	if (onenand_probe(mtd))
mtd              3866 drivers/mtd/nand/onenand/onenand_base.c 		this->page_buf = kzalloc(mtd->writesize, GFP_KERNEL);
mtd              3870 drivers/mtd/nand/onenand/onenand_base.c 		this->verify_buf = kzalloc(mtd->writesize, GFP_KERNEL);
mtd              3879 drivers/mtd/nand/onenand/onenand_base.c 		this->oob_buf = kzalloc(mtd->oobsize, GFP_KERNEL);
mtd              3900 drivers/mtd/nand/onenand/onenand_base.c 	switch (mtd->oobsize) {
mtd              3903 drivers/mtd/nand/onenand/onenand_base.c 			mtd_set_ooblayout(mtd, &flexonenand_ooblayout_ops);
mtd              3904 drivers/mtd/nand/onenand/onenand_base.c 			mtd->subpage_sft = 0;
mtd              3906 drivers/mtd/nand/onenand/onenand_base.c 			mtd_set_ooblayout(mtd, &onenand_oob_128_ooblayout_ops);
mtd              3907 drivers/mtd/nand/onenand/onenand_base.c 			mtd->subpage_sft = 2;
mtd              3910 drivers/mtd/nand/onenand/onenand_base.c 			mtd->subpage_sft = 0;
mtd              3913 drivers/mtd/nand/onenand/onenand_base.c 		mtd_set_ooblayout(mtd, &onenand_oob_32_64_ooblayout_ops);
mtd              3914 drivers/mtd/nand/onenand/onenand_base.c 		mtd->subpage_sft = 2;
mtd              3918 drivers/mtd/nand/onenand/onenand_base.c 		mtd_set_ooblayout(mtd, &onenand_oob_32_64_ooblayout_ops);
mtd              3919 drivers/mtd/nand/onenand/onenand_base.c 		mtd->subpage_sft = 1;
mtd              3924 drivers/mtd/nand/onenand/onenand_base.c 			__func__, mtd->oobsize);
mtd              3925 drivers/mtd/nand/onenand/onenand_base.c 		mtd->subpage_sft = 0;
mtd              3927 drivers/mtd/nand/onenand/onenand_base.c 		mtd_set_ooblayout(mtd, &onenand_oob_32_64_ooblayout_ops);
mtd              3931 drivers/mtd/nand/onenand/onenand_base.c 	this->subpagesize = mtd->writesize >> mtd->subpage_sft;
mtd              3937 drivers/mtd/nand/onenand/onenand_base.c 	ret = mtd_ooblayout_count_freebytes(mtd);
mtd              3941 drivers/mtd/nand/onenand/onenand_base.c 	mtd->oobavail = ret;
mtd              3943 drivers/mtd/nand/onenand/onenand_base.c 	mtd->ecc_strength = 1;
mtd              3946 drivers/mtd/nand/onenand/onenand_base.c 	mtd->type = ONENAND_IS_MLC(this) ? MTD_MLCNANDFLASH : MTD_NANDFLASH;
mtd              3947 drivers/mtd/nand/onenand/onenand_base.c 	mtd->flags = MTD_CAP_NANDFLASH;
mtd              3948 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_erase = onenand_erase;
mtd              3949 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_point = NULL;
mtd              3950 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_unpoint = NULL;
mtd              3951 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_read_oob = onenand_read_oob;
mtd              3952 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_write_oob = onenand_write_oob;
mtd              3953 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_panic_write = onenand_panic_write;
mtd              3955 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_get_fact_prot_info = onenand_get_fact_prot_info;
mtd              3956 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_read_fact_prot_reg = onenand_read_fact_prot_reg;
mtd              3957 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_get_user_prot_info = onenand_get_user_prot_info;
mtd              3958 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_read_user_prot_reg = onenand_read_user_prot_reg;
mtd              3959 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_write_user_prot_reg = onenand_write_user_prot_reg;
mtd              3960 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_lock_user_prot_reg = onenand_lock_user_prot_reg;
mtd              3962 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_sync = onenand_sync;
mtd              3963 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_lock = onenand_lock;
mtd              3964 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_unlock = onenand_unlock;
mtd              3965 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_suspend = onenand_suspend;
mtd              3966 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_resume = onenand_resume;
mtd              3967 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_block_isbad = onenand_block_isbad;
mtd              3968 drivers/mtd/nand/onenand/onenand_base.c 	mtd->_block_markbad = onenand_block_markbad;
mtd              3969 drivers/mtd/nand/onenand/onenand_base.c 	mtd->owner = THIS_MODULE;
mtd              3970 drivers/mtd/nand/onenand/onenand_base.c 	mtd->writebufsize = mtd->writesize;
mtd              3974 drivers/mtd/nand/onenand/onenand_base.c 		this->unlock_all(mtd);
mtd              3979 drivers/mtd/nand/onenand/onenand_base.c 	ret = this->scan_bbt(mtd);
mtd              3985 drivers/mtd/nand/onenand/onenand_base.c 		flexonenand_set_boundary(mtd, i, flex_bdry[2 * i],
mtd              3995 drivers/mtd/nand/onenand/onenand_base.c void onenand_release(struct mtd_info *mtd)
mtd              3997 drivers/mtd/nand/onenand/onenand_base.c 	struct onenand_chip *this = mtd->priv;
mtd              4000 drivers/mtd/nand/onenand/onenand_base.c 	mtd_device_unregister(mtd);
mtd              4017 drivers/mtd/nand/onenand/onenand_base.c 	kfree(mtd->eraseregions);
mtd                56 drivers/mtd/nand/onenand/onenand_bbt.c static int create_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr *bd, int chip)
mtd                58 drivers/mtd/nand/onenand/onenand_bbt.c 	struct onenand_chip *this = mtd->priv;
mtd                94 drivers/mtd/nand/onenand/onenand_bbt.c 			ret = onenand_bbt_read_oob(mtd,
mtd               106 drivers/mtd/nand/onenand/onenand_bbt.c 				mtd->ecc_stats.badblocks++;
mtd               113 drivers/mtd/nand/onenand/onenand_bbt.c 			rgn = flexonenand_region(mtd, from);
mtd               114 drivers/mtd/nand/onenand/onenand_bbt.c 			from += mtd->eraseregions[rgn].erasesize;
mtd               131 drivers/mtd/nand/onenand/onenand_bbt.c static inline int onenand_memory_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd)
mtd               133 drivers/mtd/nand/onenand/onenand_bbt.c 	struct onenand_chip *this = mtd->priv;
mtd               135 drivers/mtd/nand/onenand/onenand_bbt.c 	return create_bbt(mtd, this->page_buf, bd, -1);
mtd               144 drivers/mtd/nand/onenand/onenand_bbt.c static int onenand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt)
mtd               146 drivers/mtd/nand/onenand/onenand_bbt.c 	struct onenand_chip *this = mtd->priv;
mtd               181 drivers/mtd/nand/onenand/onenand_bbt.c static int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)
mtd               183 drivers/mtd/nand/onenand/onenand_bbt.c 	struct onenand_chip *this = mtd->priv;
mtd               200 drivers/mtd/nand/onenand/onenand_bbt.c 	if ((ret = onenand_memory_bbt(mtd, bd))) {
mtd               229 drivers/mtd/nand/onenand/onenand_bbt.c int onenand_default_bbt(struct mtd_info *mtd)
mtd               231 drivers/mtd/nand/onenand/onenand_bbt.c 	struct onenand_chip *this = mtd->priv;
mtd               244 drivers/mtd/nand/onenand/onenand_bbt.c 	return onenand_scan_bbt(mtd, bbm->badblock_pattern);
mtd               123 drivers/mtd/nand/onenand/samsung.c 	struct mtd_info	*mtd;
mtd               218 drivers/mtd/nand/onenand/samsung.c 	struct onenand_chip *this = onenand->mtd->priv;
mtd               268 drivers/mtd/nand/onenand/samsung.c 	struct onenand_chip *this = onenand->mtd->priv;
mtd               310 drivers/mtd/nand/onenand/samsung.c static int s3c_onenand_wait(struct mtd_info *mtd, int state)
mtd               358 drivers/mtd/nand/onenand/samsung.c 			mtd->ecc_stats.failed++;
mtd               376 drivers/mtd/nand/onenand/samsung.c static int s3c_onenand_command(struct mtd_info *mtd, int cmd, loff_t addr,
mtd               379 drivers/mtd/nand/onenand/samsung.c 	struct onenand_chip *this = mtd->priv;
mtd               413 drivers/mtd/nand/onenand/samsung.c 		s += (mtd->oobsize >> 2);
mtd               416 drivers/mtd/nand/onenand/samsung.c 	mcount = mtd->writesize >> 2;
mtd               417 drivers/mtd/nand/onenand/samsung.c 	scount = mtd->oobsize >> 2;
mtd               474 drivers/mtd/nand/onenand/samsung.c static unsigned char *s3c_get_bufferram(struct mtd_info *mtd, int area)
mtd               476 drivers/mtd/nand/onenand/samsung.c 	struct onenand_chip *this = mtd->priv;
mtd               487 drivers/mtd/nand/onenand/samsung.c 			p += mtd->oobsize;
mtd               493 drivers/mtd/nand/onenand/samsung.c static int onenand_read_bufferram(struct mtd_info *mtd, int area,
mtd               499 drivers/mtd/nand/onenand/samsung.c 	p = s3c_get_bufferram(mtd, area);
mtd               504 drivers/mtd/nand/onenand/samsung.c static int onenand_write_bufferram(struct mtd_info *mtd, int area,
mtd               510 drivers/mtd/nand/onenand/samsung.c 	p = s3c_get_bufferram(mtd, area);
mtd               615 drivers/mtd/nand/onenand/samsung.c static int s5pc110_read_bufferram(struct mtd_info *mtd, int area,
mtd               618 drivers/mtd/nand/onenand/samsung.c 	struct onenand_chip *this = mtd->priv;
mtd               630 drivers/mtd/nand/onenand/samsung.c 			p += mtd->oobsize;
mtd               634 drivers/mtd/nand/onenand/samsung.c 		!onenand->dma_addr || count != mtd->writesize)
mtd               676 drivers/mtd/nand/onenand/samsung.c 	if (count != mtd->writesize) {
mtd               678 drivers/mtd/nand/onenand/samsung.c 		memcpy(this->page_buf, p, mtd->writesize);
mtd               687 drivers/mtd/nand/onenand/samsung.c static int s5pc110_chip_probe(struct mtd_info *mtd)
mtd               693 drivers/mtd/nand/onenand/samsung.c static int s3c_onenand_bbt_wait(struct mtd_info *mtd, int state)
mtd               726 drivers/mtd/nand/onenand/samsung.c static void s3c_onenand_check_lock_status(struct mtd_info *mtd)
mtd               728 drivers/mtd/nand/onenand/samsung.c 	struct onenand_chip *this = mtd->priv;
mtd               746 drivers/mtd/nand/onenand/samsung.c static void s3c_onenand_do_lock_cmd(struct mtd_info *mtd, loff_t ofs,
mtd               749 drivers/mtd/nand/onenand/samsung.c 	struct onenand_chip *this = mtd->priv;
mtd               769 drivers/mtd/nand/onenand/samsung.c 	this->wait(mtd, FL_LOCKING);
mtd               772 drivers/mtd/nand/onenand/samsung.c static void s3c_unlock_all(struct mtd_info *mtd)
mtd               774 drivers/mtd/nand/onenand/samsung.c 	struct onenand_chip *this = mtd->priv;
mtd               780 drivers/mtd/nand/onenand/samsung.c 		this->command(mtd, ONENAND_CMD_UNLOCK_ALL, 0, 0);
mtd               783 drivers/mtd/nand/onenand/samsung.c 		this->wait(mtd, FL_LOCKING);
mtd               787 drivers/mtd/nand/onenand/samsung.c 			s3c_onenand_check_lock_status(mtd);
mtd               796 drivers/mtd/nand/onenand/samsung.c 	s3c_onenand_do_lock_cmd(mtd, ofs, len, ONENAND_CMD_UNLOCK);
mtd               798 drivers/mtd/nand/onenand/samsung.c 	s3c_onenand_check_lock_status(mtd);
mtd               801 drivers/mtd/nand/onenand/samsung.c static void s3c_onenand_setup(struct mtd_info *mtd)
mtd               803 drivers/mtd/nand/onenand/samsung.c 	struct onenand_chip *this = mtd->priv;
mtd               805 drivers/mtd/nand/onenand/samsung.c 	onenand->mtd = mtd;
mtd               838 drivers/mtd/nand/onenand/samsung.c 	struct mtd_info *mtd;
mtd               846 drivers/mtd/nand/onenand/samsung.c 	mtd = devm_kzalloc(&pdev->dev, size, GFP_KERNEL);
mtd               847 drivers/mtd/nand/onenand/samsung.c 	if (!mtd)
mtd               855 drivers/mtd/nand/onenand/samsung.c 	this = (struct onenand_chip *) &mtd[1];
mtd               856 drivers/mtd/nand/onenand/samsung.c 	mtd->priv = this;
mtd               857 drivers/mtd/nand/onenand/samsung.c 	mtd->dev.parent = &pdev->dev;
mtd               861 drivers/mtd/nand/onenand/samsung.c 	s3c_onenand_setup(mtd);
mtd               894 drivers/mtd/nand/onenand/samsung.c 		mtd->subpage_sft = 0;
mtd               895 drivers/mtd/nand/onenand/samsung.c 		this->subpagesize = mtd->writesize;
mtd               920 drivers/mtd/nand/onenand/samsung.c 	err = onenand_scan(mtd, 1);
mtd               926 drivers/mtd/nand/onenand/samsung.c 		mtd->subpage_sft = 0;
mtd               927 drivers/mtd/nand/onenand/samsung.c 		this->subpagesize = mtd->writesize;
mtd               933 drivers/mtd/nand/onenand/samsung.c 	err = mtd_device_register(mtd, pdata ? pdata->parts : NULL,
mtd               937 drivers/mtd/nand/onenand/samsung.c 		onenand_release(mtd);
mtd               941 drivers/mtd/nand/onenand/samsung.c 	platform_set_drvdata(pdev, mtd);
mtd               948 drivers/mtd/nand/onenand/samsung.c 	struct mtd_info *mtd = platform_get_drvdata(pdev);
mtd               950 drivers/mtd/nand/onenand/samsung.c 	onenand_release(mtd);
mtd               957 drivers/mtd/nand/onenand/samsung.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               958 drivers/mtd/nand/onenand/samsung.c 	struct onenand_chip *this = mtd->priv;
mtd               960 drivers/mtd/nand/onenand/samsung.c 	this->wait(mtd, FL_PM_SUSPENDED);
mtd               966 drivers/mtd/nand/onenand/samsung.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               967 drivers/mtd/nand/onenand/samsung.c 	struct onenand_chip *this = mtd->priv;
mtd               969 drivers/mtd/nand/onenand/samsung.c 	this->unlock_all(mtd);
mtd               225 drivers/mtd/nand/raw/ams-delta.c 	struct mtd_info *mtd;
mtd               237 drivers/mtd/nand/raw/ams-delta.c 	mtd = nand_to_mtd(this);
mtd               238 drivers/mtd/nand/raw/ams-delta.c 	mtd->dev.parent = &pdev->dev;
mtd               318 drivers/mtd/nand/raw/ams-delta.c 	err = mtd_device_register(mtd, partition_info,
mtd               337 drivers/mtd/nand/raw/ams-delta.c 	struct mtd_info *mtd = nand_to_mtd(&priv->nand_chip);
mtd               340 drivers/mtd/nand/raw/ams-delta.c 	nand_release(mtd_to_nand(mtd));
mtd               520 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               542 drivers/mtd/nand/raw/atmel/nand-controller.c 			   ATMEL_HSMC_NFC_CFG_PAGESIZE(mtd->writesize) |
mtd               543 drivers/mtd/nand/raw/atmel/nand-controller.c 			   ATMEL_HSMC_NFC_CFG_SPARESIZE(mtd->oobsize) |
mtd               649 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               657 drivers/mtd/nand/raw/atmel/nand-controller.c 					      nc->sram.dma, mtd->writesize,
mtd               662 drivers/mtd/nand/raw/atmel/nand-controller.c 		memcpy_toio(nc->sram.virt, buf, mtd->writesize);
mtd               665 drivers/mtd/nand/raw/atmel/nand-controller.c 		memcpy_toio(nc->sram.virt + mtd->writesize, chip->oob_poi,
mtd               666 drivers/mtd/nand/raw/atmel/nand-controller.c 			    mtd->oobsize);
mtd               672 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               680 drivers/mtd/nand/raw/atmel/nand-controller.c 					      mtd->writesize, DMA_FROM_DEVICE);
mtd               684 drivers/mtd/nand/raw/atmel/nand-controller.c 		memcpy_fromio(buf, nc->sram.virt, mtd->writesize);
mtd               687 drivers/mtd/nand/raw/atmel/nand-controller.c 		memcpy_fromio(chip->oob_poi, nc->sram.virt + mtd->writesize,
mtd               688 drivers/mtd/nand/raw/atmel/nand-controller.c 			      mtd->oobsize);
mtd               693 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               704 drivers/mtd/nand/raw/atmel/nand-controller.c 		if (mtd->writesize > 512)
mtd               747 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               766 drivers/mtd/nand/raw/atmel/nand-controller.c 	mtd_ooblayout_ecc(mtd, 0, &oobregion);
mtd               782 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               801 drivers/mtd/nand/raw/atmel/nand-controller.c 	mtd_ooblayout_ecc(mtd, 0, &oobregion);
mtd               819 drivers/mtd/nand/raw/atmel/nand-controller.c 			mtd->ecc_stats.failed++;
mtd               831 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               841 drivers/mtd/nand/raw/atmel/nand-controller.c 	atmel_nand_write_buf(chip, buf, mtd->writesize);
mtd               851 drivers/mtd/nand/raw/atmel/nand-controller.c 	atmel_nand_write_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               872 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               881 drivers/mtd/nand/raw/atmel/nand-controller.c 	atmel_nand_read_buf(chip, buf, mtd->writesize);
mtd               882 drivers/mtd/nand/raw/atmel/nand-controller.c 	atmel_nand_read_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               907 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               942 drivers/mtd/nand/raw/atmel/nand-controller.c 	atmel_nand_write_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               979 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1000 drivers/mtd/nand/raw/atmel/nand-controller.c 	if (mtd->writesize > 512)
mtd              1046 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1087 drivers/mtd/nand/raw/atmel/nand-controller.c 	req.pagesize = mtd->writesize;
mtd              1088 drivers/mtd/nand/raw/atmel/nand-controller.c 	req.oobsize = mtd->oobsize;
mtd              1090 drivers/mtd/nand/raw/atmel/nand-controller.c 	if (mtd->writesize <= 512) {
mtd              1094 drivers/mtd/nand/raw/atmel/nand-controller.c 		req.ecc.bytes = mtd->oobsize - 2;
mtd              1109 drivers/mtd/nand/raw/atmel/nand-controller.c 	mtd_set_ooblayout(mtd, &nand_ooblayout_lp_ops);
mtd              1474 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1476 drivers/mtd/nand/raw/atmel/nand-controller.c 	mtd->dev.parent = nc->dev;
mtd              1545 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1548 drivers/mtd/nand/raw/atmel/nand-controller.c 	ret = mtd_device_unregister(mtd);
mtd              1668 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1685 drivers/mtd/nand/raw/atmel/nand-controller.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd              1920 drivers/mtd/nand/raw/atmel/nand-controller.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1933 drivers/mtd/nand/raw/atmel/nand-controller.c 		mtd->name = "atmel_nand";
mtd              1934 drivers/mtd/nand/raw/atmel/nand-controller.c 	} else if (!mtd->name) {
mtd              1945 drivers/mtd/nand/raw/atmel/nand-controller.c 		mtd->name = devm_kasprintf(nc->dev, GFP_KERNEL,
mtd              1948 drivers/mtd/nand/raw/atmel/nand-controller.c 		if (!mtd->name) {
mtd               168 drivers/mtd/nand/raw/au1550nd.c static void au1550_hwcontrol(struct mtd_info *mtd, int cmd)
mtd               170 drivers/mtd/nand/raw/au1550nd.c 	struct nand_chip *this = mtd_to_nand(mtd);
mtd               242 drivers/mtd/nand/raw/au1550nd.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               249 drivers/mtd/nand/raw/au1550nd.c 	au1550_hwcontrol(mtd, NAND_CTL_SETCLE);
mtd               256 drivers/mtd/nand/raw/au1550nd.c 		if (column >= mtd->writesize) {
mtd               258 drivers/mtd/nand/raw/au1550nd.c 			column -= mtd->writesize;
mtd               272 drivers/mtd/nand/raw/au1550nd.c 	au1550_hwcontrol(mtd, NAND_CTL_CLRCLE);
mtd               275 drivers/mtd/nand/raw/au1550nd.c 		au1550_hwcontrol(mtd, NAND_CTL_SETALE);
mtd               301 drivers/mtd/nand/raw/au1550nd.c 				au1550_hwcontrol(mtd, NAND_CTL_SETNCE);
mtd               311 drivers/mtd/nand/raw/au1550nd.c 		au1550_hwcontrol(mtd, NAND_CTL_CLRALE);
mtd               345 drivers/mtd/nand/raw/au1550nd.c 		au1550_hwcontrol(mtd, NAND_CTL_CLRNCE);
mtd               381 drivers/mtd/nand/raw/au1550nd.c 	struct mtd_info *mtd;
mtd               415 drivers/mtd/nand/raw/au1550nd.c 	mtd = nand_to_mtd(this);
mtd               416 drivers/mtd/nand/raw/au1550nd.c 	mtd->dev.parent = &pdev->dev;
mtd               450 drivers/mtd/nand/raw/au1550nd.c 	mtd_device_register(mtd, pd->parts, pd->num_parts);
mtd                26 drivers/mtd/nand/raw/bcm47xxnflash/main.c 	struct mtd_info *mtd;
mtd                34 drivers/mtd/nand/raw/bcm47xxnflash/main.c 	mtd = nand_to_mtd(&b47n->nand_chip);
mtd                35 drivers/mtd/nand/raw/bcm47xxnflash/main.c 	mtd->dev.parent = &pdev->dev;
mtd                51 drivers/mtd/nand/raw/bcm47xxnflash/main.c 	err = mtd_device_parse_register(mtd, probes, NULL, NULL, 0);
mtd                85 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c static void bcm47xxnflash_ops_bcm4706_read(struct mtd_info *mtd, uint8_t *buf,
mtd                88 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd               135 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c static void bcm47xxnflash_ops_bcm4706_write(struct mtd_info *mtd,
mtd               138 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd               213 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c 	struct mtd_info *mtd = nand_to_mtd(nand_chip);
mtd               268 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c 			b47n->curr_column += mtd->writesize;
mtd               309 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c 	struct mtd_info *mtd = nand_to_mtd(nand_chip);
mtd               327 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c 		bcm47xxnflash_ops_bcm4706_read(mtd, (u8 *)&tmp, 4);
mtd               680 drivers/mtd/nand/raw/brcmnand/brcmnand.c static void brcmnand_set_cmd_addr(struct mtd_info *mtd, u64 addr)
mtd               682 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct nand_chip *chip =  mtd_to_nand(mtd);
mtd               980 drivers/mtd/nand/raw/brcmnand/brcmnand.c static int brcmnand_hamming_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               983 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               998 drivers/mtd/nand/raw/brcmnand/brcmnand.c static int brcmnand_hamming_ooblayout_free(struct mtd_info *mtd, int section,
mtd              1001 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              1038 drivers/mtd/nand/raw/brcmnand/brcmnand.c static int brcmnand_bch_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd              1041 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              1056 drivers/mtd/nand/raw/brcmnand/brcmnand.c static int brcmnand_bch_ooblayout_free_lp(struct mtd_info *mtd, int section,
mtd              1059 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              1082 drivers/mtd/nand/raw/brcmnand/brcmnand.c static int brcmnand_bch_ooblayout_free_sp(struct mtd_info *mtd, int section,
mtd              1085 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              1118 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct mtd_info *mtd = nand_to_mtd(&host->chip);
mtd              1129 drivers/mtd/nand/raw/brcmnand/brcmnand.c 		mtd_set_ooblayout(mtd, &brcmnand_hamming_ooblayout_ops);
mtd              1141 drivers/mtd/nand/raw/brcmnand/brcmnand.c 		mtd_set_ooblayout(mtd, &brcmnand_bch_sp_ooblayout_ops);
mtd              1143 drivers/mtd/nand/raw/brcmnand/brcmnand.c 		mtd_set_ooblayout(mtd, &brcmnand_bch_lp_ooblayout_ops);
mtd              1155 drivers/mtd/nand/raw/brcmnand/brcmnand.c static void brcmnand_wp(struct mtd_info *mtd, int wp)
mtd              1157 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              1355 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1359 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	if (mtd->oops_panic_write) {
mtd              1452 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1487 drivers/mtd/nand/raw/brcmnand/brcmnand.c 		brcmnand_wp(mtd, 0);
mtd              1515 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	brcmnand_set_cmd_addr(mtd, addr);
mtd              1548 drivers/mtd/nand/raw/brcmnand/brcmnand.c 		brcmnand_wp(mtd, 1);
mtd              1725 drivers/mtd/nand/raw/brcmnand/brcmnand.c static int brcmnand_read_by_pio(struct mtd_info *mtd, struct nand_chip *chip,
mtd              1736 drivers/mtd/nand/raw/brcmnand/brcmnand.c 		brcmnand_set_cmd_addr(mtd, addr);
mtd              1752 drivers/mtd/nand/raw/brcmnand/brcmnand.c 					mtd->oobsize / trans,
mtd              1787 drivers/mtd/nand/raw/brcmnand/brcmnand.c static int brcmstb_nand_verify_erased_page(struct mtd_info *mtd,
mtd              1800 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	sas = mtd->oobsize / chip->ecc.steps;
mtd              1822 drivers/mtd/nand/raw/brcmnand/brcmnand.c static int brcmnand_read(struct mtd_info *mtd, struct nand_chip *chip,
mtd              1847 drivers/mtd/nand/raw/brcmnand/brcmnand.c 			memset(oob, 0x99, mtd->oobsize);
mtd              1849 drivers/mtd/nand/raw/brcmnand/brcmnand.c 		err = brcmnand_read_by_pio(mtd, chip, addr, trans, buf,
mtd              1875 drivers/mtd/nand/raw/brcmnand/brcmnand.c 			err = brcmstb_nand_verify_erased_page(mtd, chip, buf,
mtd              1884 drivers/mtd/nand/raw/brcmnand/brcmnand.c 		mtd->ecc_stats.failed++;
mtd              1894 drivers/mtd/nand/raw/brcmnand/brcmnand.c 		mtd->ecc_stats.corrected += corrected;
mtd              1896 drivers/mtd/nand/raw/brcmnand/brcmnand.c 		return max(mtd->bitflip_threshold, corrected);
mtd              1905 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1911 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	return brcmnand_read(mtd, chip, host->last_addr,
mtd              1912 drivers/mtd/nand/raw/brcmnand/brcmnand.c 			mtd->writesize >> FC_SHIFT, (u32 *)buf, oob);
mtd              1919 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1926 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	ret = brcmnand_read(mtd, chip, host->last_addr,
mtd              1927 drivers/mtd/nand/raw/brcmnand/brcmnand.c 			mtd->writesize >> FC_SHIFT, (u32 *)buf, oob);
mtd              1934 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1936 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	return brcmnand_read(mtd, chip, (u64)page << chip->page_shift,
mtd              1937 drivers/mtd/nand/raw/brcmnand/brcmnand.c 			mtd->writesize >> FC_SHIFT,
mtd              1943 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1947 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	brcmnand_read(mtd, chip, (u64)page << chip->page_shift,
mtd              1948 drivers/mtd/nand/raw/brcmnand/brcmnand.c 		mtd->writesize >> FC_SHIFT,
mtd              1954 drivers/mtd/nand/raw/brcmnand/brcmnand.c static int brcmnand_write(struct mtd_info *mtd, struct nand_chip *chip,
mtd              1959 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	unsigned int i, j, trans = mtd->writesize >> FC_SHIFT;
mtd              1969 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	brcmnand_wp(mtd, 0);
mtd              1976 drivers/mtd/nand/raw/brcmnand/brcmnand.c 					mtd->writesize, CMD_PROGRAM_PAGE))
mtd              1983 drivers/mtd/nand/raw/brcmnand/brcmnand.c 		brcmnand_set_cmd_addr(mtd, addr);
mtd              1999 drivers/mtd/nand/raw/brcmnand/brcmnand.c 					mtd->oobsize / trans,
mtd              2015 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	brcmnand_wp(mtd, 1);
mtd              2022 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2027 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	brcmnand_write(mtd, chip, host->last_addr, (const u32 *)buf, oob);
mtd              2035 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2041 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	brcmnand_write(mtd, chip, host->last_addr, (const u32 *)buf, oob);
mtd              2056 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2061 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	ret = brcmnand_write(mtd, chip, (u64)page << chip->page_shift, NULL,
mtd              2204 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct mtd_info *mtd = nand_to_mtd(&host->chip);
mtd              2219 drivers/mtd/nand/raw/brcmnand/brcmnand.c 		cfg->spare_area_size = mtd->oobsize /
mtd              2220 drivers/mtd/nand/raw/brcmnand/brcmnand.c 					(mtd->writesize >> FC_SHIFT);
mtd              2230 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	mtd->oobsize = cfg->spare_area_size * (mtd->writesize >> FC_SHIFT);
mtd              2232 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	cfg->device_size = mtd->size;
mtd              2233 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	cfg->block_size = mtd->erasesize;
mtd              2234 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	cfg->page_size = mtd->writesize;
mtd              2237 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	cfg->blk_adr_bytes = get_blk_adr_bytes(mtd->size, mtd->writesize);
mtd              2301 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	if (mtd->writesize > 512)
mtd              2335 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2356 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	mtd->bitflip_threshold = 1;
mtd              2371 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	struct mtd_info *mtd;
mtd              2382 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	mtd = nand_to_mtd(&host->chip);
mtd              2387 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	mtd->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "brcmnand.%d",
mtd              2389 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	if (!mtd->name)
mtd              2392 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	mtd->owner = THIS_MODULE;
mtd              2393 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	mtd->dev.parent = &pdev->dev;
mtd              2427 drivers/mtd/nand/raw/brcmnand/brcmnand.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd               163 drivers/mtd/nand/raw/cafe_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               185 drivers/mtd/nand/raw/cafe_nand.c 	if (mtd->writesize > 512 &&
mtd               187 drivers/mtd/nand/raw/cafe_nand.c 		column += mtd->writesize;
mtd               205 drivers/mtd/nand/raw/cafe_nand.c 		if (mtd->size > mtd->writesize << 16)
mtd               225 drivers/mtd/nand/raw/cafe_nand.c 		cafe->datalen = mtd->writesize + mtd->oobsize - column;
mtd               244 drivers/mtd/nand/raw/cafe_nand.c 	else if (command == NAND_CMD_READ0 && mtd->writesize > 512)
mtd               333 drivers/mtd/nand/raw/cafe_nand.c 	struct mtd_info *mtd = id;
mtd               334 drivers/mtd/nand/raw/cafe_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               347 drivers/mtd/nand/raw/cafe_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               349 drivers/mtd/nand/raw/cafe_nand.c 	return nand_prog_page_op(chip, page, mtd->writesize, chip->oob_poi,
mtd               350 drivers/mtd/nand/raw/cafe_nand.c 				 mtd->oobsize);
mtd               356 drivers/mtd/nand/raw/cafe_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               358 drivers/mtd/nand/raw/cafe_nand.c 	return nand_read_oob_op(chip, page, 0, chip->oob_poi, mtd->oobsize);
mtd               373 drivers/mtd/nand/raw/cafe_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               381 drivers/mtd/nand/raw/cafe_nand.c 	nand_read_page_op(chip, page, 0, buf, mtd->writesize);
mtd               382 drivers/mtd/nand/raw/cafe_nand.c 	chip->legacy.read_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               439 drivers/mtd/nand/raw/cafe_nand.c 			mtd->ecc_stats.failed++;
mtd               442 drivers/mtd/nand/raw/cafe_nand.c 			mtd->ecc_stats.corrected += n;
mtd               450 drivers/mtd/nand/raw/cafe_nand.c static int cafe_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               453 drivers/mtd/nand/raw/cafe_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               464 drivers/mtd/nand/raw/cafe_nand.c static int cafe_ooblayout_free(struct mtd_info *mtd, int section,
mtd               467 drivers/mtd/nand/raw/cafe_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               473 drivers/mtd/nand/raw/cafe_nand.c 	oobregion->length = mtd->oobsize - chip->ecc.total;
mtd               537 drivers/mtd/nand/raw/cafe_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               540 drivers/mtd/nand/raw/cafe_nand.c 	nand_prog_page_begin_op(chip, page, 0, buf, mtd->writesize);
mtd               541 drivers/mtd/nand/raw/cafe_nand.c 	chip->legacy.write_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               598 drivers/mtd/nand/raw/cafe_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               618 drivers/mtd/nand/raw/cafe_nand.c 	if (mtd->writesize == 2048)
mtd               622 drivers/mtd/nand/raw/cafe_nand.c 	mtd_set_ooblayout(mtd, &cafe_ooblayout_ops);
mtd               623 drivers/mtd/nand/raw/cafe_nand.c 	if (mtd->writesize == 2048) {
mtd               626 drivers/mtd/nand/raw/cafe_nand.c 	} else if (mtd->writesize == 512) {
mtd               632 drivers/mtd/nand/raw/cafe_nand.c 			 mtd->writesize);
mtd               638 drivers/mtd/nand/raw/cafe_nand.c 	cafe->nand.ecc.size = mtd->writesize;
mtd               669 drivers/mtd/nand/raw/cafe_nand.c 	struct mtd_info *mtd;
mtd               689 drivers/mtd/nand/raw/cafe_nand.c 	mtd = nand_to_mtd(&cafe->nand);
mtd               690 drivers/mtd/nand/raw/cafe_nand.c 	mtd->dev.parent = &pdev->dev;
mtd               757 drivers/mtd/nand/raw/cafe_nand.c 			  "CAFE NAND", mtd);
mtd               789 drivers/mtd/nand/raw/cafe_nand.c 	pci_set_drvdata(pdev, mtd);
mtd               791 drivers/mtd/nand/raw/cafe_nand.c 	mtd->name = "cafe_nand";
mtd               792 drivers/mtd/nand/raw/cafe_nand.c 	err = mtd_device_parse_register(mtd, part_probes, NULL, NULL, 0);
mtd               803 drivers/mtd/nand/raw/cafe_nand.c 	free_irq(pdev->irq, mtd);
mtd               814 drivers/mtd/nand/raw/cafe_nand.c 	struct mtd_info *mtd = pci_get_drvdata(pdev);
mtd               815 drivers/mtd/nand/raw/cafe_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               820 drivers/mtd/nand/raw/cafe_nand.c 	free_irq(pdev->irq, mtd);
mtd               839 drivers/mtd/nand/raw/cafe_nand.c 	struct mtd_info *mtd = pci_get_drvdata(pdev);
mtd               840 drivers/mtd/nand/raw/cafe_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               315 drivers/mtd/nand/raw/cs553x_nand.c 		struct mtd_info *mtd = cs553x_mtd[i];
mtd               319 drivers/mtd/nand/raw/cs553x_nand.c 		if (!mtd)
mtd               322 drivers/mtd/nand/raw/cs553x_nand.c 		this = mtd_to_nand(mtd);
mtd               327 drivers/mtd/nand/raw/cs553x_nand.c 		kfree(mtd->name);
mtd                64 drivers/mtd/nand/raw/davinci_nand.c static inline struct davinci_nand_info *to_davinci_nand(struct mtd_info *mtd)
mtd                66 drivers/mtd/nand/raw/davinci_nand.c 	return container_of(mtd_to_nand(mtd), struct davinci_nand_info, chip);
mtd               127 drivers/mtd/nand/raw/davinci_nand.c static inline uint32_t nand_davinci_readecc_1bit(struct mtd_info *mtd)
mtd               129 drivers/mtd/nand/raw/davinci_nand.c 	struct davinci_nand_info *info = to_davinci_nand(mtd);
mtd               463 drivers/mtd/nand/raw/davinci_nand.c static int hwecc4_ooblayout_small_ecc(struct mtd_info *mtd, int section,
mtd               483 drivers/mtd/nand/raw/davinci_nand.c static int hwecc4_ooblayout_small_free(struct mtd_info *mtd, int section,
mtd               494 drivers/mtd/nand/raw/davinci_nand.c 		oobregion->length = mtd->oobsize - 16;
mtd               592 drivers/mtd/nand/raw/davinci_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               593 drivers/mtd/nand/raw/davinci_nand.c 	struct davinci_nand_info *info = to_davinci_nand(mtd);
mtd               660 drivers/mtd/nand/raw/davinci_nand.c 		int chunks = mtd->writesize / 512;
mtd               662 drivers/mtd/nand/raw/davinci_nand.c 		if (!chunks || mtd->oobsize < 16) {
mtd               672 drivers/mtd/nand/raw/davinci_nand.c 			mtd_set_ooblayout(mtd, &hwecc4_small_ooblayout_ops);
mtd               674 drivers/mtd/nand/raw/davinci_nand.c 			mtd_set_ooblayout(mtd, &nand_ooblayout_lp_ops);
mtd               698 drivers/mtd/nand/raw/davinci_nand.c 	struct mtd_info			*mtd;
mtd               745 drivers/mtd/nand/raw/davinci_nand.c 	mtd			= nand_to_mtd(&info->chip);
mtd               746 drivers/mtd/nand/raw/davinci_nand.c 	mtd->dev.parent		= &pdev->dev;
mtd               799 drivers/mtd/nand/raw/davinci_nand.c 		ret = mtd_device_register(mtd, pdata->parts, pdata->nr_parts);
mtd               801 drivers/mtd/nand/raw/davinci_nand.c 		ret = mtd_device_register(mtd, NULL, 0);
mtd               197 drivers/mtd/nand/raw/denali.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               205 drivers/mtd/nand/raw/denali.c 	iowrite32(mtd->writesize, denali->reg + DEVICE_MAIN_AREA_SIZE);
mtd               206 drivers/mtd/nand/raw/denali.c 	iowrite32(mtd->oobsize, denali->reg + DEVICE_SPARE_AREA_SIZE);
mtd               246 drivers/mtd/nand/raw/denali.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               248 drivers/mtd/nand/raw/denali.c 	int writesize = mtd->writesize;
mtd               283 drivers/mtd/nand/raw/denali.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               285 drivers/mtd/nand/raw/denali.c 	int writesize = mtd->writesize;
mtd               286 drivers/mtd/nand/raw/denali.c 	int oobsize = mtd->oobsize;
mtd               728 drivers/mtd/nand/raw/denali.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               733 drivers/mtd/nand/raw/denali.c 	ret = denali_page_xfer(chip, buf, mtd->writesize, page, false);
mtd               760 drivers/mtd/nand/raw/denali.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               762 drivers/mtd/nand/raw/denali.c 	return denali_page_xfer(chip, (void *)buf, mtd->writesize, page, true);
mtd               900 drivers/mtd/nand/raw/denali.c static int denali_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               903 drivers/mtd/nand/raw/denali.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               915 drivers/mtd/nand/raw/denali.c static int denali_ooblayout_free(struct mtd_info *mtd, int section,
mtd               918 drivers/mtd/nand/raw/denali.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               925 drivers/mtd/nand/raw/denali.c 	oobregion->length = mtd->oobsize - oobregion->offset;
mtd               938 drivers/mtd/nand/raw/denali.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               973 drivers/mtd/nand/raw/denali.c 	mtd->size <<= 1;
mtd               974 drivers/mtd/nand/raw/denali.c 	mtd->erasesize <<= 1;
mtd               975 drivers/mtd/nand/raw/denali.c 	mtd->writesize <<= 1;
mtd               976 drivers/mtd/nand/raw/denali.c 	mtd->oobsize <<= 1;
mtd               993 drivers/mtd/nand/raw/denali.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               997 drivers/mtd/nand/raw/denali.c 				   mtd->oobsize - denali->oob_skip_bytes);
mtd              1161 drivers/mtd/nand/raw/denali.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1197 drivers/mtd/nand/raw/denali.c 	mtd->dev.parent = denali->dev;
mtd              1203 drivers/mtd/nand/raw/denali.c 	if (!mtd->name && list_empty(&denali->chips))
mtd              1204 drivers/mtd/nand/raw/denali.c 		mtd->name = "denali-nand";
mtd              1226 drivers/mtd/nand/raw/denali.c 	mtd_set_ooblayout(mtd, &denali_ooblayout_ops);
mtd              1232 drivers/mtd/nand/raw/denali.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd                74 drivers/mtd/nand/raw/diskonchip.c 	int (*late_init)(struct mtd_info *mtd);
mtd               369 drivers/mtd/nand/raw/diskonchip.c static uint16_t __init doc200x_ident_chip(struct mtd_info *mtd, int nr)
mtd               371 drivers/mtd/nand/raw/diskonchip.c 	struct nand_chip *this = mtd_to_nand(mtd);
mtd               415 drivers/mtd/nand/raw/diskonchip.c static void __init doc2000_count_chips(struct mtd_info *mtd)
mtd               417 drivers/mtd/nand/raw/diskonchip.c 	struct nand_chip *this = mtd_to_nand(mtd);
mtd               426 drivers/mtd/nand/raw/diskonchip.c 	mfrid = doc200x_ident_chip(mtd, 0);
mtd               430 drivers/mtd/nand/raw/diskonchip.c 		if (doc200x_ident_chip(mtd, i) != mfrid)
mtd               644 drivers/mtd/nand/raw/diskonchip.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               663 drivers/mtd/nand/raw/diskonchip.c 		if (column >= mtd->writesize) {
mtd               665 drivers/mtd/nand/raw/diskonchip.c 			column -= mtd->writesize;
mtd               933 drivers/mtd/nand/raw/diskonchip.c static int doc200x_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               945 drivers/mtd/nand/raw/diskonchip.c static int doc200x_ooblayout_free(struct mtd_info *mtd, int section,
mtd               985 drivers/mtd/nand/raw/diskonchip.c static int __init find_media_headers(struct mtd_info *mtd, u_char *buf, const char *id, int findmirror)
mtd               987 drivers/mtd/nand/raw/diskonchip.c 	struct nand_chip *this = mtd_to_nand(mtd);
mtd               993 drivers/mtd/nand/raw/diskonchip.c 	for (offs = 0; offs < mtd->size; offs += mtd->erasesize) {
mtd               994 drivers/mtd/nand/raw/diskonchip.c 		ret = mtd_read(mtd, offs, mtd->writesize, &retlen, buf);
mtd               995 drivers/mtd/nand/raw/diskonchip.c 		if (retlen != mtd->writesize)
mtd              1019 drivers/mtd/nand/raw/diskonchip.c 	ret = mtd_read(mtd, offs, mtd->writesize, &retlen, buf);
mtd              1020 drivers/mtd/nand/raw/diskonchip.c 	if (retlen != mtd->writesize) {
mtd              1028 drivers/mtd/nand/raw/diskonchip.c static inline int __init nftl_partscan(struct mtd_info *mtd, struct mtd_partition *parts)
mtd              1030 drivers/mtd/nand/raw/diskonchip.c 	struct nand_chip *this = mtd_to_nand(mtd);
mtd              1043 drivers/mtd/nand/raw/diskonchip.c 	buf = kmalloc(mtd->writesize, GFP_KERNEL);
mtd              1047 drivers/mtd/nand/raw/diskonchip.c 	if (!(numheaders = find_media_headers(mtd, buf, "ANAND", 1)))
mtd              1064 drivers/mtd/nand/raw/diskonchip.c 	blocks = mtd->size >> this->phys_erase_shift;
mtd              1065 drivers/mtd/nand/raw/diskonchip.c 	maxblocks = min(32768U, mtd->erasesize - psize);
mtd              1090 drivers/mtd/nand/raw/diskonchip.c 		mtd->erasesize <<= (0xff - mh->UnitSizeFactor);
mtd              1091 drivers/mtd/nand/raw/diskonchip.c 		pr_info("Setting virtual erase size to %d\n", mtd->erasesize);
mtd              1092 drivers/mtd/nand/raw/diskonchip.c 		blocks = mtd->size >> this->bbt_erase_shift;
mtd              1093 drivers/mtd/nand/raw/diskonchip.c 		maxblocks = min(32768U, mtd->erasesize - psize);
mtd              1104 drivers/mtd/nand/raw/diskonchip.c 	offs += mtd->erasesize;
mtd              1120 drivers/mtd/nand/raw/diskonchip.c 	if (offs < mtd->size) {
mtd              1123 drivers/mtd/nand/raw/diskonchip.c 		parts[numparts].size = mtd->size - offs;
mtd              1134 drivers/mtd/nand/raw/diskonchip.c static inline int __init inftl_partscan(struct mtd_info *mtd, struct mtd_partition *parts)
mtd              1136 drivers/mtd/nand/raw/diskonchip.c 	struct nand_chip *this = mtd_to_nand(mtd);
mtd              1146 drivers/mtd/nand/raw/diskonchip.c 	int end = mtd->size;
mtd              1151 drivers/mtd/nand/raw/diskonchip.c 	buf = kmalloc(mtd->writesize, GFP_KERNEL);
mtd              1156 drivers/mtd/nand/raw/diskonchip.c 	if (!find_media_headers(mtd, buf, "BNAND", 0))
mtd              1188 drivers/mtd/nand/raw/diskonchip.c 	blocks = mtd->size >> vshift;
mtd              1195 drivers/mtd/nand/raw/diskonchip.c 	if (inftl_bbt_write && (blocks > mtd->erasesize)) {
mtd              1224 drivers/mtd/nand/raw/diskonchip.c 			parts[0].size = mtd->erasesize * ip->firstUnit;
mtd              1253 drivers/mtd/nand/raw/diskonchip.c static int __init nftl_scan_bbt(struct mtd_info *mtd)
mtd              1256 drivers/mtd/nand/raw/diskonchip.c 	struct nand_chip *this = mtd_to_nand(mtd);
mtd              1263 drivers/mtd/nand/raw/diskonchip.c 	numparts = nftl_partscan(mtd, parts);
mtd              1285 drivers/mtd/nand/raw/diskonchip.c 	return mtd_device_register(mtd, parts, no_autopart ? 0 : numparts);
mtd              1288 drivers/mtd/nand/raw/diskonchip.c static int __init inftl_scan_bbt(struct mtd_info *mtd)
mtd              1291 drivers/mtd/nand/raw/diskonchip.c 	struct nand_chip *this = mtd_to_nand(mtd);
mtd              1333 drivers/mtd/nand/raw/diskonchip.c 	numparts = inftl_partscan(mtd, parts);
mtd              1339 drivers/mtd/nand/raw/diskonchip.c 	return mtd_device_register(mtd, parts, no_autopart ? 0 : numparts);
mtd              1342 drivers/mtd/nand/raw/diskonchip.c static inline int __init doc2000_init(struct mtd_info *mtd)
mtd              1344 drivers/mtd/nand/raw/diskonchip.c 	struct nand_chip *this = mtd_to_nand(mtd);
mtd              1353 drivers/mtd/nand/raw/diskonchip.c 	doc2000_count_chips(mtd);
mtd              1354 drivers/mtd/nand/raw/diskonchip.c 	mtd->name = "DiskOnChip 2000 (NFTL Model)";
mtd              1358 drivers/mtd/nand/raw/diskonchip.c static inline int __init doc2001_init(struct mtd_info *mtd)
mtd              1360 drivers/mtd/nand/raw/diskonchip.c 	struct nand_chip *this = mtd_to_nand(mtd);
mtd              1375 drivers/mtd/nand/raw/diskonchip.c 		doc2000_count_chips(mtd);
mtd              1376 drivers/mtd/nand/raw/diskonchip.c 		mtd->name = "DiskOnChip 2000 (INFTL Model)";
mtd              1382 drivers/mtd/nand/raw/diskonchip.c 		mtd->name = "DiskOnChip Millennium";
mtd              1388 drivers/mtd/nand/raw/diskonchip.c static inline int __init doc2001plus_init(struct mtd_info *mtd)
mtd              1390 drivers/mtd/nand/raw/diskonchip.c 	struct nand_chip *this = mtd_to_nand(mtd);
mtd              1403 drivers/mtd/nand/raw/diskonchip.c 	mtd->name = "DiskOnChip Millennium Plus";
mtd              1413 drivers/mtd/nand/raw/diskonchip.c 	struct mtd_info *mtd;
mtd              1506 drivers/mtd/nand/raw/diskonchip.c 	for (mtd = doclist; mtd; mtd = doc->nextdoc) {
mtd              1509 drivers/mtd/nand/raw/diskonchip.c 		nand = mtd_to_nand(mtd);
mtd              1569 drivers/mtd/nand/raw/diskonchip.c 	mtd			= nand_to_mtd(nand);
mtd              1573 drivers/mtd/nand/raw/diskonchip.c 	mtd->owner		= THIS_MODULE;
mtd              1574 drivers/mtd/nand/raw/diskonchip.c 	mtd_set_ooblayout(mtd, &doc200x_ooblayout_ops);
mtd              1605 drivers/mtd/nand/raw/diskonchip.c 		numchips = doc2000_init(mtd);
mtd              1607 drivers/mtd/nand/raw/diskonchip.c 		numchips = doc2001plus_init(mtd);
mtd              1609 drivers/mtd/nand/raw/diskonchip.c 		numchips = doc2001_init(mtd);
mtd              1611 drivers/mtd/nand/raw/diskonchip.c 	if ((ret = nand_scan(nand, numchips)) || (ret = doc->late_init(mtd))) {
mtd              1623 drivers/mtd/nand/raw/diskonchip.c 	doclist = mtd;
mtd              1644 drivers/mtd/nand/raw/diskonchip.c 	struct mtd_info *mtd, *nextmtd;
mtd              1648 drivers/mtd/nand/raw/diskonchip.c 	for (mtd = doclist; mtd; mtd = nextmtd) {
mtd              1649 drivers/mtd/nand/raw/diskonchip.c 		nand = mtd_to_nand(mtd);
mtd                69 drivers/mtd/nand/raw/fsl_elbc_nand.c static int fsl_elbc_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd                72 drivers/mtd/nand/raw/fsl_elbc_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd                87 drivers/mtd/nand/raw/fsl_elbc_nand.c static int fsl_elbc_ooblayout_free(struct mtd_info *mtd, int section,
mtd                90 drivers/mtd/nand/raw/fsl_elbc_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd                98 drivers/mtd/nand/raw/fsl_elbc_nand.c 		if (mtd->writesize > 512)
mtd               107 drivers/mtd/nand/raw/fsl_elbc_nand.c 			oobregion->length = mtd->oobsize - oobregion->offset;
mtd               152 drivers/mtd/nand/raw/fsl_elbc_nand.c static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob)
mtd               154 drivers/mtd/nand/raw/fsl_elbc_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               203 drivers/mtd/nand/raw/fsl_elbc_nand.c static int fsl_elbc_run_command(struct mtd_info *mtd)
mtd               205 drivers/mtd/nand/raw/fsl_elbc_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               252 drivers/mtd/nand/raw/fsl_elbc_nand.c 	if (elbc_fcm_ctrl->read_bytes == mtd->writesize + mtd->oobsize) {
mtd               268 drivers/mtd/nand/raw/fsl_elbc_nand.c 			mtd->ecc_stats.corrected++;
mtd               310 drivers/mtd/nand/raw/fsl_elbc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               336 drivers/mtd/nand/raw/fsl_elbc_nand.c 		set_addr(mtd, 0, page_addr, 0);
mtd               338 drivers/mtd/nand/raw/fsl_elbc_nand.c 		elbc_fcm_ctrl->read_bytes = mtd->writesize + mtd->oobsize;
mtd               342 drivers/mtd/nand/raw/fsl_elbc_nand.c 		fsl_elbc_run_command(mtd);
mtd               360 drivers/mtd/nand/raw/fsl_elbc_nand.c 		out_be32(&lbc->fbcr, mtd->oobsize - column);
mtd               361 drivers/mtd/nand/raw/fsl_elbc_nand.c 		set_addr(mtd, column, page_addr, 1);
mtd               363 drivers/mtd/nand/raw/fsl_elbc_nand.c 		elbc_fcm_ctrl->read_bytes = mtd->writesize + mtd->oobsize;
mtd               366 drivers/mtd/nand/raw/fsl_elbc_nand.c 		fsl_elbc_run_command(mtd);
mtd               385 drivers/mtd/nand/raw/fsl_elbc_nand.c 		set_addr(mtd, 0, 0, 0);
mtd               386 drivers/mtd/nand/raw/fsl_elbc_nand.c 		fsl_elbc_run_command(mtd);
mtd               394 drivers/mtd/nand/raw/fsl_elbc_nand.c 		set_addr(mtd, 0, page_addr, 0);
mtd               417 drivers/mtd/nand/raw/fsl_elbc_nand.c 		fsl_elbc_run_command(mtd);
mtd               431 drivers/mtd/nand/raw/fsl_elbc_nand.c 		if (column >= mtd->writesize) {
mtd               433 drivers/mtd/nand/raw/fsl_elbc_nand.c 			column -= mtd->writesize;
mtd               473 drivers/mtd/nand/raw/fsl_elbc_nand.c 		set_addr(mtd, column, page_addr, elbc_fcm_ctrl->oob);
mtd               488 drivers/mtd/nand/raw/fsl_elbc_nand.c 		    elbc_fcm_ctrl->index != mtd->writesize + mtd->oobsize)
mtd               494 drivers/mtd/nand/raw/fsl_elbc_nand.c 		fsl_elbc_run_command(mtd);
mtd               506 drivers/mtd/nand/raw/fsl_elbc_nand.c 		set_addr(mtd, 0, 0, 0);
mtd               509 drivers/mtd/nand/raw/fsl_elbc_nand.c 		fsl_elbc_run_command(mtd);
mtd               522 drivers/mtd/nand/raw/fsl_elbc_nand.c 		fsl_elbc_run_command(mtd);
mtd               544 drivers/mtd/nand/raw/fsl_elbc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               547 drivers/mtd/nand/raw/fsl_elbc_nand.c 	unsigned int bufsize = mtd->writesize + mtd->oobsize;
mtd               637 drivers/mtd/nand/raw/fsl_elbc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               642 drivers/mtd/nand/raw/fsl_elbc_nand.c 	nand_read_page_op(chip, page, 0, buf, mtd->writesize);
mtd               644 drivers/mtd/nand/raw/fsl_elbc_nand.c 		fsl_elbc_read_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               647 drivers/mtd/nand/raw/fsl_elbc_nand.c 		mtd->ecc_stats.failed++;
mtd               658 drivers/mtd/nand/raw/fsl_elbc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               660 drivers/mtd/nand/raw/fsl_elbc_nand.c 	nand_prog_page_begin_op(chip, page, 0, buf, mtd->writesize);
mtd               661 drivers/mtd/nand/raw/fsl_elbc_nand.c 	fsl_elbc_write_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               673 drivers/mtd/nand/raw/fsl_elbc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               676 drivers/mtd/nand/raw/fsl_elbc_nand.c 	fsl_elbc_write_buf(chip, buf, mtd->writesize);
mtd               677 drivers/mtd/nand/raw/fsl_elbc_nand.c 	fsl_elbc_write_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               687 drivers/mtd/nand/raw/fsl_elbc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               692 drivers/mtd/nand/raw/fsl_elbc_nand.c 	mtd->dev.parent = priv->dev;
mtd               725 drivers/mtd/nand/raw/fsl_elbc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               745 drivers/mtd/nand/raw/fsl_elbc_nand.c 			mtd_set_ooblayout(mtd, &fsl_elbc_ooblayout_ops);
mtd               799 drivers/mtd/nand/raw/fsl_elbc_nand.c 		mtd->ooblayout);
mtd               800 drivers/mtd/nand/raw/fsl_elbc_nand.c 	dev_dbg(priv->dev, "fsl_elbc_init: mtd->flags = %08x\n", mtd->flags);
mtd               801 drivers/mtd/nand/raw/fsl_elbc_nand.c 	dev_dbg(priv->dev, "fsl_elbc_init: mtd->size = %lld\n", mtd->size);
mtd               803 drivers/mtd/nand/raw/fsl_elbc_nand.c 	        mtd->erasesize);
mtd               805 drivers/mtd/nand/raw/fsl_elbc_nand.c 	        mtd->writesize);
mtd               807 drivers/mtd/nand/raw/fsl_elbc_nand.c 	        mtd->oobsize);
mtd               810 drivers/mtd/nand/raw/fsl_elbc_nand.c 	if (mtd->writesize == 512) {
mtd               813 drivers/mtd/nand/raw/fsl_elbc_nand.c 	} else if (mtd->writesize == 2048) {
mtd               819 drivers/mtd/nand/raw/fsl_elbc_nand.c 		        mtd->writesize);
mtd               833 drivers/mtd/nand/raw/fsl_elbc_nand.c 	struct mtd_info *mtd = nand_to_mtd(&priv->chip);
mtd               835 drivers/mtd/nand/raw/fsl_elbc_nand.c 	kfree(mtd->name);
mtd               859 drivers/mtd/nand/raw/fsl_elbc_nand.c 	struct mtd_info *mtd;
mtd               921 drivers/mtd/nand/raw/fsl_elbc_nand.c 	mtd = nand_to_mtd(&priv->chip);
mtd               922 drivers/mtd/nand/raw/fsl_elbc_nand.c 	mtd->name = kasprintf(GFP_KERNEL, "%llx.flash", (u64)res.start);
mtd               939 drivers/mtd/nand/raw/fsl_elbc_nand.c 	ret = mtd_device_parse_register(mtd, part_probe_types, NULL, NULL, 0);
mtd                84 drivers/mtd/nand/raw/fsl_ifc_nand.c static int fsl_ifc_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd                87 drivers/mtd/nand/raw/fsl_ifc_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd                98 drivers/mtd/nand/raw/fsl_ifc_nand.c static int fsl_ifc_ooblayout_free(struct mtd_info *mtd, int section,
mtd               101 drivers/mtd/nand/raw/fsl_ifc_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               106 drivers/mtd/nand/raw/fsl_ifc_nand.c 	if (mtd->writesize == 512 &&
mtd               124 drivers/mtd/nand/raw/fsl_ifc_nand.c 		oobregion->length = mtd->oobsize - oobregion->offset;
mtd               139 drivers/mtd/nand/raw/fsl_ifc_nand.c static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob)
mtd               141 drivers/mtd/nand/raw/fsl_ifc_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               154 drivers/mtd/nand/raw/fsl_ifc_nand.c 	ifc_nand_ctrl->addr = priv->vbase + buf_num * (mtd->writesize * 2);
mtd               159 drivers/mtd/nand/raw/fsl_ifc_nand.c 		ifc_nand_ctrl->index += mtd->writesize;
mtd               163 drivers/mtd/nand/raw/fsl_ifc_nand.c static int check_read_ecc(struct mtd_info *mtd, struct fsl_ifc_ctrl *ctrl,
mtd               172 drivers/mtd/nand/raw/fsl_ifc_nand.c static void fsl_ifc_run_command(struct mtd_info *mtd)
mtd               174 drivers/mtd/nand/raw/fsl_ifc_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               225 drivers/mtd/nand/raw/fsl_ifc_nand.c 			errors = check_read_ecc(mtd, ctrl, eccstat, i);
mtd               240 drivers/mtd/nand/raw/fsl_ifc_nand.c 			mtd->ecc_stats.corrected += errors;
mtd               252 drivers/mtd/nand/raw/fsl_ifc_nand.c 			    struct mtd_info *mtd)
mtd               259 drivers/mtd/nand/raw/fsl_ifc_nand.c 	if (mtd->writesize > 512) {
mtd               293 drivers/mtd/nand/raw/fsl_ifc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               307 drivers/mtd/nand/raw/fsl_ifc_nand.c 		set_addr(mtd, 0, page_addr, 0);
mtd               309 drivers/mtd/nand/raw/fsl_ifc_nand.c 		ifc_nand_ctrl->read_bytes = mtd->writesize + mtd->oobsize;
mtd               315 drivers/mtd/nand/raw/fsl_ifc_nand.c 		fsl_ifc_do_read(chip, 0, mtd);
mtd               316 drivers/mtd/nand/raw/fsl_ifc_nand.c 		fsl_ifc_run_command(mtd);
mtd               321 drivers/mtd/nand/raw/fsl_ifc_nand.c 		ifc_out32(mtd->oobsize - column, &ifc->ifc_nand.nand_fbcr);
mtd               322 drivers/mtd/nand/raw/fsl_ifc_nand.c 		set_addr(mtd, column, page_addr, 1);
mtd               324 drivers/mtd/nand/raw/fsl_ifc_nand.c 		ifc_nand_ctrl->read_bytes = mtd->writesize + mtd->oobsize;
mtd               326 drivers/mtd/nand/raw/fsl_ifc_nand.c 		fsl_ifc_do_read(chip, 1, mtd);
mtd               327 drivers/mtd/nand/raw/fsl_ifc_nand.c 		fsl_ifc_run_command(mtd);
mtd               355 drivers/mtd/nand/raw/fsl_ifc_nand.c 		set_addr(mtd, 0, 0, 0);
mtd               356 drivers/mtd/nand/raw/fsl_ifc_nand.c 		fsl_ifc_run_command(mtd);
mtd               362 drivers/mtd/nand/raw/fsl_ifc_nand.c 		set_addr(mtd, 0, page_addr, 0);
mtd               378 drivers/mtd/nand/raw/fsl_ifc_nand.c 		fsl_ifc_run_command(mtd);
mtd               387 drivers/mtd/nand/raw/fsl_ifc_nand.c 		if (mtd->writesize > 512) {
mtd               427 drivers/mtd/nand/raw/fsl_ifc_nand.c 			if (column >= mtd->writesize)
mtd               435 drivers/mtd/nand/raw/fsl_ifc_nand.c 		if (column >= mtd->writesize) {
mtd               437 drivers/mtd/nand/raw/fsl_ifc_nand.c 			column -= mtd->writesize;
mtd               441 drivers/mtd/nand/raw/fsl_ifc_nand.c 		set_addr(mtd, column, page_addr, ifc_nand_ctrl->oob);
mtd               455 drivers/mtd/nand/raw/fsl_ifc_nand.c 		fsl_ifc_run_command(mtd);
mtd               468 drivers/mtd/nand/raw/fsl_ifc_nand.c 		set_addr(mtd, 0, 0, 0);
mtd               471 drivers/mtd/nand/raw/fsl_ifc_nand.c 		fsl_ifc_run_command(mtd);
mtd               490 drivers/mtd/nand/raw/fsl_ifc_nand.c 		fsl_ifc_run_command(mtd);
mtd               511 drivers/mtd/nand/raw/fsl_ifc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               513 drivers/mtd/nand/raw/fsl_ifc_nand.c 	unsigned int bufsize = mtd->writesize + mtd->oobsize;
mtd               606 drivers/mtd/nand/raw/fsl_ifc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               620 drivers/mtd/nand/raw/fsl_ifc_nand.c 	set_addr(mtd, 0, 0, 0);
mtd               623 drivers/mtd/nand/raw/fsl_ifc_nand.c 	fsl_ifc_run_command(mtd);
mtd               640 drivers/mtd/nand/raw/fsl_ifc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               647 drivers/mtd/nand/raw/fsl_ifc_nand.c 	mtd_ooblayout_ecc(mtd, 0, &oobregion);
mtd               655 drivers/mtd/nand/raw/fsl_ifc_nand.c 			mtd->ecc_stats.failed++;
mtd               657 drivers/mtd/nand/raw/fsl_ifc_nand.c 			mtd->ecc_stats.corrected += res;
mtd               670 drivers/mtd/nand/raw/fsl_ifc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               675 drivers/mtd/nand/raw/fsl_ifc_nand.c 	nand_read_page_op(chip, page, 0, buf, mtd->writesize);
mtd               677 drivers/mtd/nand/raw/fsl_ifc_nand.c 		fsl_ifc_read_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               681 drivers/mtd/nand/raw/fsl_ifc_nand.c 			fsl_ifc_read_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               687 drivers/mtd/nand/raw/fsl_ifc_nand.c 		mtd->ecc_stats.failed++;
mtd               698 drivers/mtd/nand/raw/fsl_ifc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               700 drivers/mtd/nand/raw/fsl_ifc_nand.c 	nand_prog_page_begin_op(chip, page, 0, buf, mtd->writesize);
mtd               701 drivers/mtd/nand/raw/fsl_ifc_nand.c 	fsl_ifc_write_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               708 drivers/mtd/nand/raw/fsl_ifc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               736 drivers/mtd/nand/raw/fsl_ifc_nand.c 							mtd->ooblayout);
mtd               737 drivers/mtd/nand/raw/fsl_ifc_nand.c 	dev_dbg(priv->dev, "%s: mtd->flags = %08x\n", __func__, mtd->flags);
mtd               738 drivers/mtd/nand/raw/fsl_ifc_nand.c 	dev_dbg(priv->dev, "%s: mtd->size = %lld\n", __func__, mtd->size);
mtd               740 drivers/mtd/nand/raw/fsl_ifc_nand.c 							mtd->erasesize);
mtd               742 drivers/mtd/nand/raw/fsl_ifc_nand.c 							mtd->writesize);
mtd               744 drivers/mtd/nand/raw/fsl_ifc_nand.c 							mtd->oobsize);
mtd               836 drivers/mtd/nand/raw/fsl_ifc_nand.c 	struct mtd_info *mtd = nand_to_mtd(&priv->chip);
mtd               841 drivers/mtd/nand/raw/fsl_ifc_nand.c 	mtd->dev.parent = priv->dev;
mtd               916 drivers/mtd/nand/raw/fsl_ifc_nand.c 		mtd_set_ooblayout(mtd, &fsl_ifc_ooblayout_ops);
mtd               948 drivers/mtd/nand/raw/fsl_ifc_nand.c 	struct mtd_info *mtd = nand_to_mtd(&priv->chip);
mtd               950 drivers/mtd/nand/raw/fsl_ifc_nand.c 	kfree(mtd->name);
mtd               985 drivers/mtd/nand/raw/fsl_ifc_nand.c 	struct mtd_info *mtd;
mtd              1058 drivers/mtd/nand/raw/fsl_ifc_nand.c 	mtd = nand_to_mtd(&priv->chip);
mtd              1059 drivers/mtd/nand/raw/fsl_ifc_nand.c 	mtd->name = kasprintf(GFP_KERNEL, "%llx.flash", (u64)res.start);
mtd              1060 drivers/mtd/nand/raw/fsl_ifc_nand.c 	if (!mtd->name) {
mtd              1076 drivers/mtd/nand/raw/fsl_ifc_nand.c 	ret = mtd_device_parse_register(mtd, part_probe_types, NULL, NULL, 0);
mtd                65 drivers/mtd/nand/raw/fsl_upm.c 		struct mtd_info *mtd = nand_to_mtd(&fun->chip);
mtd               155 drivers/mtd/nand/raw/fsl_upm.c 	struct mtd_info *mtd = nand_to_mtd(&fun->chip);
mtd               174 drivers/mtd/nand/raw/fsl_upm.c 	mtd->dev.parent = fun->dev;
mtd               181 drivers/mtd/nand/raw/fsl_upm.c 	mtd->name = kasprintf(GFP_KERNEL, "0x%llx.%pOFn", (u64)io_res->start,
mtd               183 drivers/mtd/nand/raw/fsl_upm.c 	if (!mtd->name) {
mtd               192 drivers/mtd/nand/raw/fsl_upm.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd               196 drivers/mtd/nand/raw/fsl_upm.c 		kfree(mtd->name);
mtd               320 drivers/mtd/nand/raw/fsl_upm.c 	struct mtd_info *mtd = nand_to_mtd(&fun->chip);
mtd               324 drivers/mtd/nand/raw/fsl_upm.c 	kfree(mtd->name);
mtd               158 drivers/mtd/nand/raw/fsmc_nand.c static int fsmc_ecc1_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               161 drivers/mtd/nand/raw/fsmc_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               172 drivers/mtd/nand/raw/fsmc_nand.c static int fsmc_ecc1_ooblayout_free(struct mtd_info *mtd, int section,
mtd               175 drivers/mtd/nand/raw/fsmc_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               185 drivers/mtd/nand/raw/fsmc_nand.c 		oobregion->length = mtd->oobsize - oobregion->offset;
mtd               201 drivers/mtd/nand/raw/fsmc_nand.c static int fsmc_ecc4_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               204 drivers/mtd/nand/raw/fsmc_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               211 drivers/mtd/nand/raw/fsmc_nand.c 	if (!section && mtd->writesize <= 512)
mtd               219 drivers/mtd/nand/raw/fsmc_nand.c static int fsmc_ecc4_ooblayout_free(struct mtd_info *mtd, int section,
mtd               222 drivers/mtd/nand/raw/fsmc_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               232 drivers/mtd/nand/raw/fsmc_nand.c 		oobregion->length = mtd->oobsize - oobregion->offset;
mtd               674 drivers/mtd/nand/raw/fsmc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               701 drivers/mtd/nand/raw/fsmc_nand.c 			ret = mtd_ooblayout_ecc(mtd, group++, &oobregion);
mtd               725 drivers/mtd/nand/raw/fsmc_nand.c 			mtd->ecc_stats.failed++;
mtd               727 drivers/mtd/nand/raw/fsmc_nand.c 			mtd->ecc_stats.corrected += stat;
mtd               876 drivers/mtd/nand/raw/fsmc_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               880 drivers/mtd/nand/raw/fsmc_nand.c 		switch (mtd->oobsize) {
mtd               890 drivers/mtd/nand/raw/fsmc_nand.c 				 mtd->oobsize);
mtd               894 drivers/mtd/nand/raw/fsmc_nand.c 		mtd_set_ooblayout(mtd, &fsmc_ecc4_ooblayout_ops);
mtd               929 drivers/mtd/nand/raw/fsmc_nand.c 		switch (mtd->oobsize) {
mtd               933 drivers/mtd/nand/raw/fsmc_nand.c 			mtd_set_ooblayout(mtd,
mtd               939 drivers/mtd/nand/raw/fsmc_nand.c 				 mtd->oobsize);
mtd               973 drivers/mtd/nand/raw/fsmc_nand.c 	struct mtd_info *mtd;
mtd              1049 drivers/mtd/nand/raw/fsmc_nand.c 	mtd = nand_to_mtd(&host->nand);
mtd              1052 drivers/mtd/nand/raw/fsmc_nand.c 	mtd->dev.parent = &pdev->dev;
mtd              1102 drivers/mtd/nand/raw/fsmc_nand.c 	mtd->name = "nand";
mtd              1103 drivers/mtd/nand/raw/fsmc_nand.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd                40 drivers/mtd/nand/raw/gpio.c static inline struct gpiomtd *gpio_nand_getpriv(struct mtd_info *mtd)
mtd                42 drivers/mtd/nand/raw/gpio.c 	return container_of(mtd_to_nand(mtd), struct gpiomtd, nand_chip);
mtd               209 drivers/mtd/nand/raw/gpio.c 	struct mtd_info *mtd;
mtd               280 drivers/mtd/nand/raw/gpio.c 	mtd			= nand_to_mtd(chip);
mtd               281 drivers/mtd/nand/raw/gpio.c 	mtd->dev.parent		= dev;
mtd               294 drivers/mtd/nand/raw/gpio.c 		gpiomtd->plat.adjust_parts(&gpiomtd->plat, mtd->size);
mtd               296 drivers/mtd/nand/raw/gpio.c 	ret = mtd_device_register(mtd, gpiomtd->plat.parts,
mtd               262 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               285 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	if (geo->ecc_chunk_size < mtd->oobsize) {
mtd               288 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 			ecc_step, mtd->oobsize);
mtd               295 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	geo->ecc_chunk_count = mtd->writesize / geo->ecc_chunk_size;
mtd               345 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	geo->page_size = mtd->writesize + geo->metadata_size +
mtd               348 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	geo->payload_size = mtd->writesize;
mtd               358 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	block_mark_bit_offset = mtd->writesize * 8 -
mtd               388 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info	*mtd = nand_to_mtd(&this->nand);
mtd               391 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	ecc_strength = ((mtd->oobsize - geo->metadata_size) * 8)
mtd               401 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info *mtd = nand_to_mtd(&this->nand);
mtd               418 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	while (geo->ecc_chunk_size < mtd->oobsize) {
mtd               423 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	geo->ecc_chunk_count = mtd->writesize / geo->ecc_chunk_size;
mtd               436 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	geo->page_size = mtd->writesize + geo->metadata_size +
mtd               438 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	geo->payload_size = mtd->writesize;
mtd               501 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	block_mark_bit_offset = mtd->writesize * 8 -
mtd              1002 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c static int gpmi_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd              1005 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              1013 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	oobregion->length = geo->page_size - mtd->writesize;
mtd              1018 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c static int gpmi_ooblayout_free(struct mtd_info *mtd, int section,
mtd              1021 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              1029 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	if (geo->page_size < mtd->writesize + mtd->oobsize) {
mtd              1030 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 		oobregion->offset = geo->page_size - mtd->writesize;
mtd              1031 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 		oobregion->length = mtd->oobsize - oobregion->offset;
mtd              1256 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info *mtd = nand_to_mtd(&this->nand);
mtd              1266 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	this->data_buffer_dma = kzalloc(mtd->writesize ?: PAGE_SIZE,
mtd              1276 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	this->raw_buffer = kzalloc((mtd->writesize ?: PAGE_SIZE) + mtd->oobsize, GFP_KERNEL);
mtd              1340 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1416 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 				mtd->ecc_stats.corrected += flips;
mtd              1420 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 			mtd->ecc_stats.failed++;
mtd              1424 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 		mtd->ecc_stats.corrected += *status;
mtd              1456 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1486 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 		memset(chip->oob_poi, ~0, mtd->oobsize);
mtd              1573 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1590 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 		memcpy(this->data_buffer_dma, buf, mtd->writesize);
mtd              1663 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1668 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	memset(chip->oob_poi, ~0, mtd->oobsize);
mtd              1671 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	ret = nand_read_page_op(chip, page, mtd->writesize, chip->oob_poi,
mtd              1672 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 				mtd->oobsize);
mtd              1693 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1697 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	mtd_ooblayout_free(mtd, 0, &of);
mtd              1704 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	return nand_prog_page_op(chip, page, mtd->writesize + of.offset,
mtd              1723 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1737 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 				mtd->writesize + mtd->oobsize);
mtd              1749 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 		swap(tmp_buf[0], tmp_buf[mtd->writesize]);
mtd              1786 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 		if (oob_byte_off < mtd->oobsize)
mtd              1788 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 			       tmp_buf + mtd->writesize + oob_byte_off,
mtd              1789 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 			       mtd->oobsize - oob_byte_off);
mtd              1810 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1828 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 		memset(tmp_buf, 0xff, mtd->writesize + mtd->oobsize);
mtd              1860 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	if (oob_required && oob_byte_off < mtd->oobsize)
mtd              1861 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 		memcpy(tmp_buf + mtd->writesize + oob_byte_off,
mtd              1862 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 		       oob + oob_byte_off, mtd->oobsize - oob_byte_off);
mtd              1872 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 		swap(tmp_buf[0], tmp_buf[mtd->writesize]);
mtd              1875 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 				 mtd->writesize + mtd->oobsize);
mtd              1890 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1899 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	column = !GPMI_IS_MX23(this) ? mtd->writesize : 0;
mtd              2002 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2014 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	block_size_in_pages = mtd->erasesize / mtd->writesize;
mtd              2041 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	memset(buffer, ~0, mtd->writesize);
mtd              2067 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2109 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 		ret = nand_read_page_op(chip, page, mtd->writesize, &block_mark,
mtd              2167 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2189 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	mtd_set_ooblayout(mtd, &gpmi_ooblayout_ops);
mtd              2558 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	struct mtd_info  *mtd = nand_to_mtd(chip);
mtd              2562 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	mtd->name		= "gpmi-nand";
mtd              2563 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	mtd->dev.parent		= this->dev;
mtd              2600 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd               182 drivers/mtd/nand/raw/hisi504_nand.c 	struct mtd_info	*mtd = nand_to_mtd(chip);
mtd               190 drivers/mtd/nand/raw/hisi504_nand.c 		hinfc_write(host, ((mtd->oobsize & HINFC504_DMA_LEN_OOB_MASK)
mtd               254 drivers/mtd/nand/raw/hisi504_nand.c 	struct mtd_info	*mtd = nand_to_mtd(&host->chip);
mtd               268 drivers/mtd/nand/raw/hisi504_nand.c 	hinfc_write(host, mtd->writesize + mtd->oobsize,
mtd               389 drivers/mtd/nand/raw/hisi504_nand.c static void set_addr(struct mtd_info *mtd, int column, int page_addr)
mtd               391 drivers/mtd/nand/raw/hisi504_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               426 drivers/mtd/nand/raw/hisi504_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               439 drivers/mtd/nand/raw/hisi504_nand.c 			host->offset = column + mtd->writesize;
mtd               442 drivers/mtd/nand/raw/hisi504_nand.c 		set_addr(mtd, column, page_addr);
mtd               448 drivers/mtd/nand/raw/hisi504_nand.c 		set_addr(mtd, column, page_addr);
mtd               452 drivers/mtd/nand/raw/hisi504_nand.c 		set_addr(mtd, column, page_addr);
mtd               521 drivers/mtd/nand/raw/hisi504_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               526 drivers/mtd/nand/raw/hisi504_nand.c 	nand_read_page_op(chip, page, 0, buf, mtd->writesize);
mtd               527 drivers/mtd/nand/raw/hisi504_nand.c 	chip->legacy.read_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               531 drivers/mtd/nand/raw/hisi504_nand.c 		mtd->ecc_stats.failed++;
mtd               543 drivers/mtd/nand/raw/hisi504_nand.c 		mtd->ecc_stats.corrected += stat;
mtd               553 drivers/mtd/nand/raw/hisi504_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               556 drivers/mtd/nand/raw/hisi504_nand.c 	nand_read_oob_op(chip, page, 0, chip->oob_poi, mtd->oobsize);
mtd               571 drivers/mtd/nand/raw/hisi504_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               573 drivers/mtd/nand/raw/hisi504_nand.c 	nand_prog_page_begin_op(chip, page, 0, buf, mtd->writesize);
mtd               575 drivers/mtd/nand/raw/hisi504_nand.c 		chip->legacy.write_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               612 drivers/mtd/nand/raw/hisi504_nand.c static int hisi_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               619 drivers/mtd/nand/raw/hisi504_nand.c static int hisi_ooblayout_free(struct mtd_info *mtd, int section,
mtd               642 drivers/mtd/nand/raw/hisi504_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               667 drivers/mtd/nand/raw/hisi504_nand.c 		if (mtd->writesize == 2048)
mtd               668 drivers/mtd/nand/raw/hisi504_nand.c 			mtd_set_ooblayout(mtd, &hisi_ooblayout_ops);
mtd               695 drivers/mtd/nand/raw/hisi504_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               700 drivers/mtd/nand/raw/hisi504_nand.c 					   mtd->writesize + mtd->oobsize,
mtd               705 drivers/mtd/nand/raw/hisi504_nand.c 	host->dma_oob = host->dma_buffer + mtd->writesize;
mtd               706 drivers/mtd/nand/raw/hisi504_nand.c 	memset(host->buffer, 0xff, mtd->writesize + mtd->oobsize);
mtd               710 drivers/mtd/nand/raw/hisi504_nand.c 	switch (mtd->writesize) {
mtd               740 drivers/mtd/nand/raw/hisi504_nand.c 	struct mtd_info   *mtd;
mtd               751 drivers/mtd/nand/raw/hisi504_nand.c 	mtd  = nand_to_mtd(chip);
mtd               771 drivers/mtd/nand/raw/hisi504_nand.c 	mtd->name		= "hisi_nand";
mtd               772 drivers/mtd/nand/raw/hisi504_nand.c 	mtd->dev.parent         = &pdev->dev;
mtd               798 drivers/mtd/nand/raw/hisi504_nand.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd                65 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c static inline struct ingenic_nand *to_ingenic_nand(struct mtd_info *mtd)
mtd                67 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	return container_of(mtd_to_nand(mtd), struct ingenic_nand, chip);
mtd                75 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c static int qi_lb60_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd                78 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd                90 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c static int qi_lb60_ooblayout_free(struct mtd_info *mtd, int section,
mtd                93 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd                99 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	oobregion->length = mtd->oobsize - ecc->total - 12;
mtd               110 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c static int jz4725b_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               113 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               125 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c static int jz4725b_ooblayout_free(struct mtd_info *mtd, int section,
mtd               128 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               134 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	oobregion->length = mtd->oobsize - ecc->total - 3;
mtd               234 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               276 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	eccbytes = mtd->writesize / chip->ecc.size * chip->ecc.bytes;
mtd               278 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	if (eccbytes > mtd->oobsize - 2) {
mtd               281 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 			eccbytes, mtd->oobsize - 2);
mtd               294 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 		mtd_set_ooblayout(mtd, &qi_lb60_ooblayout_ops);
mtd               296 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 		mtd_set_ooblayout(mtd, nfc->soc_info->oob_layout);
mtd               314 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	struct mtd_info *mtd;
mtd               355 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	mtd = nand_to_mtd(chip);
mtd               356 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	mtd->name = devm_kasprintf(dev, GFP_KERNEL, "%s.%d", dev_name(dev),
mtd               358 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	if (!mtd->name)
mtd               360 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	mtd->dev.parent = dev;
mtd               377 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd               131 drivers/mtd/nand/raw/lpc32xx_mlc.c static int lpc32xx_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               134 drivers/mtd/nand/raw/lpc32xx_mlc.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd               145 drivers/mtd/nand/raw/lpc32xx_mlc.c static int lpc32xx_ooblayout_free(struct mtd_info *mtd, int section,
mtd               148 drivers/mtd/nand/raw/lpc32xx_mlc.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd               323 drivers/mtd/nand/raw/lpc32xx_mlc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               333 drivers/mtd/nand/raw/lpc32xx_mlc.c 		dev_dbg(&mtd->dev, "Warning: NAND not ready.\n");
mtd               343 drivers/mtd/nand/raw/lpc32xx_mlc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               353 drivers/mtd/nand/raw/lpc32xx_mlc.c 		dev_dbg(&mtd->dev, "Warning: Controller not ready.\n");
mtd               392 drivers/mtd/nand/raw/lpc32xx_mlc.c static int lpc32xx_xmit_dma(struct mtd_info *mtd, void *mem, int len,
mtd               395 drivers/mtd/nand/raw/lpc32xx_mlc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               406 drivers/mtd/nand/raw/lpc32xx_mlc.c 		dev_err(mtd->dev.parent, "Failed to map sg list\n");
mtd               412 drivers/mtd/nand/raw/lpc32xx_mlc.c 		dev_err(mtd->dev.parent, "Failed to prepare slave sg\n");
mtd               437 drivers/mtd/nand/raw/lpc32xx_mlc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               468 drivers/mtd/nand/raw/lpc32xx_mlc.c 			mtd->ecc_stats.failed++;
mtd               469 drivers/mtd/nand/raw/lpc32xx_mlc.c 			dev_warn(&mtd->dev, "%s: DECODER_FAILURE\n", __func__);
mtd               471 drivers/mtd/nand/raw/lpc32xx_mlc.c 			mtd->ecc_stats.corrected += ((mlc_isr >> 4) & 0x3) + 1;
mtd               476 drivers/mtd/nand/raw/lpc32xx_mlc.c 			res = lpc32xx_xmit_dma(mtd, dma_buf + i * 512, 512,
mtd               495 drivers/mtd/nand/raw/lpc32xx_mlc.c 		memcpy(buf, dma_buf, mtd->writesize);
mtd               504 drivers/mtd/nand/raw/lpc32xx_mlc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               513 drivers/mtd/nand/raw/lpc32xx_mlc.c 		memcpy(dma_buf, buf, mtd->writesize);
mtd               524 drivers/mtd/nand/raw/lpc32xx_mlc.c 			res = lpc32xx_xmit_dma(mtd, dma_buf + i * 512, 512,
mtd               574 drivers/mtd/nand/raw/lpc32xx_mlc.c 	struct mtd_info *mtd = nand_to_mtd(&host->nand_chip);
mtd               578 drivers/mtd/nand/raw/lpc32xx_mlc.c 		dev_err(mtd->dev.parent, "no DMA platform data\n");
mtd               587 drivers/mtd/nand/raw/lpc32xx_mlc.c 		dev_err(mtd->dev.parent, "Failed to request DMA channel\n");
mtd               606 drivers/mtd/nand/raw/lpc32xx_mlc.c 		dev_err(mtd->dev.parent, "Failed to setup DMA slave\n");
mtd               647 drivers/mtd/nand/raw/lpc32xx_mlc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               651 drivers/mtd/nand/raw/lpc32xx_mlc.c 	host->dma_buf = devm_kzalloc(dev, mtd->writesize, GFP_KERNEL);
mtd               655 drivers/mtd/nand/raw/lpc32xx_mlc.c 	host->dummy_buf = devm_kzalloc(dev, mtd->writesize, GFP_KERNEL);
mtd               661 drivers/mtd/nand/raw/lpc32xx_mlc.c 	mtd_set_ooblayout(mtd, &lpc32xx_ooblayout_ops);
mtd               662 drivers/mtd/nand/raw/lpc32xx_mlc.c 	host->mlcsubpages = mtd->writesize / 512;
mtd               677 drivers/mtd/nand/raw/lpc32xx_mlc.c 	struct mtd_info *mtd;
mtd               697 drivers/mtd/nand/raw/lpc32xx_mlc.c 	mtd = nand_to_mtd(nand_chip);
mtd               719 drivers/mtd/nand/raw/lpc32xx_mlc.c 	mtd->dev.parent = &pdev->dev;
mtd               797 drivers/mtd/nand/raw/lpc32xx_mlc.c 	mtd->name = DRV_NAME;
mtd               799 drivers/mtd/nand/raw/lpc32xx_mlc.c 	res = mtd_device_register(mtd, host->ncfg->parts,
mtd               139 drivers/mtd/nand/raw/lpc32xx_slc.c static int lpc32xx_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               151 drivers/mtd/nand/raw/lpc32xx_slc.c static int lpc32xx_ooblayout_free(struct mtd_info *mtd, int section,
mtd               388 drivers/mtd/nand/raw/lpc32xx_slc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               390 drivers/mtd/nand/raw/lpc32xx_slc.c 	return nand_read_oob_op(chip, page, 0, chip->oob_poi, mtd->oobsize);
mtd               398 drivers/mtd/nand/raw/lpc32xx_slc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               400 drivers/mtd/nand/raw/lpc32xx_slc.c 	return nand_prog_page_op(chip, page, mtd->writesize, chip->oob_poi,
mtd               401 drivers/mtd/nand/raw/lpc32xx_slc.c 				 mtd->oobsize);
mtd               427 drivers/mtd/nand/raw/lpc32xx_slc.c static int lpc32xx_xmit_dma(struct mtd_info *mtd, dma_addr_t dma,
mtd               430 drivers/mtd/nand/raw/lpc32xx_slc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               446 drivers/mtd/nand/raw/lpc32xx_slc.c 		dev_err(mtd->dev.parent, "Failed to setup DMA slave\n");
mtd               455 drivers/mtd/nand/raw/lpc32xx_slc.c 		dev_err(mtd->dev.parent, "Failed to map sg list\n");
mtd               461 drivers/mtd/nand/raw/lpc32xx_slc.c 		dev_err(mtd->dev.parent, "Failed to prepare slave sg\n");
mtd               487 drivers/mtd/nand/raw/lpc32xx_slc.c static int lpc32xx_xfer(struct mtd_info *mtd, uint8_t *buf, int eccsubpages,
mtd               490 drivers/mtd/nand/raw/lpc32xx_slc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               507 drivers/mtd/nand/raw/lpc32xx_slc.c 			memcpy(host->data_buf, buf, mtd->writesize);
mtd               525 drivers/mtd/nand/raw/lpc32xx_slc.c 	writel(mtd->writesize, SLC_TC(host->io_base));
mtd               533 drivers/mtd/nand/raw/lpc32xx_slc.c 		res = lpc32xx_xmit_dma(mtd, SLC_DMA_DATA(host->io_base_dma),
mtd               535 drivers/mtd/nand/raw/lpc32xx_slc.c 				       mtd->writesize / chip->ecc.steps, dir);
mtd               544 drivers/mtd/nand/raw/lpc32xx_slc.c 		res = lpc32xx_xmit_dma(mtd, SLC_ECC(host->io_base_dma),
mtd               558 drivers/mtd/nand/raw/lpc32xx_slc.c 		dev_warn(mtd->dev.parent, "FIFO not empty!\n");
mtd               564 drivers/mtd/nand/raw/lpc32xx_slc.c 			dev_err(mtd->dev.parent, "FIFO held data too long\n");
mtd               581 drivers/mtd/nand/raw/lpc32xx_slc.c 		dev_err(mtd->dev.parent, "DMA FIFO failure\n");
mtd               593 drivers/mtd/nand/raw/lpc32xx_slc.c 		memcpy(buf, host->data_buf, mtd->writesize);
mtd               605 drivers/mtd/nand/raw/lpc32xx_slc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               615 drivers/mtd/nand/raw/lpc32xx_slc.c 	status = lpc32xx_xfer(mtd, buf, chip->ecc.steps, 1);
mtd               618 drivers/mtd/nand/raw/lpc32xx_slc.c 	chip->legacy.read_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               624 drivers/mtd/nand/raw/lpc32xx_slc.c 	error = mtd_ooblayout_ecc(mtd, 0, &oobregion);
mtd               634 drivers/mtd/nand/raw/lpc32xx_slc.c 			mtd->ecc_stats.failed++;
mtd               636 drivers/mtd/nand/raw/lpc32xx_slc.c 			mtd->ecc_stats.corrected += stat;
mtd               653 drivers/mtd/nand/raw/lpc32xx_slc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               660 drivers/mtd/nand/raw/lpc32xx_slc.c 	chip->legacy.read_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               673 drivers/mtd/nand/raw/lpc32xx_slc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               682 drivers/mtd/nand/raw/lpc32xx_slc.c 	error = lpc32xx_xfer(mtd, (uint8_t *)buf, chip->ecc.steps, 0);
mtd               690 drivers/mtd/nand/raw/lpc32xx_slc.c 	error = mtd_ooblayout_ecc(mtd, 0, &oobregion);
mtd               698 drivers/mtd/nand/raw/lpc32xx_slc.c 	chip->legacy.write_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               711 drivers/mtd/nand/raw/lpc32xx_slc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               716 drivers/mtd/nand/raw/lpc32xx_slc.c 	chip->legacy.write_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               723 drivers/mtd/nand/raw/lpc32xx_slc.c 	struct mtd_info *mtd = nand_to_mtd(&host->nand_chip);
mtd               727 drivers/mtd/nand/raw/lpc32xx_slc.c 		dev_err(mtd->dev.parent, "no DMA platform data\n");
mtd               736 drivers/mtd/nand/raw/lpc32xx_slc.c 		dev_err(mtd->dev.parent, "Failed to request DMA channel\n");
mtd               775 drivers/mtd/nand/raw/lpc32xx_slc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               786 drivers/mtd/nand/raw/lpc32xx_slc.c 	if (mtd->writesize <= 512)
mtd               787 drivers/mtd/nand/raw/lpc32xx_slc.c 		mtd_set_ooblayout(mtd, &lpc32xx_ooblayout_ops);
mtd               801 drivers/mtd/nand/raw/lpc32xx_slc.c 	    mtd->writesize <= 512) {
mtd               819 drivers/mtd/nand/raw/lpc32xx_slc.c 	struct mtd_info *mtd;
mtd               854 drivers/mtd/nand/raw/lpc32xx_slc.c 	mtd = nand_to_mtd(chip);
mtd               857 drivers/mtd/nand/raw/lpc32xx_slc.c 	mtd->owner = THIS_MODULE;
mtd               858 drivers/mtd/nand/raw/lpc32xx_slc.c 	mtd->dev.parent = &pdev->dev;
mtd               923 drivers/mtd/nand/raw/lpc32xx_slc.c 	mtd->name = "nxp_lpc3220_slc";
mtd               924 drivers/mtd/nand/raw/lpc32xx_slc.c 	res = mtd_device_register(mtd, host->ncfg->parts,
mtd               907 drivers/mtd/nand/raw/marvell_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               925 drivers/mtd/nand/raw/marvell_nand.c 		mtd->ecc_stats.failed++;
mtd               930 drivers/mtd/nand/raw/marvell_nand.c 	mtd->ecc_stats.corrected += bf;
mtd               944 drivers/mtd/nand/raw/marvell_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               976 drivers/mtd/nand/raw/marvell_nand.c 	mtd->ecc_stats.corrected += bf;
mtd              1180 drivers/mtd/nand/raw/marvell_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1183 drivers/mtd/nand/raw/marvell_nand.c 	memset(buf, 0xFF, mtd->writesize);
mtd              1194 drivers/mtd/nand/raw/marvell_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1208 drivers/mtd/nand/raw/marvell_nand.c 		memset(chip->oob_poi, 0xFF, mtd->oobsize);
mtd              1309 drivers/mtd/nand/raw/marvell_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1325 drivers/mtd/nand/raw/marvell_nand.c 		memset(chip->oob_poi, 0xFF, mtd->oobsize);
mtd              1566 drivers/mtd/nand/raw/marvell_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1578 drivers/mtd/nand/raw/marvell_nand.c 		memset(chip->oob_poi, 0xFF, mtd->oobsize);
mtd              1616 drivers/mtd/nand/raw/marvell_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1619 drivers/mtd/nand/raw/marvell_nand.c 	memset(buf, 0xFF, mtd->writesize);
mtd              1626 drivers/mtd/nand/raw/marvell_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1629 drivers/mtd/nand/raw/marvell_nand.c 	memset(buf, 0xFF, mtd->writesize);
mtd              2124 drivers/mtd/nand/raw/marvell_nand.c static int marvell_nand_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd              2127 drivers/mtd/nand/raw/marvell_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              2135 drivers/mtd/nand/raw/marvell_nand.c 	oobregion->offset = mtd->oobsize - oobregion->length;
mtd              2140 drivers/mtd/nand/raw/marvell_nand.c static int marvell_nand_ooblayout_free(struct mtd_info *mtd, int section,
mtd              2143 drivers/mtd/nand/raw/marvell_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              2153 drivers/mtd/nand/raw/marvell_nand.c 	if (mtd->writesize == SZ_4K && lt->data_bytes == SZ_2K)
mtd              2169 drivers/mtd/nand/raw/marvell_nand.c static int marvell_nand_hw_ecc_ctrl_init(struct mtd_info *mtd,
mtd              2172 drivers/mtd/nand/raw/marvell_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              2178 drivers/mtd/nand/raw/marvell_nand.c 	    (mtd->writesize + mtd->oobsize > MAX_CHUNK_SIZE)) {
mtd              2181 drivers/mtd/nand/raw/marvell_nand.c 			mtd->writesize, MAX_CHUNK_SIZE - mtd->oobsize);
mtd              2188 drivers/mtd/nand/raw/marvell_nand.c 		if (mtd->writesize == l->writesize &&
mtd              2199 drivers/mtd/nand/raw/marvell_nand.c 			ecc->strength, mtd->writesize);
mtd              2205 drivers/mtd/nand/raw/marvell_nand.c 		if (mtd->oobsize < 128) {
mtd              2213 drivers/mtd/nand/raw/marvell_nand.c 	mtd_set_ooblayout(mtd, &marvell_nand_ooblayout_ops);
mtd              2243 drivers/mtd/nand/raw/marvell_nand.c static int marvell_nand_ecc_init(struct mtd_info *mtd,
mtd              2246 drivers/mtd/nand/raw/marvell_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              2264 drivers/mtd/nand/raw/marvell_nand.c 		ret = marvell_nand_hw_ecc_ctrl_init(mtd, ecc);
mtd              2271 drivers/mtd/nand/raw/marvell_nand.c 		if (!nfc->caps->is_nfcv2 && mtd->writesize != SZ_512 &&
mtd              2272 drivers/mtd/nand/raw/marvell_nand.c 		    mtd->writesize != SZ_2K) {
mtd              2274 drivers/mtd/nand/raw/marvell_nand.c 				mtd->writesize);
mtd              2409 drivers/mtd/nand/raw/marvell_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2429 drivers/mtd/nand/raw/marvell_nand.c 	marvell_nand->ndcr = NDCR_PAGE_SZ(mtd->writesize);
mtd              2437 drivers/mtd/nand/raw/marvell_nand.c 	if (mtd->writesize <= 512) {
mtd              2462 drivers/mtd/nand/raw/marvell_nand.c 	ret = marvell_nand_ecc_init(mtd, &chip->ecc);
mtd              2484 drivers/mtd/nand/raw/marvell_nand.c 		mtd->name = "pxa3xx_nand-0";
mtd              2485 drivers/mtd/nand/raw/marvell_nand.c 	} else if (!mtd->name) {
mtd              2496 drivers/mtd/nand/raw/marvell_nand.c 		mtd->name = devm_kasprintf(nfc->dev, GFP_KERNEL,
mtd              2499 drivers/mtd/nand/raw/marvell_nand.c 		if (!mtd->name) {
mtd              2519 drivers/mtd/nand/raw/marvell_nand.c 	struct mtd_info *mtd;
mtd              2636 drivers/mtd/nand/raw/marvell_nand.c 	mtd = nand_to_mtd(chip);
mtd              2637 drivers/mtd/nand/raw/marvell_nand.c 	mtd->dev.parent = dev;
mtd              2662 drivers/mtd/nand/raw/marvell_nand.c 		ret = mtd_device_register(mtd, pdata->parts, pdata->nr_parts);
mtd              2664 drivers/mtd/nand/raw/marvell_nand.c 		ret = mtd_device_register(mtd, NULL, 0);
mtd               268 drivers/mtd/nand/raw/meson_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               269 drivers/mtd/nand/raw/meson_nand.c 	struct meson_nfc *nfc = nand_get_controller_data(mtd_to_nand(mtd));
mtd               272 drivers/mtd/nand/raw/meson_nand.c 	int len = mtd->writesize, pagesize, pages;
mtd               277 drivers/mtd/nand/raw/meson_nand.c 		len = mtd->writesize + mtd->oobsize;
mtd               447 drivers/mtd/nand/raw/meson_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               455 drivers/mtd/nand/raw/meson_nand.c 			mtd->ecc_stats.corrected += ECC_ERR_CNT(*info);
mtd               462 drivers/mtd/nand/raw/meson_nand.c 			mtd->ecc_stats.corrected += ECC_ZERO_CNT(*info);
mtd               576 drivers/mtd/nand/raw/meson_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               591 drivers/mtd/nand/raw/meson_nand.c 	if (mtd->writesize <= 512) {
mtd               629 drivers/mtd/nand/raw/meson_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               640 drivers/mtd/nand/raw/meson_nand.c 	data_len =  mtd->writesize + mtd->oobsize;
mtd               684 drivers/mtd/nand/raw/meson_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               688 drivers/mtd/nand/raw/meson_nand.c 	memcpy(meson_chip->data_buf, buf, mtd->writesize);
mtd               716 drivers/mtd/nand/raw/meson_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               724 drivers/mtd/nand/raw/meson_nand.c 	data_len =  mtd->writesize + mtd->oobsize;
mtd               772 drivers/mtd/nand/raw/meson_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               788 drivers/mtd/nand/raw/meson_nand.c 			memset(buf, 0xff, mtd->writesize);
mtd               789 drivers/mtd/nand/raw/meson_nand.c 		memset(oob_buf, 0xff, mtd->oobsize);
mtd               792 drivers/mtd/nand/raw/meson_nand.c 			mtd->ecc_stats.failed++;
mtd               810 drivers/mtd/nand/raw/meson_nand.c 				mtd->ecc_stats.failed++;
mtd               812 drivers/mtd/nand/raw/meson_nand.c 				mtd->ecc_stats.corrected += ret;
mtd               817 drivers/mtd/nand/raw/meson_nand.c 		memcpy(buf, meson_chip->data_buf, mtd->writesize);
mtd               952 drivers/mtd/nand/raw/meson_nand.c static int meson_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               955 drivers/mtd/nand/raw/meson_nand.c 	struct nand_chip *nand = mtd_to_nand(mtd);
mtd               966 drivers/mtd/nand/raw/meson_nand.c static int meson_ooblayout_free(struct mtd_info *mtd, int section,
mtd               969 drivers/mtd/nand/raw/meson_nand.c 	struct nand_chip *nand = mtd_to_nand(mtd);
mtd              1074 drivers/mtd/nand/raw/meson_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd              1078 drivers/mtd/nand/raw/meson_nand.c 	nsectors = mtd->writesize / nand->ecc.size;
mtd              1080 drivers/mtd/nand/raw/meson_nand.c 	page_bytes =  mtd->writesize + mtd->oobsize;
mtd              1166 drivers/mtd/nand/raw/meson_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd              1167 drivers/mtd/nand/raw/meson_nand.c 	int nsectors = mtd->writesize / 1024;
mtd              1170 drivers/mtd/nand/raw/meson_nand.c 	if (!mtd->name) {
mtd              1171 drivers/mtd/nand/raw/meson_nand.c 		mtd->name = devm_kasprintf(nfc->dev, GFP_KERNEL,
mtd              1175 drivers/mtd/nand/raw/meson_nand.c 		if (!mtd->name)
mtd              1185 drivers/mtd/nand/raw/meson_nand.c 				   mtd->oobsize - 2 * nsectors);
mtd              1191 drivers/mtd/nand/raw/meson_nand.c 	mtd_set_ooblayout(mtd, &meson_ooblayout_ops);
mtd              1232 drivers/mtd/nand/raw/meson_nand.c 	struct mtd_info *mtd;
mtd              1270 drivers/mtd/nand/raw/meson_nand.c 	mtd = nand_to_mtd(nand);
mtd              1271 drivers/mtd/nand/raw/meson_nand.c 	mtd->owner = THIS_MODULE;
mtd              1272 drivers/mtd/nand/raw/meson_nand.c 	mtd->dev.parent = dev;
mtd              1278 drivers/mtd/nand/raw/meson_nand.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd              1293 drivers/mtd/nand/raw/meson_nand.c 	struct mtd_info *mtd;
mtd              1299 drivers/mtd/nand/raw/meson_nand.c 		mtd = nand_to_mtd(&meson_chip->nand);
mtd              1300 drivers/mtd/nand/raw/meson_nand.c 		ret = mtd_device_unregister(mtd);
mtd               118 drivers/mtd/nand/raw/mpc5121_nfc.c static void mpc5121_nfc_done(struct mtd_info *mtd);
mtd               121 drivers/mtd/nand/raw/mpc5121_nfc.c static inline u16 nfc_read(struct mtd_info *mtd, uint reg)
mtd               123 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               130 drivers/mtd/nand/raw/mpc5121_nfc.c static inline void nfc_write(struct mtd_info *mtd, uint reg, u16 val)
mtd               132 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               139 drivers/mtd/nand/raw/mpc5121_nfc.c static inline void nfc_set(struct mtd_info *mtd, uint reg, u16 bits)
mtd               141 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, reg, nfc_read(mtd, reg) | bits);
mtd               145 drivers/mtd/nand/raw/mpc5121_nfc.c static inline void nfc_clear(struct mtd_info *mtd, uint reg, u16 bits)
mtd               147 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, reg, nfc_read(mtd, reg) & ~bits);
mtd               151 drivers/mtd/nand/raw/mpc5121_nfc.c static inline void mpc5121_nfc_send_addr(struct mtd_info *mtd, u16 addr)
mtd               153 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, NFC_FLASH_ADDR, addr);
mtd               154 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, NFC_CONFIG2, NFC_ADDRESS);
mtd               155 drivers/mtd/nand/raw/mpc5121_nfc.c 	mpc5121_nfc_done(mtd);
mtd               159 drivers/mtd/nand/raw/mpc5121_nfc.c static inline void mpc5121_nfc_send_cmd(struct mtd_info *mtd, u16 cmd)
mtd               161 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, NFC_FLASH_CMD, cmd);
mtd               162 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, NFC_CONFIG2, NFC_COMMAND);
mtd               163 drivers/mtd/nand/raw/mpc5121_nfc.c 	mpc5121_nfc_done(mtd);
mtd               167 drivers/mtd/nand/raw/mpc5121_nfc.c static inline void mpc5121_nfc_send_prog_page(struct mtd_info *mtd)
mtd               169 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_clear(mtd, NFC_BUF_ADDR, NFC_RBA_MASK);
mtd               170 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, NFC_CONFIG2, NFC_INPUT);
mtd               171 drivers/mtd/nand/raw/mpc5121_nfc.c 	mpc5121_nfc_done(mtd);
mtd               175 drivers/mtd/nand/raw/mpc5121_nfc.c static inline void mpc5121_nfc_send_read_page(struct mtd_info *mtd)
mtd               177 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_clear(mtd, NFC_BUF_ADDR, NFC_RBA_MASK);
mtd               178 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, NFC_CONFIG2, NFC_OUTPUT);
mtd               179 drivers/mtd/nand/raw/mpc5121_nfc.c 	mpc5121_nfc_done(mtd);
mtd               183 drivers/mtd/nand/raw/mpc5121_nfc.c static inline void mpc5121_nfc_send_read_id(struct mtd_info *mtd)
mtd               185 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_clear(mtd, NFC_BUF_ADDR, NFC_RBA_MASK);
mtd               186 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, NFC_CONFIG2, NFC_ID);
mtd               187 drivers/mtd/nand/raw/mpc5121_nfc.c 	mpc5121_nfc_done(mtd);
mtd               191 drivers/mtd/nand/raw/mpc5121_nfc.c static inline void mpc5121_nfc_send_read_status(struct mtd_info *mtd)
mtd               193 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_clear(mtd, NFC_BUF_ADDR, NFC_RBA_MASK);
mtd               194 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, NFC_CONFIG2, NFC_STATUS);
mtd               195 drivers/mtd/nand/raw/mpc5121_nfc.c 	mpc5121_nfc_done(mtd);
mtd               201 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct mtd_info *mtd = data;
mtd               202 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               205 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_set(mtd, NFC_CONFIG1, NFC_INT_MASK);
mtd               212 drivers/mtd/nand/raw/mpc5121_nfc.c static void mpc5121_nfc_done(struct mtd_info *mtd)
mtd               214 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               218 drivers/mtd/nand/raw/mpc5121_nfc.c 	if ((nfc_read(mtd, NFC_CONFIG2) & NFC_INT) == 0) {
mtd               219 drivers/mtd/nand/raw/mpc5121_nfc.c 		nfc_clear(mtd, NFC_CONFIG1, NFC_INT_MASK);
mtd               221 drivers/mtd/nand/raw/mpc5121_nfc.c 			(nfc_read(mtd, NFC_CONFIG2) & NFC_INT), NFC_TIMEOUT);
mtd               228 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_clear(mtd, NFC_CONFIG2, NFC_INT);
mtd               232 drivers/mtd/nand/raw/mpc5121_nfc.c static void mpc5121_nfc_addr_cycle(struct mtd_info *mtd, int column, int page)
mtd               234 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               238 drivers/mtd/nand/raw/mpc5121_nfc.c 		mpc5121_nfc_send_addr(mtd, column);
mtd               239 drivers/mtd/nand/raw/mpc5121_nfc.c 		if (mtd->writesize > 512)
mtd               240 drivers/mtd/nand/raw/mpc5121_nfc.c 			mpc5121_nfc_send_addr(mtd, column >> 8);
mtd               245 drivers/mtd/nand/raw/mpc5121_nfc.c 			mpc5121_nfc_send_addr(mtd, page & 0xFF);
mtd               255 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               258 drivers/mtd/nand/raw/mpc5121_nfc.c 		nfc_clear(mtd, NFC_CONFIG1, NFC_CE);
mtd               262 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_clear(mtd, NFC_BUF_ADDR, NFC_ACTIVE_CS_MASK);
mtd               263 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_set(mtd, NFC_BUF_ADDR, (chip << NFC_ACTIVE_CS_SHIFT) &
mtd               265 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_set(mtd, NFC_CONFIG1, NFC_CE);
mtd               269 drivers/mtd/nand/raw/mpc5121_nfc.c static int ads5121_chipselect_init(struct mtd_info *mtd)
mtd               271 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               293 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               323 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               331 drivers/mtd/nand/raw/mpc5121_nfc.c 		mpc5121_nfc_send_prog_page(mtd);
mtd               368 drivers/mtd/nand/raw/mpc5121_nfc.c 	mpc5121_nfc_send_cmd(mtd, command);
mtd               369 drivers/mtd/nand/raw/mpc5121_nfc.c 	mpc5121_nfc_addr_cycle(mtd, column, page);
mtd               373 drivers/mtd/nand/raw/mpc5121_nfc.c 		if (mtd->writesize > 512)
mtd               374 drivers/mtd/nand/raw/mpc5121_nfc.c 			mpc5121_nfc_send_cmd(mtd, NAND_CMD_READSTART);
mtd               375 drivers/mtd/nand/raw/mpc5121_nfc.c 		mpc5121_nfc_send_read_page(mtd);
mtd               379 drivers/mtd/nand/raw/mpc5121_nfc.c 		mpc5121_nfc_send_read_id(mtd);
mtd               383 drivers/mtd/nand/raw/mpc5121_nfc.c 		mpc5121_nfc_send_read_status(mtd);
mtd               393 drivers/mtd/nand/raw/mpc5121_nfc.c static void mpc5121_nfc_copy_spare(struct mtd_info *mtd, uint offset,
mtd               396 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct nand_chip *nand = mtd_to_nand(mtd);
mtd               416 drivers/mtd/nand/raw/mpc5121_nfc.c 	sbsize = (mtd->oobsize / (mtd->writesize / 512)) & ~1;
mtd               445 drivers/mtd/nand/raw/mpc5121_nfc.c static void mpc5121_nfc_buf_copy(struct mtd_info *mtd, u_char *buf, int len,
mtd               448 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               454 drivers/mtd/nand/raw/mpc5121_nfc.c 	if (prv->spareonly || c >= mtd->writesize) {
mtd               456 drivers/mtd/nand/raw/mpc5121_nfc.c 		if (c >= mtd->writesize)
mtd               457 drivers/mtd/nand/raw/mpc5121_nfc.c 			c -= mtd->writesize;
mtd               460 drivers/mtd/nand/raw/mpc5121_nfc.c 		mpc5121_nfc_copy_spare(mtd, c, buf, len, wr);
mtd               468 drivers/mtd/nand/raw/mpc5121_nfc.c 	l = min((uint)len, mtd->writesize - c);
mtd               480 drivers/mtd/nand/raw/mpc5121_nfc.c 		mpc5121_nfc_buf_copy(mtd, buf, len, wr);
mtd               514 drivers/mtd/nand/raw/mpc5121_nfc.c static int mpc5121_nfc_read_hw_config(struct mtd_info *mtd)
mtd               516 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               576 drivers/mtd/nand/raw/mpc5121_nfc.c 	mtd->writesize = rcw_pagesize;
mtd               577 drivers/mtd/nand/raw/mpc5121_nfc.c 	mtd->oobsize = rcw_sparesize;
mtd               593 drivers/mtd/nand/raw/mpc5121_nfc.c static void mpc5121_nfc_free(struct device *dev, struct mtd_info *mtd)
mtd               595 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               612 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct mtd_info *mtd;
mtd               635 drivers/mtd/nand/raw/mpc5121_nfc.c 	mtd = nand_to_mtd(chip);
mtd               637 drivers/mtd/nand/raw/mpc5121_nfc.c 	mtd->dev.parent = dev;
mtd               643 drivers/mtd/nand/raw/mpc5121_nfc.c 	retval = mpc5121_nfc_read_hw_config(mtd);
mtd               681 drivers/mtd/nand/raw/mpc5121_nfc.c 	mtd->name = "MPC5121 NAND";
mtd               696 drivers/mtd/nand/raw/mpc5121_nfc.c 		retval = ads5121_chipselect_init(mtd);
mtd               720 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_set(mtd, NFC_CONFIG1, NFC_RESET);
mtd               721 drivers/mtd/nand/raw/mpc5121_nfc.c 	while (nfc_read(mtd, NFC_CONFIG1) & NFC_RESET) {
mtd               732 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, NFC_CONFIG, NFC_BLS_UNLOCKED);
mtd               735 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, NFC_UNLOCKSTART_BLK0, 0x0000);
mtd               736 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, NFC_UNLOCKEND_BLK0, 0xFFFF);
mtd               737 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, NFC_WRPROT, NFC_WPC_UNLOCK);
mtd               744 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, NFC_CONFIG1, NFC_BIG_ENDIAN | NFC_INT_MASK |
mtd               748 drivers/mtd/nand/raw/mpc5121_nfc.c 	nfc_write(mtd, NFC_SPAS, mtd->oobsize >> 1);
mtd               752 drivers/mtd/nand/raw/mpc5121_nfc.c 									mtd);
mtd               766 drivers/mtd/nand/raw/mpc5121_nfc.c 	switch (mtd->erasesize / mtd->writesize) {
mtd               768 drivers/mtd/nand/raw/mpc5121_nfc.c 		nfc_set(mtd, NFC_CONFIG1, NFC_PPB_32);
mtd               772 drivers/mtd/nand/raw/mpc5121_nfc.c 		nfc_set(mtd, NFC_CONFIG1, NFC_PPB_64);
mtd               776 drivers/mtd/nand/raw/mpc5121_nfc.c 		nfc_set(mtd, NFC_CONFIG1, NFC_PPB_128);
mtd               780 drivers/mtd/nand/raw/mpc5121_nfc.c 		nfc_set(mtd, NFC_CONFIG1, NFC_PPB_256);
mtd               789 drivers/mtd/nand/raw/mpc5121_nfc.c 	dev_set_drvdata(dev, mtd);
mtd               792 drivers/mtd/nand/raw/mpc5121_nfc.c 	retval = mtd_device_register(mtd, NULL, 0);
mtd               800 drivers/mtd/nand/raw/mpc5121_nfc.c 	mpc5121_nfc_free(dev, mtd);
mtd               807 drivers/mtd/nand/raw/mpc5121_nfc.c 	struct mtd_info *mtd = dev_get_drvdata(dev);
mtd               809 drivers/mtd/nand/raw/mpc5121_nfc.c 	nand_release(mtd_to_nand(mtd));
mtd               810 drivers/mtd/nand/raw/mpc5121_nfc.c 	mpc5121_nfc_free(dev, mtd);
mtd               319 drivers/mtd/nand/raw/mtk_nand.c static int mtk_nfc_hw_runtime_config(struct mtd_info *mtd)
mtd               321 drivers/mtd/nand/raw/mtk_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               326 drivers/mtd/nand/raw/mtk_nand.c 	if (!mtd->writesize)
mtd               331 drivers/mtd/nand/raw/mtk_nand.c 	switch (mtd->writesize) {
mtd               357 drivers/mtd/nand/raw/mtk_nand.c 		dev_err(nfc->dev, "invalid page len: %d\n", mtd->writesize);
mtd               629 drivers/mtd/nand/raw/mtk_nand.c static void mtk_nfc_bad_mark_swap(struct mtd_info *mtd, u8 *buf, int raw)
mtd               631 drivers/mtd/nand/raw/mtk_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               643 drivers/mtd/nand/raw/mtk_nand.c static int mtk_nfc_format_subpage(struct mtd_info *mtd, u32 offset,
mtd               646 drivers/mtd/nand/raw/mtk_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               656 drivers/mtd/nand/raw/mtk_nand.c 	memset(nfc->buffer, 0xff, mtd->writesize + mtd->oobsize);
mtd               665 drivers/mtd/nand/raw/mtk_nand.c 			mtk_nand->bad_mark.bm_swap(mtd, nfc->buffer, 1);
mtd               678 drivers/mtd/nand/raw/mtk_nand.c static void mtk_nfc_format_page(struct mtd_info *mtd, const u8 *buf)
mtd               680 drivers/mtd/nand/raw/mtk_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               686 drivers/mtd/nand/raw/mtk_nand.c 	memset(nfc->buffer, 0xff, mtd->writesize + mtd->oobsize);
mtd               693 drivers/mtd/nand/raw/mtk_nand.c 			mtk_nand->bad_mark.bm_swap(mtd, nfc->buffer, 1);
mtd               745 drivers/mtd/nand/raw/mtk_nand.c static int mtk_nfc_do_write_page(struct mtd_info *mtd, struct nand_chip *chip,
mtd               796 drivers/mtd/nand/raw/mtk_nand.c static int mtk_nfc_write_page(struct mtd_info *mtd, struct nand_chip *chip,
mtd               825 drivers/mtd/nand/raw/mtk_nand.c 		memcpy(nfc->buffer, buf, mtd->writesize);
mtd               826 drivers/mtd/nand/raw/mtk_nand.c 		mtk_nand->bad_mark.bm_swap(mtd, nfc->buffer, raw);
mtd               835 drivers/mtd/nand/raw/mtk_nand.c 	len = mtd->writesize + (raw ? mtd->oobsize : 0);
mtd               836 drivers/mtd/nand/raw/mtk_nand.c 	ret = mtk_nfc_do_write_page(mtd, chip, bufpoi, page, len);
mtd               856 drivers/mtd/nand/raw/mtk_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               859 drivers/mtd/nand/raw/mtk_nand.c 	mtk_nfc_format_page(mtd, buf);
mtd               860 drivers/mtd/nand/raw/mtk_nand.c 	return mtk_nfc_write_page(mtd, chip, nfc->buffer, pg, 1);
mtd               867 drivers/mtd/nand/raw/mtk_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               871 drivers/mtd/nand/raw/mtk_nand.c 	ret = mtk_nfc_format_subpage(mtd, offset, data_len, buf);
mtd               876 drivers/mtd/nand/raw/mtk_nand.c 	return mtk_nfc_write_page(mtd, chip, nfc->buffer, page, 1);
mtd               884 drivers/mtd/nand/raw/mtk_nand.c static int mtk_nfc_update_ecc_stats(struct mtd_info *mtd, u8 *buf, u32 start,
mtd               887 drivers/mtd/nand/raw/mtk_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               903 drivers/mtd/nand/raw/mtk_nand.c 	mtd->ecc_stats.corrected += stats.corrected;
mtd               904 drivers/mtd/nand/raw/mtk_nand.c 	mtd->ecc_stats.failed += stats.failed;
mtd               909 drivers/mtd/nand/raw/mtk_nand.c static int mtk_nfc_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
mtd               988 drivers/mtd/nand/raw/mtk_nand.c 			mtk_nfc_update_ecc_stats(mtd, buf, start, sectors);
mtd              1000 drivers/mtd/nand/raw/mtk_nand.c 		mtk_nand->bad_mark.bm_swap(mtd, bufpoi, raw);
mtd              1017 drivers/mtd/nand/raw/mtk_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1019 drivers/mtd/nand/raw/mtk_nand.c 	return mtk_nfc_read_subpage(mtd, chip, 0, mtd->writesize, p, pg, 0);
mtd              1025 drivers/mtd/nand/raw/mtk_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1031 drivers/mtd/nand/raw/mtk_nand.c 	memset(nfc->buffer, 0xff, mtd->writesize + mtd->oobsize);
mtd              1032 drivers/mtd/nand/raw/mtk_nand.c 	ret = mtk_nfc_read_subpage(mtd, chip, 0, mtd->writesize, nfc->buffer,
mtd              1041 drivers/mtd/nand/raw/mtk_nand.c 			mtk_nand->bad_mark.bm_swap(mtd, nfc->buffer, 1);
mtd              1116 drivers/mtd/nand/raw/mtk_nand.c static int mtk_nfc_ooblayout_free(struct mtd_info *mtd, int section,
mtd              1119 drivers/mtd/nand/raw/mtk_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              1124 drivers/mtd/nand/raw/mtk_nand.c 	eccsteps = mtd->writesize / chip->ecc.size;
mtd              1135 drivers/mtd/nand/raw/mtk_nand.c static int mtk_nfc_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd              1138 drivers/mtd/nand/raw/mtk_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              1145 drivers/mtd/nand/raw/mtk_nand.c 	eccsteps = mtd->writesize / chip->ecc.size;
mtd              1147 drivers/mtd/nand/raw/mtk_nand.c 	oob_region->length = mtd->oobsize - oob_region->offset;
mtd              1157 drivers/mtd/nand/raw/mtk_nand.c static void mtk_nfc_set_fdm(struct mtk_nfc_fdm *fdm, struct mtd_info *mtd)
mtd              1159 drivers/mtd/nand/raw/mtk_nand.c 	struct nand_chip *nand = mtd_to_nand(mtd);
mtd              1176 drivers/mtd/nand/raw/mtk_nand.c 				     struct mtd_info *mtd)
mtd              1178 drivers/mtd/nand/raw/mtk_nand.c 	struct nand_chip *nand = mtd_to_nand(mtd);
mtd              1180 drivers/mtd/nand/raw/mtk_nand.c 	if (mtd->writesize == 512) {
mtd              1184 drivers/mtd/nand/raw/mtk_nand.c 		bm_ctl->sec = mtd->writesize / mtk_data_len(nand);
mtd              1185 drivers/mtd/nand/raw/mtk_nand.c 		bm_ctl->pos = mtd->writesize % mtk_data_len(nand);
mtd              1189 drivers/mtd/nand/raw/mtk_nand.c static int mtk_nfc_set_spare_per_sector(u32 *sps, struct mtd_info *mtd)
mtd              1191 drivers/mtd/nand/raw/mtk_nand.c 	struct nand_chip *nand = mtd_to_nand(mtd);
mtd              1196 drivers/mtd/nand/raw/mtk_nand.c 	eccsteps = mtd->writesize / nand->ecc.size;
mtd              1197 drivers/mtd/nand/raw/mtk_nand.c 	*sps = mtd->oobsize / eccsteps;
mtd              1221 drivers/mtd/nand/raw/mtk_nand.c static int mtk_nfc_ecc_init(struct device *dev, struct mtd_info *mtd)
mtd              1223 drivers/mtd/nand/raw/mtk_nand.c 	struct nand_chip *nand = mtd_to_nand(mtd);
mtd              1245 drivers/mtd/nand/raw/mtk_nand.c 			if (mtd->writesize > 512 &&
mtd              1256 drivers/mtd/nand/raw/mtk_nand.c 		ret = mtk_nfc_set_spare_per_sector(&spare, mtd);
mtd              1291 drivers/mtd/nand/raw/mtk_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1292 drivers/mtd/nand/raw/mtk_nand.c 	struct device *dev = mtd->dev.parent;
mtd              1307 drivers/mtd/nand/raw/mtk_nand.c 	ret = mtk_nfc_ecc_init(dev, mtd);
mtd              1311 drivers/mtd/nand/raw/mtk_nand.c 	ret = mtk_nfc_set_spare_per_sector(&mtk_nand->spare_per_sector, mtd);
mtd              1315 drivers/mtd/nand/raw/mtk_nand.c 	mtk_nfc_set_fdm(&mtk_nand->fdm, mtd);
mtd              1316 drivers/mtd/nand/raw/mtk_nand.c 	mtk_nfc_set_bad_mark_ctl(&mtk_nand->bad_mark, mtd);
mtd              1318 drivers/mtd/nand/raw/mtk_nand.c 	len = mtd->writesize + mtd->oobsize;
mtd              1336 drivers/mtd/nand/raw/mtk_nand.c 	struct mtd_info *mtd;
mtd              1407 drivers/mtd/nand/raw/mtk_nand.c 	mtd = nand_to_mtd(nand);
mtd              1408 drivers/mtd/nand/raw/mtk_nand.c 	mtd->owner = THIS_MODULE;
mtd              1409 drivers/mtd/nand/raw/mtk_nand.c 	mtd->dev.parent = dev;
mtd              1410 drivers/mtd/nand/raw/mtk_nand.c 	mtd->name = MTK_NAME;
mtd              1411 drivers/mtd/nand/raw/mtk_nand.c 	mtd_set_ooblayout(mtd, &mtk_nfc_ooblayout_ops);
mtd              1419 drivers/mtd/nand/raw/mtk_nand.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd               250 drivers/mtd/nand/raw/mxc_nand.c static void copy_spare(struct mtd_info *mtd, bool bfrom, void *buf)
mtd               252 drivers/mtd/nand/raw/mxc_nand.c 	struct nand_chip *this = mtd_to_nand(mtd);
mtd               255 drivers/mtd/nand/raw/mxc_nand.c 	u16 num_chunks = mtd->writesize / 512;
mtd               293 drivers/mtd/nand/raw/mxc_nand.c static void mxc_do_addr_cycle(struct mtd_info *mtd, int column, int page_addr)
mtd               295 drivers/mtd/nand/raw/mxc_nand.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd               302 drivers/mtd/nand/raw/mxc_nand.c 		if (mtd->writesize > 512)
mtd               314 drivers/mtd/nand/raw/mxc_nand.c 		if (mtd->writesize > 512) {
mtd               315 drivers/mtd/nand/raw/mxc_nand.c 			if (mtd->size >= 0x10000000) {
mtd               555 drivers/mtd/nand/raw/mxc_nand.c static void send_page_v3(struct mtd_info *mtd, unsigned int ops)
mtd               557 drivers/mtd/nand/raw/mxc_nand.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd               571 drivers/mtd/nand/raw/mxc_nand.c static void send_page_v2(struct mtd_info *mtd, unsigned int ops)
mtd               573 drivers/mtd/nand/raw/mxc_nand.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd               585 drivers/mtd/nand/raw/mxc_nand.c static void send_page_v1(struct mtd_info *mtd, unsigned int ops)
mtd               587 drivers/mtd/nand/raw/mxc_nand.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd               591 drivers/mtd/nand/raw/mxc_nand.c 	if (mtd->writesize > 512)
mtd               716 drivers/mtd/nand/raw/mxc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               725 drivers/mtd/nand/raw/mxc_nand.c 	mxc_do_addr_cycle(mtd, 0, page);
mtd               727 drivers/mtd/nand/raw/mxc_nand.c 	if (mtd->writesize > 512)
mtd               730 drivers/mtd/nand/raw/mxc_nand.c 	no_subpages = mtd->writesize >> 9;
mtd               753 drivers/mtd/nand/raw/mxc_nand.c 				mtd->ecc_stats.corrected++;
mtd               757 drivers/mtd/nand/raw/mxc_nand.c 				mtd->ecc_stats.failed++;
mtd               764 drivers/mtd/nand/raw/mxc_nand.c 		memcpy32_fromio(buf, host->main_area0, mtd->writesize);
mtd               766 drivers/mtd/nand/raw/mxc_nand.c 		copy_spare(mtd, true, oob);
mtd               774 drivers/mtd/nand/raw/mxc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               784 drivers/mtd/nand/raw/mxc_nand.c 	mxc_do_addr_cycle(mtd, 0, page);
mtd               786 drivers/mtd/nand/raw/mxc_nand.c 	if (mtd->writesize > 512)
mtd               790 drivers/mtd/nand/raw/mxc_nand.c 	host->devtype_data->send_page(mtd, NFC_OUTPUT);
mtd               793 drivers/mtd/nand/raw/mxc_nand.c 		memcpy32_fromio(buf, host->main_area0, mtd->writesize);
mtd               795 drivers/mtd/nand/raw/mxc_nand.c 		copy_spare(mtd, true, oob);
mtd               800 drivers/mtd/nand/raw/mxc_nand.c 	no_subpages = mtd->writesize >> 9;
mtd               807 drivers/mtd/nand/raw/mxc_nand.c 			mtd->ecc_stats.failed++;
mtd               809 drivers/mtd/nand/raw/mxc_nand.c 			mtd->ecc_stats.corrected += err;
mtd               858 drivers/mtd/nand/raw/mxc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               864 drivers/mtd/nand/raw/mxc_nand.c 	mxc_do_addr_cycle(mtd, 0, page);
mtd               866 drivers/mtd/nand/raw/mxc_nand.c 	memcpy32_toio(host->main_area0, buf, mtd->writesize);
mtd               867 drivers/mtd/nand/raw/mxc_nand.c 	copy_spare(mtd, false, chip->oob_poi);
mtd               869 drivers/mtd/nand/raw/mxc_nand.c 	host->devtype_data->send_page(mtd, NFC_INPUT);
mtd               871 drivers/mtd/nand/raw/mxc_nand.c 	mxc_do_addr_cycle(mtd, 0, page);
mtd               890 drivers/mtd/nand/raw/mxc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               893 drivers/mtd/nand/raw/mxc_nand.c 	memset(host->data_buf, 0xff, mtd->writesize);
mtd               927 drivers/mtd/nand/raw/mxc_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand_chip);
mtd               930 drivers/mtd/nand/raw/mxc_nand.c 	int n = mtd->oobsize + mtd->writesize - col;
mtd               946 drivers/mtd/nand/raw/mxc_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand_chip);
mtd               949 drivers/mtd/nand/raw/mxc_nand.c 	int n = mtd->oobsize + mtd->writesize - col;
mtd              1005 drivers/mtd/nand/raw/mxc_nand.c static int mxc_v1_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd              1008 drivers/mtd/nand/raw/mxc_nand.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd              1019 drivers/mtd/nand/raw/mxc_nand.c static int mxc_v1_ooblayout_free(struct mtd_info *mtd, int section,
mtd              1022 drivers/mtd/nand/raw/mxc_nand.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd              1028 drivers/mtd/nand/raw/mxc_nand.c 		if (mtd->writesize <= 512) {
mtd              1041 drivers/mtd/nand/raw/mxc_nand.c 			oobregion->length = mtd->oobsize - oobregion->offset;
mtd              1052 drivers/mtd/nand/raw/mxc_nand.c static int mxc_v2_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd              1055 drivers/mtd/nand/raw/mxc_nand.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd              1067 drivers/mtd/nand/raw/mxc_nand.c static int mxc_v2_ooblayout_free(struct mtd_info *mtd, int section,
mtd              1070 drivers/mtd/nand/raw/mxc_nand.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd              1077 drivers/mtd/nand/raw/mxc_nand.c 		if (mtd->writesize <= 512) {
mtd              1102 drivers/mtd/nand/raw/mxc_nand.c static int get_eccsize(struct mtd_info *mtd)
mtd              1106 drivers/mtd/nand/raw/mxc_nand.c 	oobbytes_per_512 = mtd->oobsize * 512 / mtd->writesize;
mtd              1114 drivers/mtd/nand/raw/mxc_nand.c static void preset_v1(struct mtd_info *mtd)
mtd              1116 drivers/mtd/nand/raw/mxc_nand.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd              1120 drivers/mtd/nand/raw/mxc_nand.c 	if (nand_chip->ecc.mode == NAND_ECC_HW && mtd->writesize)
mtd              1216 drivers/mtd/nand/raw/mxc_nand.c static void preset_v2(struct mtd_info *mtd)
mtd              1218 drivers/mtd/nand/raw/mxc_nand.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd              1227 drivers/mtd/nand/raw/mxc_nand.c 	if (mtd->writesize) {
mtd              1228 drivers/mtd/nand/raw/mxc_nand.c 		uint16_t pages_per_block = mtd->erasesize / mtd->writesize;
mtd              1233 drivers/mtd/nand/raw/mxc_nand.c 		host->eccsize = get_eccsize(mtd);
mtd              1246 drivers/mtd/nand/raw/mxc_nand.c 	writew(mtd->oobsize / 2, NFC_V21_RSLTSPARE_AREA);
mtd              1265 drivers/mtd/nand/raw/mxc_nand.c static void preset_v3(struct mtd_info *mtd)
mtd              1267 drivers/mtd/nand/raw/mxc_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              1287 drivers/mtd/nand/raw/mxc_nand.c 		NFC_V3_CONFIG2_SPAS(mtd->oobsize >> 1) |
mtd              1294 drivers/mtd/nand/raw/mxc_nand.c 	if (mtd->writesize == 2048) {
mtd              1297 drivers/mtd/nand/raw/mxc_nand.c 	} else if (mtd->writesize == 4096) {
mtd              1305 drivers/mtd/nand/raw/mxc_nand.c 	if (mtd->writesize) {
mtd              1310 drivers/mtd/nand/raw/mxc_nand.c 				ffs(mtd->erasesize / mtd->writesize) - 6,
mtd              1312 drivers/mtd/nand/raw/mxc_nand.c 		host->eccsize = get_eccsize(mtd);
mtd              1338 drivers/mtd/nand/raw/mxc_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand_chip);
mtd              1350 drivers/mtd/nand/raw/mxc_nand.c 		host->devtype_data->preset(mtd);
mtd              1362 drivers/mtd/nand/raw/mxc_nand.c 		mxc_do_addr_cycle(mtd, column, page_addr);
mtd              1367 drivers/mtd/nand/raw/mxc_nand.c 		mxc_do_addr_cycle(mtd, column, page_addr);
mtd              1378 drivers/mtd/nand/raw/mxc_nand.c 		mxc_do_addr_cycle(mtd, column, page_addr);
mtd              1383 drivers/mtd/nand/raw/mxc_nand.c 		mxc_do_addr_cycle(mtd, column, page_addr);
mtd              1384 drivers/mtd/nand/raw/mxc_nand.c 		host->devtype_data->send_page(mtd, NFC_OUTPUT);
mtd              1398 drivers/mtd/nand/raw/mxc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1407 drivers/mtd/nand/raw/mxc_nand.c 	memcpy32_toio(host->main_area0, host->data_buf, mtd->writesize);
mtd              1409 drivers/mtd/nand/raw/mxc_nand.c 	mxc_do_addr_cycle(mtd, addr, -1);
mtd              1410 drivers/mtd/nand/raw/mxc_nand.c 	host->devtype_data->send_page(mtd, NFC_INPUT);
mtd              1418 drivers/mtd/nand/raw/mxc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1423 drivers/mtd/nand/raw/mxc_nand.c 	mxc_do_addr_cycle(mtd, addr, -1);
mtd              1424 drivers/mtd/nand/raw/mxc_nand.c 	host->devtype_data->send_page(mtd, NFC_OUTPUT);
mtd              1679 drivers/mtd/nand/raw/mxc_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1681 drivers/mtd/nand/raw/mxc_nand.c 	struct device *dev = mtd->dev.parent;
mtd              1707 drivers/mtd/nand/raw/mxc_nand.c 	host->data_buf = devm_kzalloc(dev, mtd->writesize + mtd->oobsize,
mtd              1713 drivers/mtd/nand/raw/mxc_nand.c 	host->devtype_data->preset(mtd);
mtd              1729 drivers/mtd/nand/raw/mxc_nand.c 	host->used_oobsize = min(mtd->oobsize, 218U);
mtd              1757 drivers/mtd/nand/raw/mxc_nand.c 	struct mtd_info *mtd;
mtd              1776 drivers/mtd/nand/raw/mxc_nand.c 	mtd = nand_to_mtd(this);
mtd              1777 drivers/mtd/nand/raw/mxc_nand.c 	mtd->dev.parent = &pdev->dev;
mtd              1778 drivers/mtd/nand/raw/mxc_nand.c 	mtd->name = DRIVER_NAME;
mtd              1843 drivers/mtd/nand/raw/mxc_nand.c 	mtd_set_ooblayout(mtd, host->devtype_data->ooblayout);
mtd              1900 drivers/mtd/nand/raw/mxc_nand.c 	err = mtd_device_parse_register(mtd, part_probes, NULL,
mtd               486 drivers/mtd/nand/raw/mxic_nand.c 	struct mtd_info *mtd;
mtd               514 drivers/mtd/nand/raw/mxic_nand.c 	mtd = nand_to_mtd(nand_chip);
mtd               515 drivers/mtd/nand/raw/mxic_nand.c 	mtd->dev.parent = &pdev->dev;
mtd               543 drivers/mtd/nand/raw/mxic_nand.c 	err = mtd_device_register(mtd, NULL, 0);
mtd                13 drivers/mtd/nand/raw/nand_amd.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd                31 drivers/mtd/nand/raw/nand_amd.c 		mtd->erasesize = memorg->pages_per_eraseblock *
mtd                49 drivers/mtd/nand/raw/nand_base.c static int nand_ooblayout_ecc_sp(struct mtd_info *mtd, int section,
mtd                52 drivers/mtd/nand/raw/nand_base.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd                60 drivers/mtd/nand/raw/nand_base.c 		if (mtd->oobsize == 16)
mtd                65 drivers/mtd/nand/raw/nand_base.c 		if (mtd->oobsize == 8)
mtd                75 drivers/mtd/nand/raw/nand_base.c static int nand_ooblayout_free_sp(struct mtd_info *mtd, int section,
mtd                81 drivers/mtd/nand/raw/nand_base.c 	if (mtd->oobsize == 16) {
mtd               104 drivers/mtd/nand/raw/nand_base.c static int nand_ooblayout_ecc_lp(struct mtd_info *mtd, int section,
mtd               107 drivers/mtd/nand/raw/nand_base.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               114 drivers/mtd/nand/raw/nand_base.c 	oobregion->offset = mtd->oobsize - oobregion->length;
mtd               119 drivers/mtd/nand/raw/nand_base.c static int nand_ooblayout_free_lp(struct mtd_info *mtd, int section,
mtd               122 drivers/mtd/nand/raw/nand_base.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               128 drivers/mtd/nand/raw/nand_base.c 	oobregion->length = mtd->oobsize - ecc->total - 2;
mtd               144 drivers/mtd/nand/raw/nand_base.c static int nand_ooblayout_ecc_lp_hamming(struct mtd_info *mtd, int section,
mtd               147 drivers/mtd/nand/raw/nand_base.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               153 drivers/mtd/nand/raw/nand_base.c 	switch (mtd->oobsize) {
mtd               165 drivers/mtd/nand/raw/nand_base.c 	if (oobregion->offset + oobregion->length > mtd->oobsize)
mtd               171 drivers/mtd/nand/raw/nand_base.c static int nand_ooblayout_free_lp_hamming(struct mtd_info *mtd, int section,
mtd               174 drivers/mtd/nand/raw/nand_base.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               181 drivers/mtd/nand/raw/nand_base.c 	switch (mtd->oobsize) {
mtd               197 drivers/mtd/nand/raw/nand_base.c 		oobregion->length = mtd->oobsize - oobregion->offset;
mtd               292 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               293 drivers/mtd/nand/raw/nand_base.c 	int last_page = ((mtd->erasesize - mtd->writesize) >>
mtd               408 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               415 drivers/mtd/nand/raw/nand_base.c 	memset(chip->oob_poi, 0xff, mtd->oobsize);
mtd               425 drivers/mtd/nand/raw/nand_base.c 		ret = mtd_ooblayout_set_databytes(mtd, oob, chip->oob_poi,
mtd               447 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               453 drivers/mtd/nand/raw/nand_base.c 	len = mtd_oobavail(mtd, ops);
mtd               517 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               537 drivers/mtd/nand/raw/nand_base.c 					ofs + (page_offset * mtd->writesize),
mtd               583 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               612 drivers/mtd/nand/raw/nand_base.c 		mtd->ecc_stats.badblocks++;
mtd               624 drivers/mtd/nand/raw/nand_base.c static int nand_block_isreserved(struct mtd_info *mtd, loff_t ofs)
mtd               626 drivers/mtd/nand/raw/nand_base.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               973 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               976 drivers/mtd/nand/raw/nand_base.c 	if (offset_in_page > mtd->writesize + mtd->oobsize)
mtd               984 drivers/mtd/nand/raw/nand_base.c 	if (mtd->writesize <= 512 && offset_in_page >= mtd->writesize)
mtd               985 drivers/mtd/nand/raw/nand_base.c 		offset_in_page -= mtd->writesize;
mtd              1004 drivers/mtd/nand/raw/nand_base.c 	if (mtd->writesize <= 512)
mtd              1016 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1034 drivers/mtd/nand/raw/nand_base.c 	if (offset_in_page >= mtd->writesize)
mtd              1108 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1113 drivers/mtd/nand/raw/nand_base.c 	if (offset_in_page + len > mtd->writesize + mtd->oobsize)
mtd              1117 drivers/mtd/nand/raw/nand_base.c 		if (mtd->writesize > 512)
mtd              1198 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1203 drivers/mtd/nand/raw/nand_base.c 	if (offset_in_page + len > mtd->writesize + mtd->oobsize)
mtd              1207 drivers/mtd/nand/raw/nand_base.c 	if (mtd->writesize <= 512)
mtd              1261 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1266 drivers/mtd/nand/raw/nand_base.c 	if (offset_in_oob + len > mtd->oobsize)
mtd              1271 drivers/mtd/nand/raw/nand_base.c 					 mtd->writesize + offset_in_oob,
mtd              1286 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1326 drivers/mtd/nand/raw/nand_base.c 	if (mtd->writesize <= 512) {
mtd              1332 drivers/mtd/nand/raw/nand_base.c 		if (offset_in_page >= mtd->writesize)
mtd              1374 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1379 drivers/mtd/nand/raw/nand_base.c 	if (offset_in_page + len > mtd->writesize + mtd->oobsize)
mtd              1459 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1465 drivers/mtd/nand/raw/nand_base.c 	if (offset_in_page + len > mtd->writesize + mtd->oobsize)
mtd              1504 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1509 drivers/mtd/nand/raw/nand_base.c 	if (offset_in_page + len > mtd->writesize + mtd->oobsize)
mtd              1513 drivers/mtd/nand/raw/nand_base.c 	if (mtd->writesize <= 512)
mtd              2609 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2612 drivers/mtd/nand/raw/nand_base.c 	ret = nand_read_page_op(chip, page, 0, buf, mtd->writesize);
mtd              2617 drivers/mtd/nand/raw/nand_base.c 		ret = nand_read_data_op(chip, chip->oob_poi, mtd->oobsize,
mtd              2639 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2681 drivers/mtd/nand/raw/nand_base.c 	size = mtd->oobsize - (oob - chip->oob_poi);
mtd              2701 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2715 drivers/mtd/nand/raw/nand_base.c 	ret = mtd_ooblayout_get_eccbytes(mtd, ecc_code, chip->oob_poi, 0,
mtd              2728 drivers/mtd/nand/raw/nand_base.c 			mtd->ecc_stats.failed++;
mtd              2730 drivers/mtd/nand/raw/nand_base.c 			mtd->ecc_stats.corrected += stat;
mtd              2748 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2783 drivers/mtd/nand/raw/nand_base.c 	ret = mtd_ooblayout_find_eccregion(mtd, index, &section, &oobregion);
mtd              2791 drivers/mtd/nand/raw/nand_base.c 		ret = nand_change_read_column_op(chip, mtd->writesize,
mtd              2792 drivers/mtd/nand/raw/nand_base.c 						 chip->oob_poi, mtd->oobsize,
mtd              2810 drivers/mtd/nand/raw/nand_base.c 						 mtd->writesize + aligned_pos,
mtd              2817 drivers/mtd/nand/raw/nand_base.c 	ret = mtd_ooblayout_get_eccbytes(mtd, chip->ecc.code_buf,
mtd              2839 drivers/mtd/nand/raw/nand_base.c 			mtd->ecc_stats.failed++;
mtd              2841 drivers/mtd/nand/raw/nand_base.c 			mtd->ecc_stats.corrected += stat;
mtd              2860 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2883 drivers/mtd/nand/raw/nand_base.c 	ret = nand_read_data_op(chip, chip->oob_poi, mtd->oobsize, false);
mtd              2887 drivers/mtd/nand/raw/nand_base.c 	ret = mtd_ooblayout_get_eccbytes(mtd, ecc_code, chip->oob_poi, 0,
mtd              2909 drivers/mtd/nand/raw/nand_base.c 			mtd->ecc_stats.failed++;
mtd              2911 drivers/mtd/nand/raw/nand_base.c 			mtd->ecc_stats.corrected += stat;
mtd              2934 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2944 drivers/mtd/nand/raw/nand_base.c 	ret = nand_read_oob_op(chip, page, 0, chip->oob_poi, mtd->oobsize);
mtd              2952 drivers/mtd/nand/raw/nand_base.c 	ret = mtd_ooblayout_get_eccbytes(mtd, ecc_code, chip->oob_poi, 0,
mtd              2979 drivers/mtd/nand/raw/nand_base.c 			mtd->ecc_stats.failed++;
mtd              2981 drivers/mtd/nand/raw/nand_base.c 			mtd->ecc_stats.corrected += stat;
mtd              3001 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3062 drivers/mtd/nand/raw/nand_base.c 			mtd->ecc_stats.failed++;
mtd              3064 drivers/mtd/nand/raw/nand_base.c 			mtd->ecc_stats.corrected += stat;
mtd              3070 drivers/mtd/nand/raw/nand_base.c 	i = mtd->oobsize - (oob - chip->oob_poi);
mtd              3090 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3101 drivers/mtd/nand/raw/nand_base.c 		ret = mtd_ooblayout_get_databytes(mtd, oob, chip->oob_poi,
mtd              3157 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3161 drivers/mtd/nand/raw/nand_base.c 	uint32_t max_oobsize = mtd_oobavail(mtd, ops);
mtd              3175 drivers/mtd/nand/raw/nand_base.c 	col = (int)(from & (mtd->writesize - 1));
mtd              3182 drivers/mtd/nand/raw/nand_base.c 		unsigned int ecc_failures = mtd->ecc_stats.failed;
mtd              3184 drivers/mtd/nand/raw/nand_base.c 		bytes = min(mtd->writesize - col, readlen);
mtd              3185 drivers/mtd/nand/raw/nand_base.c 		aligned = (bytes == mtd->writesize);
mtd              3230 drivers/mtd/nand/raw/nand_base.c 				    !(mtd->ecc_stats.failed - ecc_failures) &&
mtd              3253 drivers/mtd/nand/raw/nand_base.c 			if (mtd->ecc_stats.failed - ecc_failures) {
mtd              3262 drivers/mtd/nand/raw/nand_base.c 					mtd->ecc_stats.failed = ecc_failures;
mtd              3327 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3329 drivers/mtd/nand/raw/nand_base.c 	return nand_read_oob_op(chip, page, 0, chip->oob_poi, mtd->oobsize);
mtd              3341 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3342 drivers/mtd/nand/raw/nand_base.c 	int length = mtd->oobsize;
mtd              3357 drivers/mtd/nand/raw/nand_base.c 			if (mtd->writesize > 512)
mtd              3394 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3396 drivers/mtd/nand/raw/nand_base.c 	return nand_prog_page_op(chip, page, mtd->writesize, chip->oob_poi,
mtd              3397 drivers/mtd/nand/raw/nand_base.c 				 mtd->oobsize);
mtd              3409 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3411 drivers/mtd/nand/raw/nand_base.c 	int eccsize = chip->ecc.size, length = mtd->oobsize;
mtd              3432 drivers/mtd/nand/raw/nand_base.c 			if (mtd->writesize <= 512) {
mtd              3485 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3497 drivers/mtd/nand/raw/nand_base.c 	stats = mtd->ecc_stats;
mtd              3499 drivers/mtd/nand/raw/nand_base.c 	len = mtd_oobavail(mtd, ops);
mtd              3546 drivers/mtd/nand/raw/nand_base.c 	if (mtd->ecc_stats.failed - stats.failed)
mtd              3560 drivers/mtd/nand/raw/nand_base.c static int nand_read_oob(struct mtd_info *mtd, loff_t from,
mtd              3563 drivers/mtd/nand/raw/nand_base.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              3613 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3616 drivers/mtd/nand/raw/nand_base.c 	ret = nand_prog_page_begin_op(chip, page, 0, buf, mtd->writesize);
mtd              3621 drivers/mtd/nand/raw/nand_base.c 		ret = nand_write_data_op(chip, chip->oob_poi, mtd->oobsize,
mtd              3644 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3686 drivers/mtd/nand/raw/nand_base.c 	size = mtd->oobsize - (oob - chip->oob_poi);
mtd              3705 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3716 drivers/mtd/nand/raw/nand_base.c 	ret = mtd_ooblayout_set_eccbytes(mtd, ecc_calc, chip->oob_poi, 0,
mtd              3734 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3755 drivers/mtd/nand/raw/nand_base.c 	ret = mtd_ooblayout_set_eccbytes(mtd, ecc_calc, chip->oob_poi, 0,
mtd              3760 drivers/mtd/nand/raw/nand_base.c 	ret = nand_write_data_op(chip, chip->oob_poi, mtd->oobsize, false);
mtd              3781 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3789 drivers/mtd/nand/raw/nand_base.c 	int oob_bytes       = mtd->oobsize / ecc_steps;
mtd              3824 drivers/mtd/nand/raw/nand_base.c 	ret = mtd_ooblayout_set_eccbytes(mtd, ecc_calc, chip->oob_poi, 0,
mtd              3830 drivers/mtd/nand/raw/nand_base.c 	ret = nand_write_data_op(chip, chip->oob_poi, mtd->oobsize, false);
mtd              3851 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3898 drivers/mtd/nand/raw/nand_base.c 	i = mtd->oobsize - (oob - chip->oob_poi);
mtd              3922 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3927 drivers/mtd/nand/raw/nand_base.c 		subpage = offset || (data_len < mtd->writesize);
mtd              3959 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              3964 drivers/mtd/nand/raw/nand_base.c 	uint32_t oobmaxlen = mtd_oobavail(mtd, ops);
mtd              3982 drivers/mtd/nand/raw/nand_base.c 	column = to & (mtd->writesize - 1);
mtd              4008 drivers/mtd/nand/raw/nand_base.c 		int bytes = mtd->writesize;
mtd              4011 drivers/mtd/nand/raw/nand_base.c 		int part_pagewr = (column || writelen < mtd->writesize);
mtd              4029 drivers/mtd/nand/raw/nand_base.c 			memset(wbuf, 0xff, mtd->writesize);
mtd              4039 drivers/mtd/nand/raw/nand_base.c 			memset(chip->oob_poi, 0xff, mtd->oobsize);
mtd              4085 drivers/mtd/nand/raw/nand_base.c static int panic_nand_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd              4088 drivers/mtd/nand/raw/nand_base.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              4115 drivers/mtd/nand/raw/nand_base.c static int nand_write_oob(struct mtd_info *mtd, loff_t to,
mtd              4118 drivers/mtd/nand/raw/nand_base.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              4154 drivers/mtd/nand/raw/nand_base.c static int nand_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd              4156 drivers/mtd/nand/raw/nand_base.c 	return nand_erase_nand(mtd_to_nand(mtd), instr, 0);
mtd              4263 drivers/mtd/nand/raw/nand_base.c static void nand_sync(struct mtd_info *mtd)
mtd              4265 drivers/mtd/nand/raw/nand_base.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              4280 drivers/mtd/nand/raw/nand_base.c static int nand_block_isbad(struct mtd_info *mtd, loff_t offs)
mtd              4282 drivers/mtd/nand/raw/nand_base.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              4306 drivers/mtd/nand/raw/nand_base.c static int nand_block_markbad(struct mtd_info *mtd, loff_t ofs)
mtd              4310 drivers/mtd/nand/raw/nand_base.c 	ret = nand_block_isbad(mtd, ofs);
mtd              4318 drivers/mtd/nand/raw/nand_base.c 	return nand_block_markbad_lowlevel(mtd_to_nand(mtd), ofs);
mtd              4325 drivers/mtd/nand/raw/nand_base.c static int nand_suspend(struct mtd_info *mtd)
mtd              4327 drivers/mtd/nand/raw/nand_base.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              4340 drivers/mtd/nand/raw/nand_base.c static void nand_resume(struct mtd_info *mtd)
mtd              4342 drivers/mtd/nand/raw/nand_base.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              4358 drivers/mtd/nand/raw/nand_base.c static void nand_shutdown(struct mtd_info *mtd)
mtd              4360 drivers/mtd/nand/raw/nand_base.c 	nand_suspend(mtd);
mtd              4473 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              4486 drivers/mtd/nand/raw/nand_base.c 	mtd->writesize = memorg->pagesize;
mtd              4489 drivers/mtd/nand/raw/nand_base.c 	memorg->oobsize = (8 << (extid & 0x01)) * (mtd->writesize >> 9);
mtd              4490 drivers/mtd/nand/raw/nand_base.c 	mtd->oobsize = memorg->oobsize;
mtd              4495 drivers/mtd/nand/raw/nand_base.c 	mtd->erasesize = (64 * 1024) << (extid & 0x03);
mtd              4510 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              4516 drivers/mtd/nand/raw/nand_base.c 	mtd->erasesize = type->erasesize;
mtd              4518 drivers/mtd/nand/raw/nand_base.c 	mtd->writesize = memorg->pagesize;
mtd              4520 drivers/mtd/nand/raw/nand_base.c 	mtd->oobsize = memorg->oobsize;
mtd              4533 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              4536 drivers/mtd/nand/raw/nand_base.c 	if (mtd->writesize > 512 || (chip->options & NAND_BUSWIDTH_16))
mtd              4550 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              4558 drivers/mtd/nand/raw/nand_base.c 		mtd->writesize = memorg->pagesize;
mtd              4561 drivers/mtd/nand/raw/nand_base.c 		mtd->erasesize = type->erasesize;
mtd              4563 drivers/mtd/nand/raw/nand_base.c 		mtd->oobsize = memorg->oobsize;
mtd              4651 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              4774 drivers/mtd/nand/raw/nand_base.c 	if (!mtd->name)
mtd              4775 drivers/mtd/nand/raw/nand_base.c 		mtd->name = chip->parameters.model;
mtd              4788 drivers/mtd/nand/raw/nand_base.c 			mtd->name);
mtd              4799 drivers/mtd/nand/raw/nand_base.c 	chip->page_shift = ffs(mtd->writesize) - 1;
mtd              4805 drivers/mtd/nand/raw/nand_base.c 		ffs(mtd->erasesize) - 1;
mtd              4826 drivers/mtd/nand/raw/nand_base.c 		mtd->erasesize >> 10, mtd->writesize, mtd->oobsize);
mtd              4999 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              5019 drivers/mtd/nand/raw/nand_base.c 	if (!mtd->name && mtd->dev.parent)
mtd              5020 drivers/mtd/nand/raw/nand_base.c 		mtd->name = dev_name(mtd->dev.parent);
mtd              5071 drivers/mtd/nand/raw/nand_base.c 	mtd->size = i * nanddev_target_size(&chip->base);
mtd              5084 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              5130 drivers/mtd/nand/raw/nand_base.c 		if (!ecc->size && (mtd->oobsize >= 64)) {
mtd              5139 drivers/mtd/nand/raw/nand_base.c 		if (!mtd->ooblayout) {
mtd              5141 drivers/mtd/nand/raw/nand_base.c 			if (mtd->oobsize < 64) {
mtd              5146 drivers/mtd/nand/raw/nand_base.c 			mtd_set_ooblayout(mtd, &nand_ooblayout_lp_ops);
mtd              5155 drivers/mtd/nand/raw/nand_base.c 		if (mtd->ooblayout == &nand_ooblayout_lp_ops &&
mtd              5161 drivers/mtd/nand/raw/nand_base.c 			steps = mtd->writesize / ecc->size;
mtd              5164 drivers/mtd/nand/raw/nand_base.c 			bytes = (mtd->oobsize - 2) / steps;
mtd              5170 drivers/mtd/nand/raw/nand_base.c 		ecc->priv = nand_bch_init(mtd);
mtd              5196 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              5200 drivers/mtd/nand/raw/nand_base.c 	int ecc_bytes, nsteps = mtd->writesize / preset_step;
mtd              5250 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              5264 drivers/mtd/nand/raw/nand_base.c 	req_corr = mtd->writesize / req_step * req_strength;
mtd              5281 drivers/mtd/nand/raw/nand_base.c 			if (mtd->writesize % step_size)
mtd              5284 drivers/mtd/nand/raw/nand_base.c 			nsteps = mtd->writesize / step_size;
mtd              5331 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              5350 drivers/mtd/nand/raw/nand_base.c 			if (mtd->writesize % step_size)
mtd              5353 drivers/mtd/nand/raw/nand_base.c 			nsteps = mtd->writesize / step_size;
mtd              5408 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              5410 drivers/mtd/nand/raw/nand_base.c 	if (WARN_ON(oobavail < 0 || oobavail > mtd->oobsize))
mtd              5442 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              5454 drivers/mtd/nand/raw/nand_base.c 	corr = (mtd->writesize * ecc->strength) / ecc->size;
mtd              5455 drivers/mtd/nand/raw/nand_base.c 	ds_corr = (mtd->writesize * chip->base.eccreq.strength) /
mtd              5515 drivers/mtd/nand/raw/nand_base.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              5525 drivers/mtd/nand/raw/nand_base.c 	chip->data_buf = kmalloc(mtd->writesize + mtd->oobsize, GFP_KERNEL);
mtd              5542 drivers/mtd/nand/raw/nand_base.c 	chip->oob_poi = chip->data_buf + mtd->writesize;
mtd              5547 drivers/mtd/nand/raw/nand_base.c 	if (!mtd->ooblayout &&
mtd              5549 drivers/mtd/nand/raw/nand_base.c 		switch (mtd->oobsize) {
mtd              5552 drivers/mtd/nand/raw/nand_base.c 			mtd_set_ooblayout(mtd, &nand_ooblayout_sp_ops);
mtd              5556 drivers/mtd/nand/raw/nand_base.c 			mtd_set_ooblayout(mtd, &nand_ooblayout_lp_hamming_ops);
mtd              5567 drivers/mtd/nand/raw/nand_base.c 				mtd_set_ooblayout(mtd,
mtd              5573 drivers/mtd/nand/raw/nand_base.c 				mtd->oobsize);
mtd              5640 drivers/mtd/nand/raw/nand_base.c 		if (mtd->writesize >= ecc->size) {
mtd              5649 drivers/mtd/nand/raw/nand_base.c 			ecc->size, mtd->writesize);
mtd              5682 drivers/mtd/nand/raw/nand_base.c 		ecc->size = mtd->writesize;
mtd              5694 drivers/mtd/nand/raw/nand_base.c 		ecc->calc_buf = kmalloc(mtd->oobsize, GFP_KERNEL);
mtd              5695 drivers/mtd/nand/raw/nand_base.c 		ecc->code_buf = kmalloc(mtd->oobsize, GFP_KERNEL);
mtd              5709 drivers/mtd/nand/raw/nand_base.c 	mtd->ecc_strength = ecc->strength;
mtd              5710 drivers/mtd/nand/raw/nand_base.c 	mtd->ecc_step_size = ecc->size;
mtd              5716 drivers/mtd/nand/raw/nand_base.c 	ecc->steps = mtd->writesize / ecc->size;
mtd              5717 drivers/mtd/nand/raw/nand_base.c 	if (ecc->steps * ecc->size != mtd->writesize) {
mtd              5723 drivers/mtd/nand/raw/nand_base.c 	if (ecc->total > mtd->oobsize) {
mtd              5733 drivers/mtd/nand/raw/nand_base.c 	ret = mtd_ooblayout_count_freebytes(mtd);
mtd              5737 drivers/mtd/nand/raw/nand_base.c 	mtd->oobavail = ret;
mtd              5742 drivers/mtd/nand/raw/nand_base.c 			mtd->name);
mtd              5748 drivers/mtd/nand/raw/nand_base.c 			mtd->subpage_sft = 1;
mtd              5753 drivers/mtd/nand/raw/nand_base.c 			mtd->subpage_sft = 2;
mtd              5757 drivers/mtd/nand/raw/nand_base.c 	chip->subpagesize = mtd->writesize >> mtd->subpage_sft;
mtd              5773 drivers/mtd/nand/raw/nand_base.c 	ret = nanddev_init(&chip->base, &rawnand_ops, mtd->owner);
mtd              5779 drivers/mtd/nand/raw/nand_base.c 		mtd->flags = MTD_CAP_ROM;
mtd              5782 drivers/mtd/nand/raw/nand_base.c 	mtd->_erase = nand_erase;
mtd              5783 drivers/mtd/nand/raw/nand_base.c 	mtd->_point = NULL;
mtd              5784 drivers/mtd/nand/raw/nand_base.c 	mtd->_unpoint = NULL;
mtd              5785 drivers/mtd/nand/raw/nand_base.c 	mtd->_panic_write = panic_nand_write;
mtd              5786 drivers/mtd/nand/raw/nand_base.c 	mtd->_read_oob = nand_read_oob;
mtd              5787 drivers/mtd/nand/raw/nand_base.c 	mtd->_write_oob = nand_write_oob;
mtd              5788 drivers/mtd/nand/raw/nand_base.c 	mtd->_sync = nand_sync;
mtd              5789 drivers/mtd/nand/raw/nand_base.c 	mtd->_lock = NULL;
mtd              5790 drivers/mtd/nand/raw/nand_base.c 	mtd->_unlock = NULL;
mtd              5791 drivers/mtd/nand/raw/nand_base.c 	mtd->_suspend = nand_suspend;
mtd              5792 drivers/mtd/nand/raw/nand_base.c 	mtd->_resume = nand_resume;
mtd              5793 drivers/mtd/nand/raw/nand_base.c 	mtd->_reboot = nand_shutdown;
mtd              5794 drivers/mtd/nand/raw/nand_base.c 	mtd->_block_isreserved = nand_block_isreserved;
mtd              5795 drivers/mtd/nand/raw/nand_base.c 	mtd->_block_isbad = nand_block_isbad;
mtd              5796 drivers/mtd/nand/raw/nand_base.c 	mtd->_block_markbad = nand_block_markbad;
mtd              5797 drivers/mtd/nand/raw/nand_base.c 	mtd->_max_bad_blocks = nanddev_mtd_max_bad_blocks;
mtd              5804 drivers/mtd/nand/raw/nand_base.c 	if (!mtd->bitflip_threshold)
mtd              5805 drivers/mtd/nand/raw/nand_base.c 		mtd->bitflip_threshold = DIV_ROUND_UP(mtd->ecc_strength * 3, 4);
mtd               169 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               193 drivers/mtd/nand/raw/nand_bbt.c 		res = mtd_read(mtd, from, len, &retlen, buf);
mtd               197 drivers/mtd/nand/raw/nand_bbt.c 					from & ~mtd->writesize);
mtd               201 drivers/mtd/nand/raw/nand_bbt.c 					from & ~mtd->writesize);
mtd               222 drivers/mtd/nand/raw/nand_bbt.c 					mtd->ecc_stats.bbtblocks++;
mtd               239 drivers/mtd/nand/raw/nand_bbt.c 				mtd->ecc_stats.badblocks++;
mtd               262 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               279 drivers/mtd/nand/raw/nand_bbt.c 				mtd->size >> this->bbt_erase_shift, td, 0);
mtd               290 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               298 drivers/mtd/nand/raw/nand_bbt.c 	return mtd_read(mtd, offs, len, &retlen, buf);
mtd               315 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               321 drivers/mtd/nand/raw/nand_bbt.c 	ops.ooblen = mtd->oobsize;
mtd               325 drivers/mtd/nand/raw/nand_bbt.c 		ops.len = min(len, (size_t)mtd->writesize);
mtd               328 drivers/mtd/nand/raw/nand_bbt.c 		res = mtd_read_oob(mtd, offs, &ops);
mtd               336 drivers/mtd/nand/raw/nand_bbt.c 		buf += mtd->oobsize + mtd->writesize;
mtd               337 drivers/mtd/nand/raw/nand_bbt.c 		len -= mtd->writesize;
mtd               338 drivers/mtd/nand/raw/nand_bbt.c 		offs += mtd->writesize;
mtd               356 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               361 drivers/mtd/nand/raw/nand_bbt.c 	ops.ooblen = mtd->oobsize;
mtd               366 drivers/mtd/nand/raw/nand_bbt.c 	return mtd_write_oob(mtd, offs, &ops);
mtd               371 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               375 drivers/mtd/nand/raw/nand_bbt.c 		ver_offs += mtd->writesize;
mtd               392 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               397 drivers/mtd/nand/raw/nand_bbt.c 			  mtd->writesize, td);
mtd               406 drivers/mtd/nand/raw/nand_bbt.c 			  mtd->writesize, md);
mtd               417 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               422 drivers/mtd/nand/raw/nand_bbt.c 	ops.ooblen = mtd->oobsize;
mtd               435 drivers/mtd/nand/raw/nand_bbt.c 		ret = mtd_read_oob(mtd, offs + (page_offset * mtd->writesize),
mtd               465 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               472 drivers/mtd/nand/raw/nand_bbt.c 		numblocks = mtd->size >> this->bbt_erase_shift;
mtd               500 drivers/mtd/nand/raw/nand_bbt.c 			mtd->ecc_stats.badblocks++;
mtd               527 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               530 drivers/mtd/nand/raw/nand_bbt.c 	int scanlen = mtd->writesize + mtd->oobsize;
mtd               536 drivers/mtd/nand/raw/nand_bbt.c 		startblock = (mtd->size >> this->bbt_erase_shift) - 1;
mtd               550 drivers/mtd/nand/raw/nand_bbt.c 		bbtblocks = mtd->size >> this->bbt_erase_shift;
mtd               564 drivers/mtd/nand/raw/nand_bbt.c 			scan_read(this, buf, offs, mtd->writesize, td);
mtd               565 drivers/mtd/nand/raw/nand_bbt.c 			if (!check_pattern(buf, scanlen, mtd->writesize, td)) {
mtd               717 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               728 drivers/mtd/nand/raw/nand_bbt.c 	ops.ooblen = mtd->oobsize;
mtd               746 drivers/mtd/nand/raw/nand_bbt.c 		numblocks = (int)(mtd->size >> this->bbt_erase_shift);
mtd               793 drivers/mtd/nand/raw/nand_bbt.c 			res = mtd_read(mtd, to, len, &retlen, buf);
mtd               802 drivers/mtd/nand/raw/nand_bbt.c 			ops.ooblen = (len >> this->page_shift) * mtd->oobsize;
mtd               804 drivers/mtd/nand/raw/nand_bbt.c 			res = mtd_read_oob(mtd, to + mtd->writesize, &ops);
mtd               813 drivers/mtd/nand/raw/nand_bbt.c 			ooboffs = len + (pageoffs * mtd->oobsize);
mtd               825 drivers/mtd/nand/raw/nand_bbt.c 			len = ALIGN(len, mtd->writesize);
mtd               834 drivers/mtd/nand/raw/nand_bbt.c 			len = ALIGN(len, mtd->writesize);
mtd               837 drivers/mtd/nand/raw/nand_bbt.c 			       (len >> this->page_shift)* mtd->oobsize);
mtd              1043 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd              1055 drivers/mtd/nand/raw/nand_bbt.c 	len += (len >> this->page_shift) * mtd->oobsize;
mtd              1100 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd              1110 drivers/mtd/nand/raw/nand_bbt.c 		nrblocks = (int)(mtd->size >> this->bbt_erase_shift);
mtd              1161 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd              1191 drivers/mtd/nand/raw/nand_bbt.c 		table_size = mtd->size >> this->bbt_erase_shift;
mtd              1213 drivers/mtd/nand/raw/nand_bbt.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd              1219 drivers/mtd/nand/raw/nand_bbt.c 	len = (mtd->size >> (this->bbt_erase_shift + 2)) ? : 1;
mtd              1244 drivers/mtd/nand/raw/nand_bbt.c 	len += (len >> this->page_shift) * mtd->oobsize;
mtd               106 drivers/mtd/nand/raw/nand_bch.c struct nand_bch_control *nand_bch_init(struct mtd_info *mtd)
mtd               108 drivers/mtd/nand/raw/nand_bch.c 	struct nand_chip *nand = mtd_to_nand(mtd);
mtd               144 drivers/mtd/nand/raw/nand_bch.c 	eccsteps = mtd->writesize/eccsize;
mtd               147 drivers/mtd/nand/raw/nand_bch.c 	if (!mtd->ooblayout) {
mtd               168 drivers/mtd/nand/raw/nand_bch.c 	if (mtd_ooblayout_count_eccbytes(mtd) != (eccsteps*eccbytes)) {
mtd               411 drivers/mtd/nand/raw/nand_hynix.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               492 drivers/mtd/nand/raw/nand_hynix.c 	mtd->oobsize = memorg->oobsize;
mtd               607 drivers/mtd/nand/raw/nand_hynix.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               628 drivers/mtd/nand/raw/nand_hynix.c 	mtd->writesize = memorg->pagesize;
mtd               641 drivers/mtd/nand/raw/nand_hynix.c 		mtd->erasesize = SZ_1M << tmp;
mtd               645 drivers/mtd/nand/raw/nand_hynix.c 		mtd->erasesize = SZ_512K + SZ_256K;
mtd               649 drivers/mtd/nand/raw/nand_hynix.c 		mtd->erasesize = SZ_128K << tmp;
mtd                24 drivers/mtd/nand/raw/nand_jedec.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd                88 drivers/mtd/nand/raw/nand_jedec.c 	mtd->writesize = memorg->pagesize;
mtd                93 drivers/mtd/nand/raw/nand_jedec.c 	mtd->erasesize = memorg->pages_per_eraseblock * memorg->pagesize;
mtd                96 drivers/mtd/nand/raw/nand_jedec.c 	mtd->oobsize = memorg->oobsize;
mtd               251 drivers/mtd/nand/raw/nand_legacy.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               258 drivers/mtd/nand/raw/nand_legacy.c 		if (column >= mtd->writesize) {
mtd               260 drivers/mtd/nand/raw/nand_legacy.c 			column -= mtd->writesize;
mtd               388 drivers/mtd/nand/raw/nand_legacy.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               392 drivers/mtd/nand/raw/nand_legacy.c 		column += mtd->writesize;
mtd               612 drivers/mtd/nand/raw/nand_legacy.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               615 drivers/mtd/nand/raw/nand_legacy.c 	if (mtd->writesize > 512 && chip->legacy.cmdfunc == nand_command)
mtd               100 drivers/mtd/nand/raw/nand_micron.c static int micron_nand_on_die_4_ooblayout_ecc(struct mtd_info *mtd,
mtd               113 drivers/mtd/nand/raw/nand_micron.c static int micron_nand_on_die_4_ooblayout_free(struct mtd_info *mtd,
mtd               131 drivers/mtd/nand/raw/nand_micron.c static int micron_nand_on_die_8_ooblayout_ecc(struct mtd_info *mtd,
mtd               135 drivers/mtd/nand/raw/nand_micron.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               140 drivers/mtd/nand/raw/nand_micron.c 	oobregion->offset = mtd->oobsize - chip->ecc.total;
mtd               146 drivers/mtd/nand/raw/nand_micron.c static int micron_nand_on_die_8_ooblayout_free(struct mtd_info *mtd,
mtd               150 drivers/mtd/nand/raw/nand_micron.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               156 drivers/mtd/nand/raw/nand_micron.c 	oobregion->length = mtd->oobsize - chip->ecc.total - 2;
mtd               193 drivers/mtd/nand/raw/nand_micron.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               199 drivers/mtd/nand/raw/nand_micron.c 			mtd->ecc_stats.failed++;
mtd               214 drivers/mtd/nand/raw/nand_micron.c 		ret = nand_read_data_op(chip, chip->oob_poi, mtd->oobsize,
mtd               223 drivers/mtd/nand/raw/nand_micron.c 				mtd->writesize + mtd->oobsize);
mtd               239 drivers/mtd/nand/raw/nand_micron.c 		rawbuf = micron->ecc.rawbuf + mtd->writesize + offs;
mtd               249 drivers/mtd/nand/raw/nand_micron.c 		mtd->ecc_stats.corrected += nbitflips;
mtd               257 drivers/mtd/nand/raw/nand_micron.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               265 drivers/mtd/nand/raw/nand_micron.c 		mtd->ecc_stats.failed++;
mtd               268 drivers/mtd/nand/raw/nand_micron.c 		mtd->ecc_stats.corrected += 3;
mtd               271 drivers/mtd/nand/raw/nand_micron.c 		mtd->ecc_stats.corrected += 6;
mtd               275 drivers/mtd/nand/raw/nand_micron.c 		mtd->ecc_stats.corrected += 8;
mtd               287 drivers/mtd/nand/raw/nand_micron.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               307 drivers/mtd/nand/raw/nand_micron.c 	ret = nand_read_data_op(chip, buf, mtd->writesize, false);
mtd               309 drivers/mtd/nand/raw/nand_micron.c 		ret = nand_read_data_op(chip, chip->oob_poi, mtd->oobsize,
mtd               434 drivers/mtd/nand/raw/nand_micron.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               451 drivers/mtd/nand/raw/nand_micron.c 	if (mtd->writesize == 2048)
mtd               484 drivers/mtd/nand/raw/nand_micron.c 			micron->ecc.rawbuf = kmalloc(mtd->writesize +
mtd               485 drivers/mtd/nand/raw/nand_micron.c 						     mtd->oobsize,
mtd               494 drivers/mtd/nand/raw/nand_micron.c 			mtd_set_ooblayout(mtd,
mtd               497 drivers/mtd/nand/raw/nand_micron.c 			mtd_set_ooblayout(mtd,
mtd               142 drivers/mtd/nand/raw/nand_onfi.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               228 drivers/mtd/nand/raw/nand_onfi.c 	mtd->writesize = memorg->pagesize;
mtd               237 drivers/mtd/nand/raw/nand_onfi.c 	mtd->erasesize = memorg->pages_per_eraseblock * memorg->pagesize;
mtd               240 drivers/mtd/nand/raw/nand_onfi.c 	mtd->oobsize = memorg->oobsize;
mtd                13 drivers/mtd/nand/raw/nand_samsung.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd                25 drivers/mtd/nand/raw/nand_samsung.c 		mtd->writesize = memorg->pagesize;
mtd                60 drivers/mtd/nand/raw/nand_samsung.c 		mtd->oobsize = memorg->oobsize;
mtd                68 drivers/mtd/nand/raw/nand_samsung.c 		mtd->erasesize = (128 * 1024) <<
mtd               119 drivers/mtd/nand/raw/nand_samsung.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               121 drivers/mtd/nand/raw/nand_samsung.c 	if (mtd->writesize > 512)
mtd                19 drivers/mtd/nand/raw/nand_toshiba.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd                31 drivers/mtd/nand/raw/nand_toshiba.c 		mtd->ecc_stats.failed++;
mtd                34 drivers/mtd/nand/raw/nand_toshiba.c 		max_bitflips = mtd->bitflip_threshold;
mtd                35 drivers/mtd/nand/raw/nand_toshiba.c 		mtd->ecc_stats.corrected += max_bitflips;
mtd                70 drivers/mtd/nand/raw/nand_toshiba.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd                89 drivers/mtd/nand/raw/nand_toshiba.c 	mtd_set_ooblayout(mtd, &nand_ooblayout_lp_ops);
mtd                94 drivers/mtd/nand/raw/nand_toshiba.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               113 drivers/mtd/nand/raw/nand_toshiba.c 		mtd->oobsize = memorg->oobsize;
mtd               623 drivers/mtd/nand/raw/nandsim.c static int __init init_nandsim(struct mtd_info *mtd)
mtd               625 drivers/mtd/nand/raw/nandsim.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               638 drivers/mtd/nand/raw/nandsim.c 	ns->geom.totsz    = mtd->size;
mtd               639 drivers/mtd/nand/raw/nandsim.c 	ns->geom.pgsz     = mtd->writesize;
mtd               640 drivers/mtd/nand/raw/nandsim.c 	ns->geom.oobsz    = mtd->oobsize;
mtd               641 drivers/mtd/nand/raw/nandsim.c 	ns->geom.secsz    = mtd->erasesize;
mtd               768 drivers/mtd/nand/raw/nandsim.c static int parse_badblocks(struct nandsim *ns, struct mtd_info *mtd)
mtd               786 drivers/mtd/nand/raw/nandsim.c 		if (mtd_block_markbad(mtd, offset)) {
mtd               967 drivers/mtd/nand/raw/nandsim.c static int setup_wear_reporting(struct mtd_info *mtd)
mtd               971 drivers/mtd/nand/raw/nandsim.c 	wear_eb_count = div_u64(mtd->size, mtd->erasesize);
mtd               137 drivers/mtd/nand/raw/ndfc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               158 drivers/mtd/nand/raw/ndfc.c 	mtd->dev.parent = &ndfc->ofdev->dev;
mtd               165 drivers/mtd/nand/raw/ndfc.c 	mtd->name = kasprintf(GFP_KERNEL, "%s.%pOFn", dev_name(&ndfc->ofdev->dev),
mtd               167 drivers/mtd/nand/raw/ndfc.c 	if (!mtd->name) {
mtd               176 drivers/mtd/nand/raw/ndfc.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd               181 drivers/mtd/nand/raw/ndfc.c 		kfree(mtd->name);
mtd               247 drivers/mtd/nand/raw/ndfc.c 	struct mtd_info *mtd = nand_to_mtd(&ndfc->chip);
mtd               250 drivers/mtd/nand/raw/ndfc.c 	kfree(mtd->name);
mtd               176 drivers/mtd/nand/raw/omap2.c static inline struct omap_nand_info *mtd_to_omap(struct mtd_info *mtd)
mtd               178 drivers/mtd/nand/raw/omap2.c 	return container_of(mtd_to_nand(mtd), struct omap_nand_info, nand);
mtd               271 drivers/mtd/nand/raw/omap2.c static void omap_read_buf8(struct mtd_info *mtd, u_char *buf, int len)
mtd               273 drivers/mtd/nand/raw/omap2.c 	struct nand_chip *nand = mtd_to_nand(mtd);
mtd               284 drivers/mtd/nand/raw/omap2.c static void omap_write_buf8(struct mtd_info *mtd, const u_char *buf, int len)
mtd               286 drivers/mtd/nand/raw/omap2.c 	struct omap_nand_info *info = mtd_to_omap(mtd);
mtd               305 drivers/mtd/nand/raw/omap2.c static void omap_read_buf16(struct mtd_info *mtd, u_char *buf, int len)
mtd               307 drivers/mtd/nand/raw/omap2.c 	struct nand_chip *nand = mtd_to_nand(mtd);
mtd               318 drivers/mtd/nand/raw/omap2.c static void omap_write_buf16(struct mtd_info *mtd, const u_char * buf, int len)
mtd               320 drivers/mtd/nand/raw/omap2.c 	struct omap_nand_info *info = mtd_to_omap(mtd);
mtd               343 drivers/mtd/nand/raw/omap2.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               344 drivers/mtd/nand/raw/omap2.c 	struct omap_nand_info *info = mtd_to_omap(mtd);
mtd               352 drivers/mtd/nand/raw/omap2.c 			omap_read_buf16(mtd, buf, len % 4);
mtd               354 drivers/mtd/nand/raw/omap2.c 			omap_read_buf8(mtd, buf, len % 4);
mtd               365 drivers/mtd/nand/raw/omap2.c 			omap_read_buf16(mtd, (u_char *)p, len);
mtd               367 drivers/mtd/nand/raw/omap2.c 			omap_read_buf8(mtd, (u_char *)p, len);
mtd               391 drivers/mtd/nand/raw/omap2.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               392 drivers/mtd/nand/raw/omap2.c 	struct omap_nand_info *info = mtd_to_omap(mtd);
mtd               412 drivers/mtd/nand/raw/omap2.c 			omap_write_buf16(mtd, (u_char *)p, len);
mtd               414 drivers/mtd/nand/raw/omap2.c 			omap_write_buf8(mtd, (u_char *)p, len);
mtd               454 drivers/mtd/nand/raw/omap2.c static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
mtd               457 drivers/mtd/nand/raw/omap2.c 	struct omap_nand_info *info = mtd_to_omap(mtd);
mtd               520 drivers/mtd/nand/raw/omap2.c 		is_write == 0 ? omap_read_buf16(mtd, (u_char *) addr, len)
mtd               521 drivers/mtd/nand/raw/omap2.c 			: omap_write_buf16(mtd, (u_char *) addr, len);
mtd               523 drivers/mtd/nand/raw/omap2.c 		is_write == 0 ? omap_read_buf8(mtd, (u_char *) addr, len)
mtd               524 drivers/mtd/nand/raw/omap2.c 			: omap_write_buf8(mtd, (u_char *) addr, len);
mtd               537 drivers/mtd/nand/raw/omap2.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               539 drivers/mtd/nand/raw/omap2.c 	if (len <= mtd->oobsize)
mtd               543 drivers/mtd/nand/raw/omap2.c 		omap_nand_dma_transfer(mtd, buf, len, 0x0);
mtd               555 drivers/mtd/nand/raw/omap2.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               557 drivers/mtd/nand/raw/omap2.c 	if (len <= mtd->oobsize)
mtd               561 drivers/mtd/nand/raw/omap2.c 		omap_nand_dma_transfer(mtd, (u_char *)buf, len, 0x1);
mtd               619 drivers/mtd/nand/raw/omap2.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               620 drivers/mtd/nand/raw/omap2.c 	struct omap_nand_info *info = mtd_to_omap(mtd);
mtd               623 drivers/mtd/nand/raw/omap2.c 	if (len <= mtd->oobsize) {
mtd               653 drivers/mtd/nand/raw/omap2.c 		omap_read_buf16(mtd, buf, len);
mtd               655 drivers/mtd/nand/raw/omap2.c 		omap_read_buf8(mtd, buf, len);
mtd               667 drivers/mtd/nand/raw/omap2.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               668 drivers/mtd/nand/raw/omap2.c 	struct omap_nand_info *info = mtd_to_omap(mtd);
mtd               673 drivers/mtd/nand/raw/omap2.c 	if (len <= mtd->oobsize) {
mtd               712 drivers/mtd/nand/raw/omap2.c 		omap_write_buf16(mtd, buf, len);
mtd               714 drivers/mtd/nand/raw/omap2.c 		omap_write_buf8(mtd, buf, len);
mtd              1140 drivers/mtd/nand/raw/omap2.c static int _omap_calculate_ecc_bch(struct mtd_info *mtd,
mtd              1143 drivers/mtd/nand/raw/omap2.c 	struct omap_nand_info *info = mtd_to_omap(mtd);
mtd              1282 drivers/mtd/nand/raw/omap2.c static int omap_calculate_ecc_bch_multi(struct mtd_info *mtd,
mtd              1285 drivers/mtd/nand/raw/omap2.c 	struct omap_nand_info *info = mtd_to_omap(mtd);
mtd              1292 drivers/mtd/nand/raw/omap2.c 		ret = _omap_calculate_ecc_bch(mtd, dat, ecc_calc, i);
mtd              1526 drivers/mtd/nand/raw/omap2.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1536 drivers/mtd/nand/raw/omap2.c 	chip->legacy.write_buf(chip, buf, mtd->writesize);
mtd              1539 drivers/mtd/nand/raw/omap2.c 	omap_calculate_ecc_bch_multi(mtd, buf, &ecc_calc[0]);
mtd              1541 drivers/mtd/nand/raw/omap2.c 	ret = mtd_ooblayout_set_eccbytes(mtd, ecc_calc, chip->oob_poi, 0,
mtd              1547 drivers/mtd/nand/raw/omap2.c 	chip->legacy.write_buf(chip, chip->oob_poi, mtd->oobsize);
mtd              1567 drivers/mtd/nand/raw/omap2.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1588 drivers/mtd/nand/raw/omap2.c 	chip->legacy.write_buf(chip, buf, mtd->writesize);
mtd              1595 drivers/mtd/nand/raw/omap2.c 			ret = _omap_calculate_ecc_bch(mtd, buf, ecc_calc, step);
mtd              1607 drivers/mtd/nand/raw/omap2.c 	ret = mtd_ooblayout_set_eccbytes(mtd, ecc_calc, chip->oob_poi, 0,
mtd              1613 drivers/mtd/nand/raw/omap2.c 	chip->legacy.write_buf(chip, chip->oob_poi, mtd->oobsize);
mtd              1635 drivers/mtd/nand/raw/omap2.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1647 drivers/mtd/nand/raw/omap2.c 	chip->legacy.read_buf(chip, buf, mtd->writesize);
mtd              1651 drivers/mtd/nand/raw/omap2.c 				   mtd->writesize + BADBLOCK_MARKER_LENGTH,
mtd              1656 drivers/mtd/nand/raw/omap2.c 	omap_calculate_ecc_bch_multi(mtd, buf, ecc_calc);
mtd              1658 drivers/mtd/nand/raw/omap2.c 	ret = mtd_ooblayout_get_eccbytes(mtd, ecc_code, chip->oob_poi, 0,
mtd              1666 drivers/mtd/nand/raw/omap2.c 		mtd->ecc_stats.failed++;
mtd              1668 drivers/mtd/nand/raw/omap2.c 		mtd->ecc_stats.corrected += stat;
mtd              1816 drivers/mtd/nand/raw/omap2.c static int omap_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd              1819 drivers/mtd/nand/raw/omap2.c 	struct omap_nand_info *info = mtd_to_omap(mtd);
mtd              1836 drivers/mtd/nand/raw/omap2.c static int omap_ooblayout_free(struct mtd_info *mtd, int section,
mtd              1839 drivers/mtd/nand/raw/omap2.c 	struct omap_nand_info *info = mtd_to_omap(mtd);
mtd              1851 drivers/mtd/nand/raw/omap2.c 	if (off >= mtd->oobsize)
mtd              1855 drivers/mtd/nand/raw/omap2.c 	oobregion->length = mtd->oobsize - off;
mtd              1865 drivers/mtd/nand/raw/omap2.c static int omap_sw_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd              1868 drivers/mtd/nand/raw/omap2.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              1884 drivers/mtd/nand/raw/omap2.c static int omap_sw_ooblayout_free(struct mtd_info *mtd, int section,
mtd              1887 drivers/mtd/nand/raw/omap2.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              1898 drivers/mtd/nand/raw/omap2.c 	if (off >= mtd->oobsize)
mtd              1902 drivers/mtd/nand/raw/omap2.c 	oobregion->length = mtd->oobsize - off;
mtd              1914 drivers/mtd/nand/raw/omap2.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1915 drivers/mtd/nand/raw/omap2.c 	struct omap_nand_info *info = mtd_to_omap(mtd);
mtd              2033 drivers/mtd/nand/raw/omap2.c 		mtd_set_ooblayout(mtd, &omap_ooblayout_ops);
mtd              2050 drivers/mtd/nand/raw/omap2.c 		mtd_set_ooblayout(mtd, &omap_sw_ooblayout_ops);
mtd              2054 drivers/mtd/nand/raw/omap2.c 		chip->ecc.priv		= nand_bch_init(mtd);
mtd              2073 drivers/mtd/nand/raw/omap2.c 		mtd_set_ooblayout(mtd, &omap_ooblayout_ops);
mtd              2077 drivers/mtd/nand/raw/omap2.c 				 mtd->writesize / chip->ecc.size,
mtd              2092 drivers/mtd/nand/raw/omap2.c 		mtd_set_ooblayout(mtd, &omap_sw_ooblayout_ops);
mtd              2096 drivers/mtd/nand/raw/omap2.c 		chip->ecc.priv		= nand_bch_init(mtd);
mtd              2115 drivers/mtd/nand/raw/omap2.c 		mtd_set_ooblayout(mtd, &omap_ooblayout_ops);
mtd              2119 drivers/mtd/nand/raw/omap2.c 				 mtd->writesize / chip->ecc.size,
mtd              2137 drivers/mtd/nand/raw/omap2.c 		mtd_set_ooblayout(mtd, &omap_ooblayout_ops);
mtd              2141 drivers/mtd/nand/raw/omap2.c 				 mtd->writesize / chip->ecc.size,
mtd              2154 drivers/mtd/nand/raw/omap2.c 			 (mtd->writesize / chip->ecc.size));
mtd              2155 drivers/mtd/nand/raw/omap2.c 	if (mtd->oobsize < min_oobbytes) {
mtd              2158 drivers/mtd/nand/raw/omap2.c 			min_oobbytes, mtd->oobsize);
mtd              2176 drivers/mtd/nand/raw/omap2.c 	struct mtd_info			*mtd;
mtd              2200 drivers/mtd/nand/raw/omap2.c 	mtd			= nand_to_mtd(nand_chip);
mtd              2201 drivers/mtd/nand/raw/omap2.c 	mtd->dev.parent		= &pdev->dev;
mtd              2205 drivers/mtd/nand/raw/omap2.c 	if (!mtd->name) {
mtd              2206 drivers/mtd/nand/raw/omap2.c 		mtd->name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
mtd              2208 drivers/mtd/nand/raw/omap2.c 		if (!mtd->name) {
mtd              2264 drivers/mtd/nand/raw/omap2.c 	err = mtd_device_register(mtd, NULL, 0);
mtd              2268 drivers/mtd/nand/raw/omap2.c 	platform_set_drvdata(pdev, mtd);
mtd              2287 drivers/mtd/nand/raw/omap2.c 	struct mtd_info *mtd = platform_get_drvdata(pdev);
mtd              2288 drivers/mtd/nand/raw/omap2.c 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
mtd              2289 drivers/mtd/nand/raw/omap2.c 	struct omap_nand_info *info = mtd_to_omap(mtd);
mtd                88 drivers/mtd/nand/raw/orion_nand.c 	struct mtd_info *mtd;
mtd               102 drivers/mtd/nand/raw/orion_nand.c 	mtd = nand_to_mtd(nc);
mtd               135 drivers/mtd/nand/raw/orion_nand.c 	mtd->dev.parent = &pdev->dev;
mtd               180 drivers/mtd/nand/raw/orion_nand.c 	mtd->name = "orion_nand";
mtd               181 drivers/mtd/nand/raw/orion_nand.c 	ret = mtd_device_register(mtd, board->parts, board->nr_parts);
mtd                80 drivers/mtd/nand/raw/oxnas_nand.c 	struct mtd_info *mtd;
mtd               127 drivers/mtd/nand/raw/oxnas_nand.c 		mtd = nand_to_mtd(chip);
mtd               128 drivers/mtd/nand/raw/oxnas_nand.c 		mtd->dev.parent = &pdev->dev;
mtd               129 drivers/mtd/nand/raw/oxnas_nand.c 		mtd->priv = chip;
mtd               142 drivers/mtd/nand/raw/oxnas_nand.c 		err = mtd_device_register(mtd, NULL, 0);
mtd                28 drivers/mtd/nand/raw/plat_nand.c 	struct mtd_info *mtd;
mtd                55 drivers/mtd/nand/raw/plat_nand.c 	mtd = nand_to_mtd(&data->chip);
mtd                56 drivers/mtd/nand/raw/plat_nand.c 	mtd->dev.parent = &pdev->dev;
mtd                88 drivers/mtd/nand/raw/plat_nand.c 	err = mtd_device_parse_register(mtd, part_types, NULL,
mtd              1583 drivers/mtd/nand/raw/qcom_nandc.c qcom_nandc_read_cw_raw(struct mtd_info *mtd, struct nand_chip *chip,
mtd              1600 drivers/mtd/nand/raw/qcom_nandc.c 	data_size1 = mtd->writesize - host->cw_size * (ecc->steps - 1);
mtd              1670 drivers/mtd/nand/raw/qcom_nandc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1696 drivers/mtd/nand/raw/qcom_nandc.c 		ret = qcom_nandc_read_cw_raw(mtd, chip, cw_data_buf,
mtd              1710 drivers/mtd/nand/raw/qcom_nandc.c 			mtd->ecc_stats.failed++;
mtd              1712 drivers/mtd/nand/raw/qcom_nandc.c 			mtd->ecc_stats.corrected += ret;
mtd              1729 drivers/mtd/nand/raw/qcom_nandc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1803 drivers/mtd/nand/raw/qcom_nandc.c 			mtd->ecc_stats.corrected += stat;
mtd              1961 drivers/mtd/nand/raw/qcom_nandc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1968 drivers/mtd/nand/raw/qcom_nandc.c 		ret = qcom_nandc_read_cw_raw(mtd, chip, data_buf, oob_buf,
mtd              2072 drivers/mtd/nand/raw/qcom_nandc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2094 drivers/mtd/nand/raw/qcom_nandc.c 		data_size1 = mtd->writesize - host->cw_size * (ecc->steps - 1);
mtd              2149 drivers/mtd/nand/raw/qcom_nandc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2162 drivers/mtd/nand/raw/qcom_nandc.c 	oob_size = mtd->oobavail;
mtd              2166 drivers/mtd/nand/raw/qcom_nandc.c 	mtd_ooblayout_get_databytes(mtd, nandc->data_buffer + data_size, oob,
mtd              2167 drivers/mtd/nand/raw/qcom_nandc.c 				    0, mtd->oobavail);
mtd              2191 drivers/mtd/nand/raw/qcom_nandc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2217 drivers/mtd/nand/raw/qcom_nandc.c 	bbpos = mtd->writesize - host->cw_size * (ecc->steps - 1);
mtd              2411 drivers/mtd/nand/raw/qcom_nandc.c static int qcom_nand_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd              2414 drivers/mtd/nand/raw/qcom_nandc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              2427 drivers/mtd/nand/raw/qcom_nandc.c 		oobregion->offset = mtd->oobsize - oobregion->length;
mtd              2433 drivers/mtd/nand/raw/qcom_nandc.c static int qcom_nand_ooblayout_free(struct mtd_info *mtd, int section,
mtd              2436 drivers/mtd/nand/raw/qcom_nandc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              2464 drivers/mtd/nand/raw/qcom_nandc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2475 drivers/mtd/nand/raw/qcom_nandc.c 	cwperpage = mtd->writesize / NANDC_STEP_SIZE;
mtd              2482 drivers/mtd/nand/raw/qcom_nandc.c 				   mtd->oobsize - (cwperpage * 4));
mtd              2553 drivers/mtd/nand/raw/qcom_nandc.c 	mtd_set_ooblayout(mtd, &qcom_nand_ooblayout_ops);
mtd              2570 drivers/mtd/nand/raw/qcom_nandc.c 	bad_block_byte = mtd->writesize - host->cw_size * (cwperpage - 1) + 1;
mtd              2778 drivers/mtd/nand/raw/qcom_nandc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              2789 drivers/mtd/nand/raw/qcom_nandc.c 	mtd->name = devm_kasprintf(dev, GFP_KERNEL, "qcom_nand.%d", host->cs);
mtd              2790 drivers/mtd/nand/raw/qcom_nandc.c 	if (!mtd->name)
mtd              2793 drivers/mtd/nand/raw/qcom_nandc.c 	mtd->owner = THIS_MODULE;
mtd              2794 drivers/mtd/nand/raw/qcom_nandc.c 	mtd->dev.parent = dev;
mtd              2836 drivers/mtd/nand/raw/qcom_nandc.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd                63 drivers/mtd/nand/raw/r852.c static inline struct r852_device *r852_get_dev(struct mtd_info *mtd)
mtd                65 drivers/mtd/nand/raw/r852.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               520 drivers/mtd/nand/raw/r852.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               522 drivers/mtd/nand/raw/r852.c 	return nand_read_oob_op(chip, page, 0, chip->oob_poi, mtd->oobsize);
mtd               589 drivers/mtd/nand/raw/r852.c 	struct mtd_info *mtd = container_of(sys_dev, struct mtd_info, dev);
mtd               590 drivers/mtd/nand/raw/r852.c 	struct r852_device *dev = r852_get_dev(mtd);
mtd               632 drivers/mtd/nand/raw/r852.c 	struct mtd_info *mtd = nand_to_mtd(dev->chip);
mtd               636 drivers/mtd/nand/raw/r852.c 	mtd->dev.parent = &dev->pci_dev->dev;
mtd               643 drivers/mtd/nand/raw/r852.c 	if (sm_register_device(mtd, dev->sm))
mtd               646 drivers/mtd/nand/raw/r852.c 	if (device_create_file(&mtd->dev, &dev_attr_media_type)) {
mtd               667 drivers/mtd/nand/raw/r852.c 	struct mtd_info *mtd = nand_to_mtd(dev->chip);
mtd               672 drivers/mtd/nand/raw/r852.c 	device_remove_file(&mtd->dev, &dev_attr_media_type);
mtd                75 drivers/mtd/nand/raw/s3c2410.c static int s3c2410_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd                87 drivers/mtd/nand/raw/s3c2410.c static int s3c2410_ooblayout_free(struct mtd_info *mtd, int section,
mtd               192 drivers/mtd/nand/raw/s3c2410.c static struct s3c2410_nand_mtd *s3c2410_nand_mtd_toours(struct mtd_info *mtd)
mtd               194 drivers/mtd/nand/raw/s3c2410.c 	return container_of(mtd_to_nand(mtd), struct s3c2410_nand_mtd,
mtd               198 drivers/mtd/nand/raw/s3c2410.c static struct s3c2410_nand_info *s3c2410_nand_mtd_toinfo(struct mtd_info *mtd)
mtd               200 drivers/mtd/nand/raw/s3c2410.c 	return s3c2410_nand_mtd_toours(mtd)->info;
mtd               449 drivers/mtd/nand/raw/s3c2410.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               450 drivers/mtd/nand/raw/s3c2410.c 	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
mtd               466 drivers/mtd/nand/raw/s3c2410.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               467 drivers/mtd/nand/raw/s3c2410.c 	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
mtd               485 drivers/mtd/nand/raw/s3c2410.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               486 drivers/mtd/nand/raw/s3c2410.c 	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
mtd               492 drivers/mtd/nand/raw/s3c2410.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               493 drivers/mtd/nand/raw/s3c2410.c 	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
mtd               499 drivers/mtd/nand/raw/s3c2410.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               500 drivers/mtd/nand/raw/s3c2410.c 	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
mtd               509 drivers/mtd/nand/raw/s3c2410.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               510 drivers/mtd/nand/raw/s3c2410.c 	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
mtd               514 drivers/mtd/nand/raw/s3c2410.c 	pr_debug("%s(%p,%p,%p,%p)\n", __func__, mtd, dat, read_ecc, calc_ecc);
mtd               621 drivers/mtd/nand/raw/s3c2410.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               622 drivers/mtd/nand/raw/s3c2410.c 	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
mtd               636 drivers/mtd/nand/raw/s3c2410.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               637 drivers/mtd/nand/raw/s3c2410.c 	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
mtd               652 drivers/mtd/nand/raw/s3c2410.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               653 drivers/mtd/nand/raw/s3c2410.c 	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
mtd               676 drivers/mtd/nand/raw/s3c2410.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               677 drivers/mtd/nand/raw/s3c2410.c 	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
mtd               699 drivers/mtd/nand/raw/s3c2410.c 	struct mtd_info *mtd = nand_to_mtd(this);
mtd               700 drivers/mtd/nand/raw/s3c2410.c 	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
mtd               795 drivers/mtd/nand/raw/s3c2410.c 				      struct s3c2410_nand_mtd *mtd,
mtd               799 drivers/mtd/nand/raw/s3c2410.c 		struct mtd_info *mtdinfo = nand_to_mtd(&mtd->chip);
mtd               813 drivers/mtd/nand/raw/s3c2410.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               814 drivers/mtd/nand/raw/s3c2410.c 	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
mtd               928 drivers/mtd/nand/raw/s3c2410.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               929 drivers/mtd/nand/raw/s3c2410.c 	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
mtd              1165 drivers/mtd/nand/raw/s3c2410.c 		struct mtd_info *mtd = nand_to_mtd(&nmtd->chip);
mtd              1170 drivers/mtd/nand/raw/s3c2410.c 		mtd->dev.parent = &pdev->dev;
mtd                32 drivers/mtd/nand/raw/sh_flctl.c static int flctl_4secc_ooblayout_sp_ecc(struct mtd_info *mtd, int section,
mtd                35 drivers/mtd/nand/raw/sh_flctl.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd                46 drivers/mtd/nand/raw/sh_flctl.c static int flctl_4secc_ooblayout_sp_free(struct mtd_info *mtd, int section,
mtd                63 drivers/mtd/nand/raw/sh_flctl.c static int flctl_4secc_ooblayout_lp_ecc(struct mtd_info *mtd, int section,
mtd                66 drivers/mtd/nand/raw/sh_flctl.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd                77 drivers/mtd/nand/raw/sh_flctl.c static int flctl_4secc_ooblayout_lp_free(struct mtd_info *mtd, int section,
mtd                80 drivers/mtd/nand/raw/sh_flctl.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               223 drivers/mtd/nand/raw/sh_flctl.c static void set_addr(struct mtd_info *mtd, int column, int page_addr)
mtd               225 drivers/mtd/nand/raw/sh_flctl.c 	struct sh_flctl *flctl = mtd_to_flctl(mtd);
mtd               537 drivers/mtd/nand/raw/sh_flctl.c static void set_cmd_regs(struct mtd_info *mtd, uint32_t cmd, uint32_t flcmcdr_val)
mtd               539 drivers/mtd/nand/raw/sh_flctl.c 	struct sh_flctl *flctl = mtd_to_flctl(mtd);
mtd               602 drivers/mtd/nand/raw/sh_flctl.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               604 drivers/mtd/nand/raw/sh_flctl.c 	nand_read_page_op(chip, page, 0, buf, mtd->writesize);
mtd               606 drivers/mtd/nand/raw/sh_flctl.c 		chip->legacy.read_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               613 drivers/mtd/nand/raw/sh_flctl.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               615 drivers/mtd/nand/raw/sh_flctl.c 	nand_prog_page_begin_op(chip, page, 0, buf, mtd->writesize);
mtd               616 drivers/mtd/nand/raw/sh_flctl.c 	chip->legacy.write_buf(chip, chip->oob_poi, mtd->oobsize);
mtd               620 drivers/mtd/nand/raw/sh_flctl.c static void execmd_read_page_sector(struct mtd_info *mtd, int page_addr)
mtd               622 drivers/mtd/nand/raw/sh_flctl.c 	struct sh_flctl *flctl = mtd_to_flctl(mtd);
mtd               628 drivers/mtd/nand/raw/sh_flctl.c 	set_cmd_regs(mtd, NAND_CMD_READ0,
mtd               643 drivers/mtd/nand/raw/sh_flctl.c 			&flctl->done_buff[mtd->writesize + 16 * sector],
mtd               650 drivers/mtd/nand/raw/sh_flctl.c 			mtd->ecc_stats.corrected++;
mtd               656 drivers/mtd/nand/raw/sh_flctl.c 			mtd->ecc_stats.failed++;
mtd               669 drivers/mtd/nand/raw/sh_flctl.c static void execmd_read_oob(struct mtd_info *mtd, int page_addr)
mtd               671 drivers/mtd/nand/raw/sh_flctl.c 	struct sh_flctl *flctl = mtd_to_flctl(mtd);
mtd               675 drivers/mtd/nand/raw/sh_flctl.c 	set_cmd_regs(mtd, NAND_CMD_READ0,
mtd               681 drivers/mtd/nand/raw/sh_flctl.c 		set_addr(mtd, (512 + 16) * i + 512 , page_addr);
mtd               690 drivers/mtd/nand/raw/sh_flctl.c static void execmd_write_page_sector(struct mtd_info *mtd)
mtd               692 drivers/mtd/nand/raw/sh_flctl.c 	struct sh_flctl *flctl = mtd_to_flctl(mtd);
mtd               698 drivers/mtd/nand/raw/sh_flctl.c 	set_cmd_regs(mtd, NAND_CMD_PAGEPROG,
mtd               709 drivers/mtd/nand/raw/sh_flctl.c 		write_ec_fiforeg(flctl, 16, mtd->writesize + 16 * sector);
mtd               716 drivers/mtd/nand/raw/sh_flctl.c static void execmd_write_oob(struct mtd_info *mtd)
mtd               718 drivers/mtd/nand/raw/sh_flctl.c 	struct sh_flctl *flctl = mtd_to_flctl(mtd);
mtd               724 drivers/mtd/nand/raw/sh_flctl.c 	set_cmd_regs(mtd, NAND_CMD_PAGEPROG,
mtd               729 drivers/mtd/nand/raw/sh_flctl.c 		set_addr(mtd, sector * 528 + 512, page_addr);
mtd               741 drivers/mtd/nand/raw/sh_flctl.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               742 drivers/mtd/nand/raw/sh_flctl.c 	struct sh_flctl *flctl = mtd_to_flctl(mtd);
mtd               756 drivers/mtd/nand/raw/sh_flctl.c 			execmd_read_page_sector(mtd, page_addr);
mtd               760 drivers/mtd/nand/raw/sh_flctl.c 			set_cmd_regs(mtd, command, (NAND_CMD_READSTART << 8)
mtd               763 drivers/mtd/nand/raw/sh_flctl.c 			set_cmd_regs(mtd, command, command);
mtd               765 drivers/mtd/nand/raw/sh_flctl.c 		set_addr(mtd, 0, page_addr);
mtd               767 drivers/mtd/nand/raw/sh_flctl.c 		flctl->read_bytes = mtd->writesize + mtd->oobsize;
mtd               776 drivers/mtd/nand/raw/sh_flctl.c 			execmd_read_oob(mtd, page_addr);
mtd               781 drivers/mtd/nand/raw/sh_flctl.c 			set_cmd_regs(mtd, command, (NAND_CMD_READSTART << 8)
mtd               783 drivers/mtd/nand/raw/sh_flctl.c 			set_addr(mtd, mtd->writesize, page_addr);
mtd               785 drivers/mtd/nand/raw/sh_flctl.c 			set_cmd_regs(mtd, command, command);
mtd               786 drivers/mtd/nand/raw/sh_flctl.c 			set_addr(mtd, 0, page_addr);
mtd               788 drivers/mtd/nand/raw/sh_flctl.c 		flctl->read_bytes = mtd->oobsize;
mtd               796 drivers/mtd/nand/raw/sh_flctl.c 			set_cmd_regs(mtd, command, (NAND_CMD_RNDOUTSTART << 8)
mtd               799 drivers/mtd/nand/raw/sh_flctl.c 			set_cmd_regs(mtd, command, command);
mtd               801 drivers/mtd/nand/raw/sh_flctl.c 		set_addr(mtd, column, 0);
mtd               803 drivers/mtd/nand/raw/sh_flctl.c 		flctl->read_bytes = mtd->writesize + mtd->oobsize - column;
mtd               807 drivers/mtd/nand/raw/sh_flctl.c 		set_cmd_regs(mtd, command, command);
mtd               812 drivers/mtd/nand/raw/sh_flctl.c 		set_addr(mtd, column, 0);
mtd               827 drivers/mtd/nand/raw/sh_flctl.c 		set_cmd_regs(mtd, NAND_CMD_ERASE1,
mtd               829 drivers/mtd/nand/raw/sh_flctl.c 		set_addr(mtd, -1, flctl->erase1_page_addr);
mtd               837 drivers/mtd/nand/raw/sh_flctl.c 			if (column >= mtd->writesize) {
mtd               838 drivers/mtd/nand/raw/sh_flctl.c 				column -= mtd->writesize;
mtd               855 drivers/mtd/nand/raw/sh_flctl.c 			set_cmd_regs(mtd, NAND_CMD_SEQIN,
mtd               857 drivers/mtd/nand/raw/sh_flctl.c 			set_addr(mtd, -1, -1);
mtd               864 drivers/mtd/nand/raw/sh_flctl.c 			if (flctl->seqin_column == mtd->writesize)
mtd               865 drivers/mtd/nand/raw/sh_flctl.c 				execmd_write_oob(mtd);
mtd               867 drivers/mtd/nand/raw/sh_flctl.c 				execmd_write_page_sector(mtd);
mtd               872 drivers/mtd/nand/raw/sh_flctl.c 		set_cmd_regs(mtd, command, (command << 8) | NAND_CMD_SEQIN);
mtd               873 drivers/mtd/nand/raw/sh_flctl.c 		set_addr(mtd, flctl->seqin_column, flctl->seqin_page_addr);
mtd               881 drivers/mtd/nand/raw/sh_flctl.c 		set_cmd_regs(mtd, command, command);
mtd               882 drivers/mtd/nand/raw/sh_flctl.c 		set_addr(mtd, -1, -1);
mtd               891 drivers/mtd/nand/raw/sh_flctl.c 		set_cmd_regs(mtd, command, command);
mtd               892 drivers/mtd/nand/raw/sh_flctl.c 		set_addr(mtd, -1, -1);
mtd               988 drivers/mtd/nand/raw/sh_flctl.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               989 drivers/mtd/nand/raw/sh_flctl.c 	struct sh_flctl *flctl = mtd_to_flctl(mtd);
mtd               998 drivers/mtd/nand/raw/sh_flctl.c 	if (mtd->writesize == 512) {
mtd              1029 drivers/mtd/nand/raw/sh_flctl.c 		if (mtd->writesize == 512) {
mtd              1030 drivers/mtd/nand/raw/sh_flctl.c 			mtd_set_ooblayout(mtd, &flctl_4secc_oob_smallpage_ops);
mtd              1033 drivers/mtd/nand/raw/sh_flctl.c 			mtd_set_ooblayout(mtd, &flctl_4secc_oob_largepage_ops);
mtd                28 drivers/mtd/nand/raw/sharpsl.c static inline struct sharpsl_nand *mtd_to_sharpsl(struct mtd_info *mtd)
mtd                30 drivers/mtd/nand/raw/sharpsl.c 	return container_of(mtd_to_nand(mtd), struct sharpsl_nand, chip);
mtd               105 drivers/mtd/nand/raw/sharpsl.c 	struct mtd_info *mtd;
mtd               140 drivers/mtd/nand/raw/sharpsl.c 	mtd = nand_to_mtd(this);
mtd               141 drivers/mtd/nand/raw/sharpsl.c 	mtd->dev.parent = &pdev->dev;
mtd               142 drivers/mtd/nand/raw/sharpsl.c 	mtd_set_ooblayout(mtd, data->ecc_layout);
mtd               175 drivers/mtd/nand/raw/sharpsl.c 	mtd->name = "sharpsl-nand";
mtd               177 drivers/mtd/nand/raw/sharpsl.c 	err = mtd_device_parse_register(mtd, data->part_parsers, NULL,
mtd                12 drivers/mtd/nand/raw/sm_common.c static int oob_sm_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd                24 drivers/mtd/nand/raw/sm_common.c static int oob_sm_ooblayout_free(struct mtd_info *mtd, int section,
mtd                61 drivers/mtd/nand/raw/sm_common.c static int oob_sm_small_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd                73 drivers/mtd/nand/raw/sm_common.c static int oob_sm_small_ooblayout_free(struct mtd_info *mtd, int section,
mtd               101 drivers/mtd/nand/raw/sm_common.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               113 drivers/mtd/nand/raw/sm_common.c 	ops.ooblen = mtd->oobsize;
mtd               118 drivers/mtd/nand/raw/sm_common.c 	ret = mtd_write_oob(mtd, ofs, &ops);
mtd               163 drivers/mtd/nand/raw/sm_common.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               171 drivers/mtd/nand/raw/sm_common.c 	if (mtd->writesize == SM_SECTOR_SIZE)
mtd               172 drivers/mtd/nand/raw/sm_common.c 		mtd_set_ooblayout(mtd, &oob_sm_ops);
mtd               173 drivers/mtd/nand/raw/sm_common.c 	else if (mtd->writesize == SM_SMALL_PAGE)
mtd               174 drivers/mtd/nand/raw/sm_common.c 		mtd_set_ooblayout(mtd, &oob_sm_small_ops);
mtd               185 drivers/mtd/nand/raw/sm_common.c int sm_register_device(struct mtd_info *mtd, int smartmedia)
mtd               187 drivers/mtd/nand/raw/sm_common.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               200 drivers/mtd/nand/raw/sm_common.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd                36 drivers/mtd/nand/raw/sm_common.h int sm_register_device(struct mtd_info *mtd, int smartmedia);
mtd               125 drivers/mtd/nand/raw/socrates_nand.c 	struct mtd_info *mtd;
mtd               141 drivers/mtd/nand/raw/socrates_nand.c 	mtd = nand_to_mtd(nand_chip);
mtd               147 drivers/mtd/nand/raw/socrates_nand.c 	mtd->name = "socrates_nand";
mtd               148 drivers/mtd/nand/raw/socrates_nand.c 	mtd->dev.parent = &ofdev->dev;
mtd               168 drivers/mtd/nand/raw/socrates_nand.c 	res = mtd_device_register(mtd, NULL, 0);
mtd               732 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               746 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	for (i = mtd->writesize + FMC2_BBM_LEN, s = 0; s < eccsteps;
mtd               772 drivers/mtd/nand/raw/stm32_fmc2_nand.c 			mtd->ecc_stats.failed++;
mtd               774 drivers/mtd/nand/raw/stm32_fmc2_nand.c 			mtd->ecc_stats.corrected += stat;
mtd               781 drivers/mtd/nand/raw/stm32_fmc2_nand.c 		ret = nand_change_read_column_op(chip, mtd->writesize,
mtd               782 drivers/mtd/nand/raw/stm32_fmc2_nand.c 						 chip->oob_poi, mtd->oobsize,
mtd               796 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               799 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	u32 ecc_offset = mtd->writesize + FMC2_BBM_LEN;
mtd              1027 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1040 drivers/mtd/nand/raw/stm32_fmc2_nand.c 		ret = nand_change_write_column_op(chip, mtd->writesize,
mtd              1041 drivers/mtd/nand/raw/stm32_fmc2_nand.c 						  chip->oob_poi, mtd->oobsize,
mtd              1091 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1136 drivers/mtd/nand/raw/stm32_fmc2_nand.c 			mtd->ecc_stats.failed++;
mtd              1138 drivers/mtd/nand/raw/stm32_fmc2_nand.c 			mtd->ecc_stats.corrected += stat;
mtd              1149 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1174 drivers/mtd/nand/raw/stm32_fmc2_nand.c 			return nand_change_read_column_op(chip, mtd->writesize,
mtd              1176 drivers/mtd/nand/raw/stm32_fmc2_nand.c 							  mtd->oobsize, false);
mtd              1182 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	ret = nand_change_read_column_op(chip, mtd->writesize,
mtd              1183 drivers/mtd/nand/raw/stm32_fmc2_nand.c 					 chip->oob_poi, mtd->oobsize, false);
mtd              1187 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	ret = mtd_ooblayout_get_eccbytes(mtd, ecc_code, chip->oob_poi, 0,
mtd              1199 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1217 drivers/mtd/nand/raw/stm32_fmc2_nand.c 		return nand_change_read_column_op(chip, mtd->writesize,
mtd              1218 drivers/mtd/nand/raw/stm32_fmc2_nand.c 						  chip->oob_poi, mtd->oobsize,
mtd              1682 drivers/mtd/nand/raw/stm32_fmc2_nand.c static int stm32_fmc2_nand_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd              1685 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              1697 drivers/mtd/nand/raw/stm32_fmc2_nand.c static int stm32_fmc2_nand_ooblayout_free(struct mtd_info *mtd, int section,
mtd              1700 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd              1706 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	oobregion->length = mtd->oobsize - ecc->total - FMC2_BBM_LEN;
mtd              1740 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1756 drivers/mtd/nand/raw/stm32_fmc2_nand.c 				   mtd->oobsize - FMC2_BBM_LEN);
mtd              1762 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	if (mtd->writesize / chip->ecc.size > FMC2_MAX_SG) {
mtd              1774 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	mtd_set_ooblayout(mtd, &stm32_fmc2_nand_ooblayout_ops);
mtd              1868 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	struct mtd_info *mtd;
mtd              1958 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	mtd = nand_to_mtd(chip);
mtd              1959 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	mtd->dev.parent = dev;
mtd              1975 drivers/mtd/nand/raw/stm32_fmc2_nand.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd               407 drivers/mtd/nand/raw/sunxi_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               424 drivers/mtd/nand/raw/sunxi_nand.c 	writel(mtd->writesize, nfc->regs + NFC_REG_SPARE_AREA);
mtd               595 drivers/mtd/nand/raw/sunxi_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               597 drivers/mtd/nand/raw/sunxi_nand.c 	int mod = mtd_div_by_ws(mtd->erasesize, mtd);
mtd               603 drivers/mtd/nand/raw/sunxi_nand.c 		if (mtd->ecc_step_size == 512)
mtd               750 drivers/mtd/nand/raw/sunxi_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               753 drivers/mtd/nand/raw/sunxi_nand.c 		mtd->ecc_stats.failed++;
mtd               755 drivers/mtd/nand/raw/sunxi_nand.c 		mtd->ecc_stats.corrected += ret;
mtd               881 drivers/mtd/nand/raw/sunxi_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               884 drivers/mtd/nand/raw/sunxi_nand.c 	int len = mtd->oobsize - offset;
mtd               890 drivers/mtd/nand/raw/sunxi_nand.c 		nand_change_read_column_op(nand, mtd->writesize, NULL, 0,
mtd               900 drivers/mtd/nand/raw/sunxi_nand.c 		*cur_off = mtd->oobsize + mtd->writesize;
mtd               909 drivers/mtd/nand/raw/sunxi_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd               969 drivers/mtd/nand/raw/sunxi_nand.c 						   mtd->writesize + oob_off,
mtd              1004 drivers/mtd/nand/raw/sunxi_nand.c 						   mtd->writesize + oob_off,
mtd              1069 drivers/mtd/nand/raw/sunxi_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd              1072 drivers/mtd/nand/raw/sunxi_nand.c 	int len = mtd->oobsize - offset;
mtd              1078 drivers/mtd/nand/raw/sunxi_nand.c 		nand_change_write_column_op(nand, offset + mtd->writesize,
mtd              1084 drivers/mtd/nand/raw/sunxi_nand.c 		*cur_off = mtd->oobsize + mtd->writesize;
mtd              1090 drivers/mtd/nand/raw/sunxi_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd              1109 drivers/mtd/nand/raw/sunxi_nand.c 						  oob_off + mtd->writesize,
mtd              1149 drivers/mtd/nand/raw/sunxi_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd              1169 drivers/mtd/nand/raw/sunxi_nand.c 						  oob_off + mtd->writesize,
mtd              1205 drivers/mtd/nand/raw/sunxi_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd              1222 drivers/mtd/nand/raw/sunxi_nand.c 						   oob_off + mtd->writesize,
mtd              1242 drivers/mtd/nand/raw/sunxi_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd              1260 drivers/mtd/nand/raw/sunxi_nand.c 						   oob_off + mtd->writesize,
mtd              1345 drivers/mtd/nand/raw/sunxi_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd              1349 drivers/mtd/nand/raw/sunxi_nand.c 	memset(buf, 0xff, mtd->writesize);
mtd              1549 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nand_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd              1552 drivers/mtd/nand/raw/sunxi_nand.c 	struct nand_chip *nand = mtd_to_nand(mtd);
mtd              1564 drivers/mtd/nand/raw/sunxi_nand.c static int sunxi_nand_ooblayout_free(struct mtd_info *mtd, int section,
mtd              1567 drivers/mtd/nand/raw/sunxi_nand.c 	struct nand_chip *nand = mtd_to_nand(mtd);
mtd              1590 drivers/mtd/nand/raw/sunxi_nand.c 		oobregion->offset = mtd->oobsize - oobregion->offset;
mtd              1611 drivers/mtd/nand/raw/sunxi_nand.c 	struct mtd_info *mtd = nand_to_mtd(nand);
mtd              1621 drivers/mtd/nand/raw/sunxi_nand.c 		nsectors = mtd->writesize / ecc->size;
mtd              1624 drivers/mtd/nand/raw/sunxi_nand.c 		bytes = (mtd->oobsize - 2) / nsectors;
mtd              1654 drivers/mtd/nand/raw/sunxi_nand.c 	if (ecc->size == 512 && mtd->writesize > 512) {
mtd              1685 drivers/mtd/nand/raw/sunxi_nand.c 	nsectors = mtd->writesize / ecc->size;
mtd              1687 drivers/mtd/nand/raw/sunxi_nand.c 	if (mtd->oobsize < ((ecc->bytes + 4) * nsectors)) {
mtd              1694 drivers/mtd/nand/raw/sunxi_nand.c 	mtd_set_ooblayout(mtd, &sunxi_nand_ooblayout_ops);
mtd              1930 drivers/mtd/nand/raw/sunxi_nand.c 	struct mtd_info *mtd;
mtd              1996 drivers/mtd/nand/raw/sunxi_nand.c 	mtd = nand_to_mtd(nand);
mtd              1997 drivers/mtd/nand/raw/sunxi_nand.c 	mtd->dev.parent = dev;
mtd              2003 drivers/mtd/nand/raw/sunxi_nand.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd               177 drivers/mtd/nand/raw/tango_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               190 drivers/mtd/nand/raw/tango_nand.c 			mtd->ecc_stats.failed++;
mtd               192 drivers/mtd/nand/raw/tango_nand.c 			mtd->ecc_stats.corrected += res;
mtd               205 drivers/mtd/nand/raw/tango_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               218 drivers/mtd/nand/raw/tango_nand.c 	mtd->ecc_stats.corrected +=
mtd               278 drivers/mtd/nand/raw/tango_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               280 drivers/mtd/nand/raw/tango_nand.c 	int err, res, len = mtd->writesize;
mtd               301 drivers/mtd/nand/raw/tango_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               303 drivers/mtd/nand/raw/tango_nand.c 	int err, status, len = mtd->writesize;
mtd               368 drivers/mtd/nand/raw/tango_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               370 drivers/mtd/nand/raw/tango_nand.c 	const int page_size = mtd->writesize;
mtd               395 drivers/mtd/nand/raw/tango_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               397 drivers/mtd/nand/raw/tango_nand.c 	const int page_size = mtd->writesize;
mtd               450 drivers/mtd/nand/raw/tango_nand.c static int oob_ecc(struct mtd_info *mtd, int idx, struct mtd_oob_region *res)
mtd               452 drivers/mtd/nand/raw/tango_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               464 drivers/mtd/nand/raw/tango_nand.c static int oob_free(struct mtd_info *mtd, int idx, struct mtd_oob_region *res)
mtd               537 drivers/mtd/nand/raw/tango_nand.c 	struct mtd_info *mtd;
mtd               563 drivers/mtd/nand/raw/tango_nand.c 	mtd = nand_to_mtd(chip);
mtd               578 drivers/mtd/nand/raw/tango_nand.c 	mtd_set_ooblayout(mtd, &tango_nand_ooblayout_ops);
mtd               579 drivers/mtd/nand/raw/tango_nand.c 	mtd->dev.parent = dev;
mtd               588 drivers/mtd/nand/raw/tango_nand.c 	tchip->bb_cfg = BB_CFG(mtd->writesize, BBM_SIZE);
mtd               590 drivers/mtd/nand/raw/tango_nand.c 	err = mtd_device_register(mtd, NULL, 0);
mtd               200 drivers/mtd/nand/raw/tegra_nand.c static int tegra_nand_ooblayout_rs_ecc(struct mtd_info *mtd, int section,
mtd               203 drivers/mtd/nand/raw/tegra_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               216 drivers/mtd/nand/raw/tegra_nand.c static int tegra_nand_ooblayout_no_free(struct mtd_info *mtd, int section,
mtd               227 drivers/mtd/nand/raw/tegra_nand.c static int tegra_nand_ooblayout_bch_ecc(struct mtd_info *mtd, int section,
mtd               230 drivers/mtd/nand/raw/tegra_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               491 drivers/mtd/nand/raw/tegra_nand.c static int tegra_nand_page_xfer(struct mtd_info *mtd, struct nand_chip *chip,
mtd               516 drivers/mtd/nand/raw/tegra_nand.c 		addr1 |= mtd->writesize;
mtd               527 drivers/mtd/nand/raw/tegra_nand.c 		dma_addr = dma_map_single(ctrl->dev, buf, mtd->writesize, dir);
mtd               534 drivers/mtd/nand/raw/tegra_nand.c 		writel_relaxed(mtd->writesize - 1, ctrl->regs + DMA_CFG_A);
mtd               539 drivers/mtd/nand/raw/tegra_nand.c 		dma_addr_oob = dma_map_single(ctrl->dev, oob_buf, mtd->oobsize,
mtd               606 drivers/mtd/nand/raw/tegra_nand.c 		dma_unmap_single(ctrl->dev, dma_addr_oob, mtd->oobsize, dir);
mtd               609 drivers/mtd/nand/raw/tegra_nand.c 		dma_unmap_single(ctrl->dev, dma_addr, mtd->writesize, dir);
mtd               617 drivers/mtd/nand/raw/tegra_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               620 drivers/mtd/nand/raw/tegra_nand.c 	return tegra_nand_page_xfer(mtd, chip, buf, oob_buf,
mtd               621 drivers/mtd/nand/raw/tegra_nand.c 				    mtd->oobsize, page, true);
mtd               627 drivers/mtd/nand/raw/tegra_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               630 drivers/mtd/nand/raw/tegra_nand.c 	return tegra_nand_page_xfer(mtd, chip, (void *)buf, oob_buf,
mtd               631 drivers/mtd/nand/raw/tegra_nand.c 				     mtd->oobsize, page, false);
mtd               636 drivers/mtd/nand/raw/tegra_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               638 drivers/mtd/nand/raw/tegra_nand.c 	return tegra_nand_page_xfer(mtd, chip, NULL, chip->oob_poi,
mtd               639 drivers/mtd/nand/raw/tegra_nand.c 				    mtd->oobsize, page, true);
mtd               644 drivers/mtd/nand/raw/tegra_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               646 drivers/mtd/nand/raw/tegra_nand.c 	return tegra_nand_page_xfer(mtd, chip, NULL, chip->oob_poi,
mtd               647 drivers/mtd/nand/raw/tegra_nand.c 				    mtd->oobsize, page, false);
mtd               653 drivers/mtd/nand/raw/tegra_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               662 drivers/mtd/nand/raw/tegra_nand.c 	ret = tegra_nand_page_xfer(mtd, chip, buf, oob_buf, 0, page, true);
mtd               706 drivers/mtd/nand/raw/tegra_nand.c 			mtd->ecc_stats.failed += hweight8(fail_sec_flag);
mtd               731 drivers/mtd/nand/raw/tegra_nand.c 				mtd->ecc_stats.failed++;
mtd               733 drivers/mtd/nand/raw/tegra_nand.c 				mtd->ecc_stats.corrected += ret;
mtd               754 drivers/mtd/nand/raw/tegra_nand.c 		mtd->ecc_stats.corrected += max_corr_cnt * hweight8(corr_sec_flag);
mtd               763 drivers/mtd/nand/raw/tegra_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               769 drivers/mtd/nand/raw/tegra_nand.c 	ret = tegra_nand_page_xfer(mtd, chip, (void *)buf, oob_buf,
mtd               910 drivers/mtd/nand/raw/tegra_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               919 drivers/mtd/nand/raw/tegra_nand.c 	chip->ecc.steps = mtd->writesize / chip->ecc.size;
mtd               937 drivers/mtd/nand/raw/tegra_nand.c 		if (mtd->writesize < 2048)
mtd               943 drivers/mtd/nand/raw/tegra_nand.c 	if (chip->ecc.algo == NAND_ECC_BCH && mtd->writesize < 2048) {
mtd               949 drivers/mtd/nand/raw/tegra_nand.c 		ret = tegra_nand_select_strength(chip, mtd->oobsize);
mtd               966 drivers/mtd/nand/raw/tegra_nand.c 		mtd_set_ooblayout(mtd, &tegra_nand_oob_rs_ops);
mtd               987 drivers/mtd/nand/raw/tegra_nand.c 		mtd_set_ooblayout(mtd, &tegra_nand_oob_bch_ops);
mtd              1019 drivers/mtd/nand/raw/tegra_nand.c 	switch (mtd->writesize) {
mtd              1037 drivers/mtd/nand/raw/tegra_nand.c 			mtd->writesize);
mtd              1045 drivers/mtd/nand/raw/tegra_nand.c 	nand->config |= CONFIG_TAG_BYTE_SIZE(mtd->oobsize - 1);
mtd              1064 drivers/mtd/nand/raw/tegra_nand.c 	struct mtd_info *mtd;
mtd              1106 drivers/mtd/nand/raw/tegra_nand.c 	mtd = nand_to_mtd(chip);
mtd              1108 drivers/mtd/nand/raw/tegra_nand.c 	mtd->dev.parent = dev;
mtd              1109 drivers/mtd/nand/raw/tegra_nand.c 	mtd->owner = THIS_MODULE;
mtd              1113 drivers/mtd/nand/raw/tegra_nand.c 	if (!mtd->name)
mtd              1114 drivers/mtd/nand/raw/tegra_nand.c 		mtd->name = "tegra_nand";
mtd              1122 drivers/mtd/nand/raw/tegra_nand.c 	mtd_ooblayout_ecc(mtd, 0, &nand->ecc);
mtd              1124 drivers/mtd/nand/raw/tegra_nand.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd              1208 drivers/mtd/nand/raw/tegra_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd              1211 drivers/mtd/nand/raw/tegra_nand.c 	ret = mtd_device_unregister(mtd);
mtd               122 drivers/mtd/nand/raw/tmio_nand.c static inline struct tmio_nand *mtd_to_tmio(struct mtd_info *mtd)
mtd               124 drivers/mtd/nand/raw/tmio_nand.c 	return container_of(mtd_to_nand(mtd), struct tmio_nand, chip);
mtd               367 drivers/mtd/nand/raw/tmio_nand.c 	struct mtd_info *mtd;
mtd               384 drivers/mtd/nand/raw/tmio_nand.c 	mtd = nand_to_mtd(nand_chip);
mtd               385 drivers/mtd/nand/raw/tmio_nand.c 	mtd->name = "tmio-nand";
mtd               386 drivers/mtd/nand/raw/tmio_nand.c 	mtd->dev.parent = &dev->dev;
mtd               443 drivers/mtd/nand/raw/tmio_nand.c 	retval = mtd_device_parse_register(mtd,
mtd                76 drivers/mtd/nand/raw/txx9ndfmc.c static struct platform_device *mtd_to_platdev(struct mtd_info *mtd)
mtd                78 drivers/mtd/nand/raw/txx9ndfmc.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               254 drivers/mtd/nand/raw/txx9ndfmc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               256 drivers/mtd/nand/raw/txx9ndfmc.c 	if (mtd->writesize >= 512) {
mtd               312 drivers/mtd/nand/raw/txx9ndfmc.c 		struct mtd_info *mtd;
mtd               321 drivers/mtd/nand/raw/txx9ndfmc.c 		mtd = nand_to_mtd(chip);
mtd               322 drivers/mtd/nand/raw/txx9ndfmc.c 		mtd->dev.parent = &dev->dev;
mtd               362 drivers/mtd/nand/raw/txx9ndfmc.c 		mtd->name = txx9_priv->mtdname;
mtd               364 drivers/mtd/nand/raw/txx9ndfmc.c 		mtd_device_register(mtd, NULL, 0);
mtd               365 drivers/mtd/nand/raw/txx9ndfmc.c 		drvdata->mtds[i] = mtd;
mtd               379 drivers/mtd/nand/raw/txx9ndfmc.c 		struct mtd_info *mtd = drvdata->mtds[i];
mtd               383 drivers/mtd/nand/raw/txx9ndfmc.c 		if (!mtd)
mtd               385 drivers/mtd/nand/raw/txx9ndfmc.c 		chip = mtd_to_nand(mtd);
mtd               514 drivers/mtd/nand/raw/vf610_nfc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               527 drivers/mtd/nand/raw/vf610_nfc.c 	nand_read_oob_op(&nfc->chip, page, 0, oob, mtd->oobsize);
mtd               535 drivers/mtd/nand/raw/vf610_nfc.c 					   mtd->oobsize, NULL, 0,
mtd               555 drivers/mtd/nand/raw/vf610_nfc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               556 drivers/mtd/nand/raw/vf610_nfc.c 	int trfr_sz = mtd->writesize + mtd->oobsize;
mtd               581 drivers/mtd/nand/raw/vf610_nfc.c 			       mtd->writesize, false);
mtd               585 drivers/mtd/nand/raw/vf610_nfc.c 						   mtd->writesize,
mtd               586 drivers/mtd/nand/raw/vf610_nfc.c 				       mtd->oobsize, false);
mtd               591 drivers/mtd/nand/raw/vf610_nfc.c 		mtd->ecc_stats.failed++;
mtd               594 drivers/mtd/nand/raw/vf610_nfc.c 		mtd->ecc_stats.corrected += stat;
mtd               603 drivers/mtd/nand/raw/vf610_nfc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               604 drivers/mtd/nand/raw/vf610_nfc.c 	int trfr_sz = mtd->writesize + mtd->oobsize;
mtd               624 drivers/mtd/nand/raw/vf610_nfc.c 			     mtd->writesize, false);
mtd               660 drivers/mtd/nand/raw/vf610_nfc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               664 drivers/mtd/nand/raw/vf610_nfc.c 	ret = nand_prog_page_begin_op(chip, page, 0, buf, mtd->writesize);
mtd               666 drivers/mtd/nand/raw/vf610_nfc.c 		ret = nand_write_data_op(chip, chip->oob_poi, mtd->oobsize,
mtd               690 drivers/mtd/nand/raw/vf610_nfc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               695 drivers/mtd/nand/raw/vf610_nfc.c 	ret = nand_prog_page_begin_op(chip, page, mtd->writesize,
mtd               696 drivers/mtd/nand/raw/vf610_nfc.c 				      chip->oob_poi, mtd->oobsize);
mtd               747 drivers/mtd/nand/raw/vf610_nfc.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               757 drivers/mtd/nand/raw/vf610_nfc.c 	if (mtd->writesize + mtd->oobsize > PAGE_2K + OOB_MAX - 8) {
mtd               765 drivers/mtd/nand/raw/vf610_nfc.c 	if (mtd->writesize != PAGE_2K && mtd->oobsize < 64) {
mtd               770 drivers/mtd/nand/raw/vf610_nfc.c 	if (chip->ecc.size != mtd->writesize) {
mtd               776 drivers/mtd/nand/raw/vf610_nfc.c 	if (mtd->oobsize > 64)
mtd               777 drivers/mtd/nand/raw/vf610_nfc.c 		mtd->oobsize = 64;
mtd               780 drivers/mtd/nand/raw/vf610_nfc.c 	mtd_set_ooblayout(mtd, &nand_ooblayout_lp_ops);
mtd               814 drivers/mtd/nand/raw/vf610_nfc.c 	struct mtd_info *mtd;
mtd               827 drivers/mtd/nand/raw/vf610_nfc.c 	mtd = nand_to_mtd(chip);
mtd               829 drivers/mtd/nand/raw/vf610_nfc.c 	mtd->owner = THIS_MODULE;
mtd               830 drivers/mtd/nand/raw/vf610_nfc.c 	mtd->dev.parent = nfc->dev;
mtd               831 drivers/mtd/nand/raw/vf610_nfc.c 	mtd->name = DRV_NAME;
mtd               903 drivers/mtd/nand/raw/vf610_nfc.c 	err = mtd_device_register(mtd, NULL, 0);
mtd                70 drivers/mtd/nand/raw/xway_nand.c static u8 xway_readb(struct mtd_info *mtd, int op)
mtd                72 drivers/mtd/nand/raw/xway_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd                78 drivers/mtd/nand/raw/xway_nand.c static void xway_writeb(struct mtd_info *mtd, int op, u8 value)
mtd                80 drivers/mtd/nand/raw/xway_nand.c 	struct nand_chip *chip = mtd_to_nand(mtd);
mtd               108 drivers/mtd/nand/raw/xway_nand.c 	struct mtd_info *mtd = nand_to_mtd(chip);
mtd               114 drivers/mtd/nand/raw/xway_nand.c 		xway_writeb(mtd, NAND_WRITE_CMD, cmd);
mtd               116 drivers/mtd/nand/raw/xway_nand.c 		xway_writeb(mtd, NAND_WRITE_ADDR, cmd);
mtd               154 drivers/mtd/nand/raw/xway_nand.c 	struct mtd_info *mtd;
mtd               172 drivers/mtd/nand/raw/xway_nand.c 	mtd = nand_to_mtd(&data->chip);
mtd               173 drivers/mtd/nand/raw/xway_nand.c 	mtd->dev.parent = &pdev->dev;
mtd               211 drivers/mtd/nand/raw/xway_nand.c 	err = mtd_device_register(mtd, NULL, 0);
mtd               216 drivers/mtd/nand/spi/core.c 	struct mtd_info *mtd = nanddev_to_mtd(nand);
mtd               258 drivers/mtd/nand/spi/core.c 			mtd_ooblayout_get_databytes(mtd, req->oobbuf.in,
mtd               274 drivers/mtd/nand/spi/core.c 	struct mtd_info *mtd = nanddev_to_mtd(nand);
mtd               296 drivers/mtd/nand/spi/core.c 			mtd_ooblayout_set_databytes(mtd, req->oobbuf.out,
mtd               482 drivers/mtd/nand/spi/core.c static int spinand_mtd_read(struct mtd_info *mtd, loff_t from,
mtd               485 drivers/mtd/nand/spi/core.c 	struct spinand_device *spinand = mtd_to_spinand(mtd);
mtd               486 drivers/mtd/nand/spi/core.c 	struct nand_device *nand = mtd_to_nanddev(mtd);
mtd               513 drivers/mtd/nand/spi/core.c 			mtd->ecc_stats.failed++;
mtd               515 drivers/mtd/nand/spi/core.c 			mtd->ecc_stats.corrected += ret;
mtd               532 drivers/mtd/nand/spi/core.c static int spinand_mtd_write(struct mtd_info *mtd, loff_t to,
mtd               535 drivers/mtd/nand/spi/core.c 	struct spinand_device *spinand = mtd_to_spinand(mtd);
mtd               536 drivers/mtd/nand/spi/core.c 	struct nand_device *nand = mtd_to_nanddev(mtd);
mtd               541 drivers/mtd/nand/spi/core.c 	if (ops->mode != MTD_OPS_RAW && mtd->ooblayout)
mtd               588 drivers/mtd/nand/spi/core.c static int spinand_mtd_block_isbad(struct mtd_info *mtd, loff_t offs)
mtd               590 drivers/mtd/nand/spi/core.c 	struct nand_device *nand = mtd_to_nanddev(mtd);
mtd               627 drivers/mtd/nand/spi/core.c static int spinand_mtd_block_markbad(struct mtd_info *mtd, loff_t offs)
mtd               629 drivers/mtd/nand/spi/core.c 	struct nand_device *nand = mtd_to_nanddev(mtd);
mtd               667 drivers/mtd/nand/spi/core.c static int spinand_mtd_erase(struct mtd_info *mtd,
mtd               670 drivers/mtd/nand/spi/core.c 	struct spinand_device *spinand = mtd_to_spinand(mtd);
mtd               674 drivers/mtd/nand/spi/core.c 	ret = nanddev_mtd_erase(mtd, einfo);
mtd               680 drivers/mtd/nand/spi/core.c static int spinand_mtd_block_isreserved(struct mtd_info *mtd, loff_t offs)
mtd               682 drivers/mtd/nand/spi/core.c 	struct spinand_device *spinand = mtd_to_spinand(mtd);
mtd               683 drivers/mtd/nand/spi/core.c 	struct nand_device *nand = mtd_to_nanddev(mtd);
mtd               928 drivers/mtd/nand/spi/core.c static int spinand_noecc_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               934 drivers/mtd/nand/spi/core.c static int spinand_noecc_ooblayout_free(struct mtd_info *mtd, int section,
mtd               955 drivers/mtd/nand/spi/core.c 	struct mtd_info *mtd = spinand_to_mtd(spinand);
mtd               956 drivers/mtd/nand/spi/core.c 	struct nand_device *nand = mtd_to_nanddev(mtd);
mtd              1033 drivers/mtd/nand/spi/core.c 	mtd->_read_oob = spinand_mtd_read;
mtd              1034 drivers/mtd/nand/spi/core.c 	mtd->_write_oob = spinand_mtd_write;
mtd              1035 drivers/mtd/nand/spi/core.c 	mtd->_block_isbad = spinand_mtd_block_isbad;
mtd              1036 drivers/mtd/nand/spi/core.c 	mtd->_block_markbad = spinand_mtd_block_markbad;
mtd              1037 drivers/mtd/nand/spi/core.c 	mtd->_block_isreserved = spinand_mtd_block_isreserved;
mtd              1038 drivers/mtd/nand/spi/core.c 	mtd->_erase = spinand_mtd_erase;
mtd              1039 drivers/mtd/nand/spi/core.c 	mtd->_max_bad_blocks = nanddev_mtd_max_bad_blocks;
mtd              1042 drivers/mtd/nand/spi/core.c 		mtd_set_ooblayout(mtd, spinand->eccinfo.ooblayout);
mtd              1044 drivers/mtd/nand/spi/core.c 		mtd_set_ooblayout(mtd, &spinand_noecc_ooblayout);
mtd              1046 drivers/mtd/nand/spi/core.c 	ret = mtd_ooblayout_count_freebytes(mtd);
mtd              1050 drivers/mtd/nand/spi/core.c 	mtd->oobavail = ret;
mtd              1053 drivers/mtd/nand/spi/core.c 	mtd->ecc_strength = nand->eccreq.strength;
mtd              1054 drivers/mtd/nand/spi/core.c 	mtd->ecc_step_size = nand->eccreq.step_size;
mtd              1083 drivers/mtd/nand/spi/core.c 	struct mtd_info *mtd;
mtd              1095 drivers/mtd/nand/spi/core.c 	mtd = spinand_to_mtd(spinand);
mtd              1096 drivers/mtd/nand/spi/core.c 	mtd->dev.parent = &mem->spi->dev;
mtd              1102 drivers/mtd/nand/spi/core.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd              1117 drivers/mtd/nand/spi/core.c 	struct mtd_info *mtd;
mtd              1121 drivers/mtd/nand/spi/core.c 	mtd = spinand_to_mtd(spinand);
mtd              1123 drivers/mtd/nand/spi/core.c 	ret = mtd_device_unregister(mtd);
mtd                47 drivers/mtd/nand/spi/gigadevice.c static int gd5fxgq4xa_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd                59 drivers/mtd/nand/spi/gigadevice.c static int gd5fxgq4xa_ooblayout_free(struct mtd_info *mtd, int section,
mtd               105 drivers/mtd/nand/spi/gigadevice.c static int gd5fxgq4_variant2_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               117 drivers/mtd/nand/spi/gigadevice.c static int gd5fxgq4_variant2_ooblayout_free(struct mtd_info *mtd, int section,
mtd                29 drivers/mtd/nand/spi/macronix.c static int mx35lfxge4ab_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd                35 drivers/mtd/nand/spi/macronix.c static int mx35lfxge4ab_ooblayout_free(struct mtd_info *mtd, int section,
mtd                42 drivers/mtd/nand/spi/macronix.c 	region->length = mtd->oobsize - 2;
mtd                37 drivers/mtd/nand/spi/micron.c static int mt29f2g01abagd_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd                49 drivers/mtd/nand/spi/micron.c static int mt29f2g01abagd_ooblayout_free(struct mtd_info *mtd, int section,
mtd                41 drivers/mtd/nand/spi/paragon.c static int pn26g0xa_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd                53 drivers/mtd/nand/spi/paragon.c static int pn26g0xa_ooblayout_free(struct mtd_info *mtd, int section,
mtd                28 drivers/mtd/nand/spi/toshiba.c static int tc58cxgxsx_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd                34 drivers/mtd/nand/spi/toshiba.c 	region->offset = mtd->oobsize / 2;
mtd                35 drivers/mtd/nand/spi/toshiba.c 	region->length = mtd->oobsize / 2;
mtd                40 drivers/mtd/nand/spi/toshiba.c static int tc58cxgxsx_ooblayout_free(struct mtd_info *mtd, int section,
mtd                48 drivers/mtd/nand/spi/toshiba.c 	region->length = (mtd->oobsize / 2) - 2;
mtd                34 drivers/mtd/nand/spi/winbond.c static int w25m02gv_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd                46 drivers/mtd/nand/spi/winbond.c static int w25m02gv_ooblayout_free(struct mtd_info *mtd, int section,
mtd                35 drivers/mtd/nftlcore.c static void nftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
mtd                40 drivers/mtd/nftlcore.c 	if (!mtd_type_is_nand(mtd) || mtd->size > UINT_MAX)
mtd                43 drivers/mtd/nftlcore.c 	if (memcmp(mtd->name, "DiskOnChip", 10))
mtd                46 drivers/mtd/nftlcore.c 	pr_debug("NFTL: add_mtd for %s\n", mtd->name);
mtd                53 drivers/mtd/nftlcore.c 	nftl->mbd.mtd = mtd;
mtd               123 drivers/mtd/nftlcore.c int nftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len,
mtd               126 drivers/mtd/nftlcore.c 	loff_t mask = mtd->writesize - 1;
mtd               136 drivers/mtd/nftlcore.c 	res = mtd_read_oob(mtd, offs & ~mask, &ops);
mtd               144 drivers/mtd/nftlcore.c int nftl_write_oob(struct mtd_info *mtd, loff_t offs, size_t len,
mtd               147 drivers/mtd/nftlcore.c 	loff_t mask = mtd->writesize - 1;
mtd               157 drivers/mtd/nftlcore.c 	res = mtd_write_oob(mtd, offs & ~mask, &ops);
mtd               167 drivers/mtd/nftlcore.c static int nftl_write(struct mtd_info *mtd, loff_t offs, size_t len,
mtd               170 drivers/mtd/nftlcore.c 	loff_t mask = mtd->writesize - 1;
mtd               176 drivers/mtd/nftlcore.c 	ops.ooblen = mtd->oobsize;
mtd               181 drivers/mtd/nftlcore.c 	res = mtd_write_oob(mtd, offs & ~mask, &ops);
mtd               233 drivers/mtd/nftlcore.c 	struct mtd_info *mtd = nftl->mbd.mtd;
mtd               266 drivers/mtd/nftlcore.c 			nftl_read_oob(mtd, (thisEUN * nftl->EraseSize) +
mtd               382 drivers/mtd/nftlcore.c 		nftl_write_oob(mtd, (nftl->EraseSize * targetEUN) + 2 * 512 + 8,
mtd               406 drivers/mtd/nftlcore.c 		ret = mtd_read(mtd,
mtd               412 drivers/mtd/nftlcore.c 			ret = mtd_read(mtd,
mtd               423 drivers/mtd/nftlcore.c 		nftl_write(nftl->mbd.mtd, (nftl->EraseSize * targetEUN) +
mtd               431 drivers/mtd/nftlcore.c 	nftl_write_oob(mtd, (nftl->EraseSize * targetEUN) + 8,
mtd               526 drivers/mtd/nftlcore.c 	struct mtd_info *mtd = nftl->mbd.mtd;
mtd               551 drivers/mtd/nftlcore.c 			nftl_read_oob(mtd,
mtd               640 drivers/mtd/nftlcore.c 		nftl_read_oob(mtd, writeEUN * nftl->EraseSize + 8, 8,
mtd               645 drivers/mtd/nftlcore.c 		nftl_write_oob(mtd, writeEUN * nftl->EraseSize + 8, 8,
mtd               655 drivers/mtd/nftlcore.c 			nftl_read_oob(mtd, (lastEUN * nftl->EraseSize) + 8,
mtd               661 drivers/mtd/nftlcore.c 			nftl_write_oob(mtd, (lastEUN * nftl->EraseSize) + 8,
mtd               695 drivers/mtd/nftlcore.c 	nftl_write(nftl->mbd.mtd, (writeEUN * nftl->EraseSize) + blockofs,
mtd               705 drivers/mtd/nftlcore.c 	struct mtd_info *mtd = nftl->mbd.mtd;
mtd               718 drivers/mtd/nftlcore.c 			if (nftl_read_oob(mtd, (thisEUN * nftl->EraseSize) +
mtd               759 drivers/mtd/nftlcore.c 		int res = mtd_read(mtd, ptr, 512, &retlen, buffer);
mtd                32 drivers/mtd/nftlmount.c 	struct mtd_info *mtd = nftl->mbd.mtd;
mtd                41 drivers/mtd/nftlmount.c 	nftl->EraseSize = nftl->mbd.mtd->erasesize;
mtd                42 drivers/mtd/nftlmount.c         nftl->nb_blocks = (u32)nftl->mbd.mtd->size / nftl->EraseSize;
mtd                53 drivers/mtd/nftlmount.c 		ret = mtd_read(mtd, block * nftl->EraseSize, SECTORSIZE,
mtd                62 drivers/mtd/nftlmount.c 				       block * nftl->EraseSize, nftl->mbd.mtd->index, ret);
mtd                73 drivers/mtd/nftlmount.c 			       block * nftl->EraseSize, nftl->mbd.mtd->index);
mtd                79 drivers/mtd/nftlmount.c 		ret = nftl_read_oob(mtd, block * nftl->EraseSize +
mtd                84 drivers/mtd/nftlmount.c 			       block * nftl->EraseSize, nftl->mbd.mtd->index, ret);
mtd                94 drivers/mtd/nftlmount.c 			       block * nftl->EraseSize, nftl->mbd.mtd->index,
mtd               100 drivers/mtd/nftlmount.c 		ret = mtd->read(mtd, block * nftl->EraseSize, SECTORSIZE,
mtd               104 drivers/mtd/nftlmount.c 			       block * nftl->EraseSize, nftl->mbd.mtd->index, ret);
mtd               111 drivers/mtd/nftlmount.c 			       block * nftl->EraseSize, nftl->mbd.mtd->index);
mtd               148 drivers/mtd/nftlmount.c erasesize based on UnitSizeFactor.  So the erasesize we read from the mtd
mtd               159 drivers/mtd/nftlmount.c 			nftl->EraseSize = nftl->mbd.mtd->erasesize << (0xff - mh->UnitSizeFactor);
mtd               160 drivers/mtd/nftlmount.c 			nftl->nb_blocks = (u32)nftl->mbd.mtd->size / nftl->EraseSize;
mtd               222 drivers/mtd/nftlmount.c 				ret = mtd->read(nftl->mbd.mtd,
mtd               238 drivers/mtd/nftlmount.c 			if (mtd_block_isbad(nftl->mbd.mtd,
mtd               265 drivers/mtd/nftlmount.c 	struct mtd_info *mtd = nftl->mbd.mtd;
mtd               270 drivers/mtd/nftlmount.c 	buf = kmalloc(SECTORSIZE + mtd->oobsize, GFP_KERNEL);
mtd               276 drivers/mtd/nftlmount.c 		if (mtd_read(mtd, address, SECTORSIZE, &retlen, buf))
mtd               282 drivers/mtd/nftlmount.c 			if(nftl_read_oob(mtd, address, mtd->oobsize,
mtd               285 drivers/mtd/nftlmount.c 			if (memcmpb(buf + SECTORSIZE, 0xff, mtd->oobsize) != 0)
mtd               311 drivers/mtd/nftlmount.c 	struct mtd_info *mtd = nftl->mbd.mtd;
mtd               314 drivers/mtd/nftlmount.c 	if (nftl_read_oob(mtd, block * nftl->EraseSize + SECTORSIZE + 8,
mtd               331 drivers/mtd/nftlmount.c 	if (mtd_erase(mtd, instr)) {
mtd               352 drivers/mtd/nftlmount.c 	if (nftl_write_oob(mtd, block * nftl->EraseSize + SECTORSIZE +
mtd               359 drivers/mtd/nftlmount.c 	mtd_block_markbad(nftl->mbd.mtd, instr->addr);
mtd               374 drivers/mtd/nftlmount.c 	struct mtd_info *mtd = nftl->mbd.mtd;
mtd               384 drivers/mtd/nftlmount.c 			if (nftl_read_oob(mtd,
mtd               405 drivers/mtd/nftlmount.c 					nftl_write_oob(mtd, block *
mtd               493 drivers/mtd/nftlmount.c 	struct mtd_info *mtd = nftl->mbd.mtd;
mtd               499 drivers/mtd/nftlmount.c 	if (nftl_read_oob(mtd, block * nftl->EraseSize + SECTORSIZE + 8, 8,
mtd               514 drivers/mtd/nftlmount.c 		if (nftl_write_oob(mtd,
mtd               527 drivers/mtd/nftlmount.c 			if (nftl_read_oob(mtd, block * nftl->EraseSize + i,
mtd               554 drivers/mtd/nftlmount.c 	struct mtd_info *mtd = nftl->mbd.mtd;
mtd               558 drivers/mtd/nftlmount.c 	if (nftl_read_oob(mtd, block * nftl->EraseSize + 2 * SECTORSIZE + 8,
mtd               573 drivers/mtd/nftlmount.c 	struct mtd_info *mtd = s->mbd.mtd;
mtd               598 drivers/mtd/nftlmount.c 				if (nftl_read_oob(mtd,
mtd               601 drivers/mtd/nftlmount.c 				    nftl_read_oob(mtd,
mtd                78 drivers/mtd/parsers/afs.c static bool afs_is_v1(struct mtd_info *mtd, u_int off)
mtd                81 drivers/mtd/parsers/afs.c 	u_int ptr = off + mtd->erasesize - 12;
mtd                86 drivers/mtd/parsers/afs.c 	ret = mtd_read(mtd, ptr, 4, &sz, (u_char *)&magic);
mtd                98 drivers/mtd/parsers/afs.c static bool afs_is_v2(struct mtd_info *mtd, u_int off)
mtd               101 drivers/mtd/parsers/afs.c 	u_int ptr = off + mtd->erasesize - 8;
mtd               106 drivers/mtd/parsers/afs.c 	ret = mtd_read(mtd, ptr, 8, &sz, (u_char *)foot);
mtd               119 drivers/mtd/parsers/afs.c static int afs_parse_v1_partition(struct mtd_info *mtd,
mtd               140 drivers/mtd/parsers/afs.c 	mask = mtd->size - 1;
mtd               142 drivers/mtd/parsers/afs.c 	ptr = off + mtd->erasesize - sizeof(fs);
mtd               143 drivers/mtd/parsers/afs.c 	ret = mtd_read(mtd, ptr, sizeof(fs), &sz, (u_char *)&fs);
mtd               182 drivers/mtd/parsers/afs.c 	ret = mtd_read(mtd, iis_ptr, sizeof(iis), &sz, (u_char *)&iis);
mtd               205 drivers/mtd/parsers/afs.c 	part->size = (iis.length + mtd->erasesize - 1) & ~(mtd->erasesize - 1);
mtd               216 drivers/mtd/parsers/afs.c static int afs_parse_v2_partition(struct mtd_info *mtd,
mtd               236 drivers/mtd/parsers/afs.c 		 off, off + mtd->erasesize);
mtd               239 drivers/mtd/parsers/afs.c 	ptr = off + mtd->erasesize - sizeof(footer);
mtd               240 drivers/mtd/parsers/afs.c 	ret = mtd_read(mtd, ptr, sizeof(footer), &sz, (u_char *)footer);
mtd               248 drivers/mtd/parsers/afs.c 	ptr = off + mtd->erasesize - sizeof(footer) - footer[8];
mtd               254 drivers/mtd/parsers/afs.c 	ret = mtd_read(mtd, ptr, sizeof(imginfo), &sz, (u_char *)imginfo);
mtd               306 drivers/mtd/parsers/afs.c 		region_end += (mtd->erasesize - 1);
mtd               307 drivers/mtd/parsers/afs.c 		region_end &= ~(mtd->erasesize -1);
mtd               323 drivers/mtd/parsers/afs.c static int parse_afs_partitions(struct mtd_info *mtd,
mtd               333 drivers/mtd/parsers/afs.c 	for (i = off = sz = 0; off < mtd->size; off += mtd->erasesize) {
mtd               334 drivers/mtd/parsers/afs.c 		if (afs_is_v1(mtd, off)) {
mtd               338 drivers/mtd/parsers/afs.c 		if (afs_is_v2(mtd, off)) {
mtd               354 drivers/mtd/parsers/afs.c 	for (i = off = 0; off < mtd->size; off += mtd->erasesize) {
mtd               355 drivers/mtd/parsers/afs.c 		if (afs_is_v1(mtd, off)) {
mtd               356 drivers/mtd/parsers/afs.c 			ret = afs_parse_v1_partition(mtd, off, &parts[i]);
mtd               361 drivers/mtd/parsers/afs.c 		if (afs_is_v2(mtd, off)) {
mtd               362 drivers/mtd/parsers/afs.c 			ret = afs_parse_v2_partition(mtd, off, &parts[i]);
mtd                50 drivers/mtd/parsers/parser_trx.c static int parser_trx_parse(struct mtd_info *mtd,
mtd                66 drivers/mtd/parsers/parser_trx.c 	err = mtd_read(mtd, 0, sizeof(trx), &bytes_read, (uint8_t *)&trx);
mtd                95 drivers/mtd/parsers/parser_trx.c 		part->name = parser_trx_data_part_name(mtd, trx.offset[i]);
mtd               106 drivers/mtd/parsers/parser_trx.c 				       parts[i + 1].offset : mtd->size;
mtd                70 drivers/mtd/parsers/sharpslpart.c static int sharpsl_nand_check_ooblayout(struct mtd_info *mtd)
mtd                79 drivers/mtd/parsers/sharpslpart.c 		ret = mtd_ooblayout_free(mtd, section++, &oobfree);
mtd                98 drivers/mtd/parsers/sharpslpart.c static int sharpsl_nand_read_oob(struct mtd_info *mtd, loff_t offs, u8 *buf)
mtd               104 drivers/mtd/parsers/sharpslpart.c 	ops.ooblen = mtd->oobsize;
mtd               107 drivers/mtd/parsers/sharpslpart.c 	ret = mtd_read_oob(mtd, offs, &ops);
mtd               108 drivers/mtd/parsers/sharpslpart.c 	if (ret != 0 || mtd->oobsize != ops.oobretlen)
mtd               166 drivers/mtd/parsers/sharpslpart.c static int sharpsl_nand_init_ftl(struct mtd_info *mtd, struct sharpsl_ftl *ftl)
mtd               173 drivers/mtd/parsers/sharpslpart.c 	oob = kzalloc(mtd->oobsize, GFP_KERNEL);
mtd               177 drivers/mtd/parsers/sharpslpart.c 	phymax = mtd_div_by_eb(SHARPSL_FTL_PART_SIZE, mtd);
mtd               195 drivers/mtd/parsers/sharpslpart.c 		block_adr = (loff_t)block_num * mtd->erasesize;
mtd               197 drivers/mtd/parsers/sharpslpart.c 		if (mtd_block_isbad(mtd, block_adr))
mtd               200 drivers/mtd/parsers/sharpslpart.c 		if (sharpsl_nand_read_oob(mtd, block_adr, oob))
mtd               227 drivers/mtd/parsers/sharpslpart.c static int sharpsl_nand_read_laddr(struct mtd_info *mtd,
mtd               240 drivers/mtd/parsers/sharpslpart.c 	log_num = mtd_div_by_eb((u32)from, mtd);
mtd               241 drivers/mtd/parsers/sharpslpart.c 	final_log_num = mtd_div_by_eb(((u32)from + len - 1), mtd);
mtd               247 drivers/mtd/parsers/sharpslpart.c 	block_adr = (loff_t)block_num * mtd->erasesize;
mtd               248 drivers/mtd/parsers/sharpslpart.c 	block_ofs = mtd_mod_by_eb((u32)from, mtd);
mtd               250 drivers/mtd/parsers/sharpslpart.c 	err = mtd_read(mtd, block_adr + block_ofs, len, &retlen, buf);
mtd               127 drivers/mtd/rfd_ftl.c 				part->mbd.mtd->name, block_no, i, entry);
mtd               134 drivers/mtd/rfd_ftl.c 				part->mbd.mtd->name, entry);
mtd               159 drivers/mtd/rfd_ftl.c 	part->total_blocks = (u32)part->mbd.mtd->size / part->block_size;
mtd               197 drivers/mtd/rfd_ftl.c 			"sector map", part->mbd.mtd->name);
mtd               205 drivers/mtd/rfd_ftl.c 		rc = mtd_read(part->mbd.mtd, i * part->block_size,
mtd               221 drivers/mtd/rfd_ftl.c 				part->mbd.mtd->name);
mtd               228 drivers/mtd/rfd_ftl.c 				part->mbd.mtd->name);
mtd               255 drivers/mtd/rfd_ftl.c 		rc = mtd_read(part->mbd.mtd, addr, SECTOR_SIZE, &retlen,
mtd               262 drivers/mtd/rfd_ftl.c 				"0x%lx\n", part->mbd.mtd->name, addr);
mtd               286 drivers/mtd/rfd_ftl.c 	rc = mtd_erase(part->mbd.mtd, erase);
mtd               290 drivers/mtd/rfd_ftl.c 				(unsigned long long)erase->len, part->mbd.mtd->name);
mtd               303 drivers/mtd/rfd_ftl.c 		rc = mtd_write(part->mbd.mtd, part->blocks[block].offset,
mtd               310 drivers/mtd/rfd_ftl.c 			       part->mbd.mtd->name, part->blocks[block].offset);
mtd               339 drivers/mtd/rfd_ftl.c 	rc = mtd_read(part->mbd.mtd, part->blocks[block_no].offset,
mtd               347 drivers/mtd/rfd_ftl.c 			"0x%lx\n", part->mbd.mtd->name,
mtd               379 drivers/mtd/rfd_ftl.c 		rc = mtd_read(part->mbd.mtd, addr, SECTOR_SIZE, &retlen,
mtd               388 drivers/mtd/rfd_ftl.c 				part->mbd.mtd->name);
mtd               416 drivers/mtd/rfd_ftl.c 	mtd_sync(part->mbd.mtd);
mtd               528 drivers/mtd/rfd_ftl.c 	rc = mtd_read(part->mbd.mtd, part->blocks[block].offset,
mtd               537 drivers/mtd/rfd_ftl.c 				"0x%lx\n", part->mbd.mtd->name,
mtd               561 drivers/mtd/rfd_ftl.c 	rc = mtd_write(part->mbd.mtd, addr, sizeof(del), &retlen,
mtd               569 drivers/mtd/rfd_ftl.c 			"0x%lx\n", part->mbd.mtd->name, addr);
mtd               633 drivers/mtd/rfd_ftl.c 	rc = mtd_write(part->mbd.mtd, addr, SECTOR_SIZE, &retlen,
mtd               641 drivers/mtd/rfd_ftl.c 				part->mbd.mtd->name, addr);
mtd               652 drivers/mtd/rfd_ftl.c 	rc = mtd_write(part->mbd.mtd, addr, sizeof(entry), &retlen,
mtd               660 drivers/mtd/rfd_ftl.c 				part->mbd.mtd->name, addr);
mtd               722 drivers/mtd/rfd_ftl.c static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
mtd               726 drivers/mtd/rfd_ftl.c 	if (mtd->type != MTD_NORFLASH || mtd->size > UINT_MAX)
mtd               733 drivers/mtd/rfd_ftl.c 	part->mbd.mtd = mtd;
mtd               738 drivers/mtd/rfd_ftl.c 		if (!mtd->erasesize) {
mtd               742 drivers/mtd/rfd_ftl.c 			part->block_size = mtd->erasesize;
mtd               749 drivers/mtd/rfd_ftl.c 		if (!(mtd->flags & MTD_WRITEABLE))
mtd               753 drivers/mtd/rfd_ftl.c 					"setting read-only\n", mtd->name);
mtd               758 drivers/mtd/rfd_ftl.c 				mtd->name, mtd->type, mtd->flags);
mtd               774 drivers/mtd/rfd_ftl.c 			part->mbd.mtd->name, i, part->blocks[i].erases);
mtd               242 drivers/mtd/sm_ftl.c 	struct mtd_info *mtd = ftl->trans->mtd;
mtd               280 drivers/mtd/sm_ftl.c 	ret = mtd_read_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops);
mtd               325 drivers/mtd/sm_ftl.c 	struct mtd_info *mtd = ftl->trans->mtd;
mtd               345 drivers/mtd/sm_ftl.c 	ret = mtd_write_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops);
mtd               463 drivers/mtd/sm_ftl.c 	struct mtd_info *mtd = ftl->trans->mtd;
mtd               479 drivers/mtd/sm_ftl.c 	if (mtd_erase(mtd, &erase)) {
mtd               557 drivers/mtd/sm_ftl.c static int sm_get_media_info(struct sm_ftl *ftl, struct mtd_info *mtd)
mtd               560 drivers/mtd/sm_ftl.c 	int size_in_megs = mtd->size / (1024 * 1024);
mtd               562 drivers/mtd/sm_ftl.c 	ftl->readonly = mtd->type == MTD_ROM;
mtd               579 drivers/mtd/sm_ftl.c 		if (mtd->writesize == SM_SMALL_PAGE) {
mtd               618 drivers/mtd/sm_ftl.c 	if (mtd->erasesize > ftl->block_size)
mtd               621 drivers/mtd/sm_ftl.c 	if (mtd->writesize > SM_SECTOR_SIZE)
mtd               624 drivers/mtd/sm_ftl.c 	if (ftl->smallpagenand && mtd->oobsize < SM_SMALL_OOB_SIZE)
mtd               627 drivers/mtd/sm_ftl.c 	if (!ftl->smallpagenand && mtd->oobsize < SM_OOB_SIZE)
mtd               631 drivers/mtd/sm_ftl.c 	if (!mtd_has_oob(mtd))
mtd              1118 drivers/mtd/sm_ftl.c static void sm_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
mtd              1134 drivers/mtd/sm_ftl.c 	if (sm_get_media_info(ftl, mtd)) {
mtd              1169 drivers/mtd/sm_ftl.c 	trans->mtd = mtd;
mtd              1185 drivers/mtd/sm_ftl.c 		(int)(mtd->size / (1024 * 1024)), mtd->index);
mtd               409 drivers/mtd/spi-nor/aspeed-smc.c 			mtd_device_unregister(&chip->nor.mtd);
mtd               527 drivers/mtd/spi-nor/aspeed-smc.c 	u32 size = chip->nor.mtd.size;
mtd               587 drivers/mtd/spi-nor/aspeed-smc.c 	if (size < chip->nor.mtd.size)
mtd               590 drivers/mtd/spi-nor/aspeed-smc.c 			 chip->cs, (u32)chip->nor.mtd.size >> 20);
mtd               766 drivers/mtd/spi-nor/aspeed-smc.c 		struct mtd_info *mtd;
mtd               803 drivers/mtd/spi-nor/aspeed-smc.c 		mtd = &nor->mtd;
mtd               832 drivers/mtd/spi-nor/aspeed-smc.c 		ret = mtd_device_register(mtd, NULL, 0);
mtd               752 drivers/mtd/spi-nor/cadence-quadspi.c 	reg |= (ilog2(nor->mtd.erasesize) << CQSPI_REG_SIZE_BLOCK_LSB);
mtd               761 drivers/mtd/spi-nor/cadence-quadspi.c 	cqspi->current_erase_size = nor->mtd.erasesize;
mtd               871 drivers/mtd/spi-nor/cadence-quadspi.c 	    (cqspi->current_erase_size != nor->mtd.erasesize) ||
mtd              1227 drivers/mtd/spi-nor/cadence-quadspi.c 	struct mtd_info *mtd;
mtd              1261 drivers/mtd/spi-nor/cadence-quadspi.c 		mtd = &nor->mtd;
mtd              1263 drivers/mtd/spi-nor/cadence-quadspi.c 		mtd->priv = nor;
mtd              1277 drivers/mtd/spi-nor/cadence-quadspi.c 		mtd->name = devm_kasprintf(dev, GFP_KERNEL, "%s.%d",
mtd              1279 drivers/mtd/spi-nor/cadence-quadspi.c 		if (!mtd->name) {
mtd              1288 drivers/mtd/spi-nor/cadence-quadspi.c 		ret = mtd_device_register(mtd, NULL, 0);
mtd              1294 drivers/mtd/spi-nor/cadence-quadspi.c 		if (mtd->size <= cqspi->ahb_size) {
mtd              1297 drivers/mtd/spi-nor/cadence-quadspi.c 				mtd->name);
mtd              1309 drivers/mtd/spi-nor/cadence-quadspi.c 			mtd_device_unregister(&cqspi->f_pdata[i].nor.mtd);
mtd              1448 drivers/mtd/spi-nor/cadence-quadspi.c 			mtd_device_unregister(&cqspi->f_pdata[i].nor.mtd);
mtd               330 drivers/mtd/spi-nor/hisi-sfc.c 	struct mtd_info *mtd;
mtd               372 drivers/mtd/spi-nor/hisi-sfc.c 	mtd = &nor->mtd;
mtd               373 drivers/mtd/spi-nor/hisi-sfc.c 	mtd->name = np->name;
mtd               374 drivers/mtd/spi-nor/hisi-sfc.c 	ret = mtd_device_register(mtd, NULL, 0);
mtd               388 drivers/mtd/spi-nor/hisi-sfc.c 		mtd_device_unregister(&host->nor[i]->mtd);
mtd               742 drivers/mtd/spi-nor/intel-spi.c 	size_t erase_size, len = nor->mtd.erasesize;
mtd               916 drivers/mtd/spi-nor/intel-spi.c 		ispi->nor.mtd.flags &= ~MTD_WRITEABLE;
mtd               918 drivers/mtd/spi-nor/intel-spi.c 	ret = mtd_device_register(&ispi->nor.mtd, &part, 1);
mtd               928 drivers/mtd/spi-nor/intel-spi.c 	return mtd_device_unregister(&ispi->nor.mtd);
mtd               447 drivers/mtd/spi-nor/mtk-quadspi.c 	nor->mtd.name = "mtk_nor";
mtd               453 drivers/mtd/spi-nor/mtk-quadspi.c 	return mtd_device_register(&nor->mtd, NULL, 0);
mtd               364 drivers/mtd/spi-nor/nxp-spifi.c 	ret = mtd_device_register(&spifi->nor.mtd, NULL, 0);
mtd               454 drivers/mtd/spi-nor/nxp-spifi.c 	mtd_device_unregister(&spifi->nor.mtd);
mtd               535 drivers/mtd/spi-nor/spi-nor.c static struct spi_nor *mtd_to_spi_nor(struct mtd_info *mtd)
mtd               537 drivers/mtd/spi-nor/spi-nor.c 	return mtd->priv;
mtd               862 drivers/mtd/spi-nor/spi-nor.c 	dev_dbg(nor->dev, " %lldKiB\n", (long long)(nor->mtd.size >> 10));
mtd              1239 drivers/mtd/spi-nor/spi-nor.c static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd              1241 drivers/mtd/spi-nor/spi-nor.c 	struct spi_nor *nor = mtd_to_spi_nor(mtd);
mtd              1250 drivers/mtd/spi-nor/spi-nor.c 		div_u64_rem(instr->len, mtd->erasesize, &rem);
mtd              1263 drivers/mtd/spi-nor/spi-nor.c 	if (len == mtd->size && !(nor->flags & SNOR_F_NO_OP_CHIP_ERASE)) {
mtd              1281 drivers/mtd/spi-nor/spi-nor.c 			      (unsigned long)(mtd->size / SZ_2M));
mtd              1300 drivers/mtd/spi-nor/spi-nor.c 			addr += mtd->erasesize;
mtd              1301 drivers/mtd/spi-nor/spi-nor.c 			len -= mtd->erasesize;
mtd              1347 drivers/mtd/spi-nor/spi-nor.c 	struct mtd_info *mtd = &nor->mtd;
mtd              1358 drivers/mtd/spi-nor/spi-nor.c 		*len = mtd->size >> pow;
mtd              1362 drivers/mtd/spi-nor/spi-nor.c 			*ofs = mtd->size - *len;
mtd              1435 drivers/mtd/spi-nor/spi-nor.c 	struct mtd_info *mtd = &nor->mtd;
mtd              1456 drivers/mtd/spi-nor/spi-nor.c 	if (!stm_is_locked_sr(nor, ofs + len, mtd->size - (ofs + len),
mtd              1468 drivers/mtd/spi-nor/spi-nor.c 		lock_len = mtd->size - ofs;
mtd              1481 drivers/mtd/spi-nor/spi-nor.c 	pow = ilog2(mtd->size) - ilog2(lock_len);
mtd              1515 drivers/mtd/spi-nor/spi-nor.c 	struct mtd_info *mtd = &nor->mtd;
mtd              1536 drivers/mtd/spi-nor/spi-nor.c 	if (!stm_is_unlocked_sr(nor, ofs + len, mtd->size - (ofs + len),
mtd              1548 drivers/mtd/spi-nor/spi-nor.c 		lock_len = mtd->size - (ofs + len);
mtd              1561 drivers/mtd/spi-nor/spi-nor.c 	pow = ilog2(mtd->size) - order_base_2(lock_len);
mtd              1615 drivers/mtd/spi-nor/spi-nor.c static int spi_nor_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd              1617 drivers/mtd/spi-nor/spi-nor.c 	struct spi_nor *nor = mtd_to_spi_nor(mtd);
mtd              1630 drivers/mtd/spi-nor/spi-nor.c static int spi_nor_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd              1632 drivers/mtd/spi-nor/spi-nor.c 	struct spi_nor *nor = mtd_to_spi_nor(mtd);
mtd              1645 drivers/mtd/spi-nor/spi-nor.c static int spi_nor_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len)
mtd              1647 drivers/mtd/spi-nor/spi-nor.c 	struct spi_nor *nor = mtd_to_spi_nor(mtd);
mtd              2544 drivers/mtd/spi-nor/spi-nor.c static int spi_nor_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd              2547 drivers/mtd/spi-nor/spi-nor.c 	struct spi_nor *nor = mtd_to_spi_nor(mtd);
mtd              2583 drivers/mtd/spi-nor/spi-nor.c static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd              2586 drivers/mtd/spi-nor/spi-nor.c 	struct spi_nor *nor = mtd_to_spi_nor(mtd);
mtd              2667 drivers/mtd/spi-nor/spi-nor.c static int spi_nor_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd              2670 drivers/mtd/spi-nor/spi-nor.c 	struct spi_nor *nor = mtd_to_spi_nor(mtd);
mtd              2766 drivers/mtd/spi-nor/spi-nor.c 		nor->mtd.writebufsize = nor->page_size;
mtd              2767 drivers/mtd/spi-nor/spi-nor.c 		nor->mtd.size = 8 * nor->page_size * nor->info->n_sectors;
mtd              2768 drivers/mtd/spi-nor/spi-nor.c 		nor->mtd.erasesize = 8 * nor->page_size;
mtd              2772 drivers/mtd/spi-nor/spi-nor.c 		nor->mtd.erasesize = nor->info->sector_size;
mtd              2940 drivers/mtd/spi-nor/spi-nor.c 		if (nor->mtd.size > SZ_16M)
mtd              4271 drivers/mtd/spi-nor/spi-nor.c 	struct mtd_info *mtd = &nor->mtd;
mtd              4293 drivers/mtd/spi-nor/spi-nor.c 		mtd->erasesize = erase->size;
mtd              4311 drivers/mtd/spi-nor/spi-nor.c 	mtd->erasesize = erase->size;
mtd              4554 drivers/mtd/spi-nor/spi-nor.c 	nor->mtd.erasesize = nor->info->sector_size;
mtd              4716 drivers/mtd/spi-nor/spi-nor.c static void spi_nor_resume(struct mtd_info *mtd)
mtd              4718 drivers/mtd/spi-nor/spi-nor.c 	struct spi_nor *nor = mtd_to_spi_nor(mtd);
mtd              4755 drivers/mtd/spi-nor/spi-nor.c 	} else if (nor->mtd.size > 0x1000000) {
mtd              4779 drivers/mtd/spi-nor/spi-nor.c 	struct mtd_info *mtd = &nor->mtd;
mtd              4781 drivers/mtd/spi-nor/spi-nor.c 	mtd->dbg.partname = info->name;
mtd              4782 drivers/mtd/spi-nor/spi-nor.c 	mtd->dbg.partid = devm_kasprintf(nor->dev, GFP_KERNEL, "spi-nor:%*phN",
mtd              4831 drivers/mtd/spi-nor/spi-nor.c 	struct mtd_info *mtd = &nor->mtd;
mtd              4894 drivers/mtd/spi-nor/spi-nor.c 	if (!mtd->name)
mtd              4895 drivers/mtd/spi-nor/spi-nor.c 		mtd->name = dev_name(dev);
mtd              4896 drivers/mtd/spi-nor/spi-nor.c 	mtd->priv = nor;
mtd              4897 drivers/mtd/spi-nor/spi-nor.c 	mtd->type = MTD_NORFLASH;
mtd              4898 drivers/mtd/spi-nor/spi-nor.c 	mtd->writesize = 1;
mtd              4899 drivers/mtd/spi-nor/spi-nor.c 	mtd->flags = MTD_CAP_NORFLASH;
mtd              4900 drivers/mtd/spi-nor/spi-nor.c 	mtd->size = params->size;
mtd              4901 drivers/mtd/spi-nor/spi-nor.c 	mtd->_erase = spi_nor_erase;
mtd              4902 drivers/mtd/spi-nor/spi-nor.c 	mtd->_read = spi_nor_read;
mtd              4903 drivers/mtd/spi-nor/spi-nor.c 	mtd->_resume = spi_nor_resume;
mtd              4906 drivers/mtd/spi-nor/spi-nor.c 		mtd->_lock = spi_nor_lock;
mtd              4907 drivers/mtd/spi-nor/spi-nor.c 		mtd->_unlock = spi_nor_unlock;
mtd              4908 drivers/mtd/spi-nor/spi-nor.c 		mtd->_is_locked = spi_nor_is_locked;
mtd              4913 drivers/mtd/spi-nor/spi-nor.c 		mtd->_write = sst_write;
mtd              4915 drivers/mtd/spi-nor/spi-nor.c 		mtd->_write = spi_nor_write;
mtd              4927 drivers/mtd/spi-nor/spi-nor.c 		mtd->flags |= MTD_NO_ERASE;
mtd              4929 drivers/mtd/spi-nor/spi-nor.c 	mtd->dev.parent = dev;
mtd              4931 drivers/mtd/spi-nor/spi-nor.c 	mtd->writebufsize = nor->page_size;
mtd              4959 drivers/mtd/spi-nor/spi-nor.c 			(long long)mtd->size >> 10);
mtd              4964 drivers/mtd/spi-nor/spi-nor.c 		mtd->name, (long long)mtd->size, (long long)(mtd->size >> 20),
mtd              4965 drivers/mtd/spi-nor/spi-nor.c 		mtd->erasesize, mtd->erasesize / 1024, mtd->numeraseregions);
mtd              4967 drivers/mtd/spi-nor/spi-nor.c 	if (mtd->numeraseregions)
mtd              4968 drivers/mtd/spi-nor/spi-nor.c 		for (i = 0; i < mtd->numeraseregions; i++)
mtd              4973 drivers/mtd/spi-nor/spi-nor.c 				i, (long long)mtd->eraseregions[i].offset,
mtd              4974 drivers/mtd/spi-nor/spi-nor.c 				mtd->eraseregions[i].erasesize,
mtd              4975 drivers/mtd/spi-nor/spi-nor.c 				mtd->eraseregions[i].erasesize / 1024,
mtd              4976 drivers/mtd/spi-nor/spi-nor.c 				mtd->eraseregions[i].numblocks);
mtd              5005 drivers/mtd/spi-nor/spi-nor.c 		nor->mtd.name = data->name;
mtd              5007 drivers/mtd/spi-nor/spi-nor.c 	if (!nor->mtd.name)
mtd              5008 drivers/mtd/spi-nor/spi-nor.c 		nor->mtd.name = spi_mem_get_name(spimem);
mtd              5042 drivers/mtd/spi-nor/spi-nor.c 	return mtd_device_register(&nor->mtd, data ? data->parts : NULL,
mtd              5053 drivers/mtd/spi-nor/spi-nor.c 	return mtd_device_unregister(&nor->mtd);
mtd               103 drivers/mtd/ssfdc.c static int get_valid_cis_sector(struct mtd_info *mtd)
mtd               121 drivers/mtd/ssfdc.c 	for (k = 0, offset = 0; k < 4; k++, offset += mtd->erasesize) {
mtd               122 drivers/mtd/ssfdc.c 		if (mtd_block_isbad(mtd, offset)) {
mtd               123 drivers/mtd/ssfdc.c 			ret = mtd_read(mtd, offset, SECTOR_SIZE, &retlen,
mtd               136 drivers/mtd/ssfdc.c 					" on %s (mtd%d)\n", mtd->name,
mtd               137 drivers/mtd/ssfdc.c 					mtd->index);
mtd               149 drivers/mtd/ssfdc.c static int read_physical_sector(struct mtd_info *mtd, uint8_t *sect_buf,
mtd               156 drivers/mtd/ssfdc.c 	ret = mtd_read(mtd, offset, SECTOR_SIZE, &retlen, sect_buf);
mtd               164 drivers/mtd/ssfdc.c static int read_raw_oob(struct mtd_info *mtd, loff_t offs, uint8_t *buf)
mtd               175 drivers/mtd/ssfdc.c 	ret = mtd_read_oob(mtd, offs, &ops);
mtd               245 drivers/mtd/ssfdc.c 	struct mtd_info *mtd = ssfdc->mbd.mtd;
mtd               255 drivers/mtd/ssfdc.c 		if (mtd_block_isbad(mtd, offset))
mtd               258 drivers/mtd/ssfdc.c 		ret = read_raw_oob(mtd, offset, oob_buf);
mtd               284 drivers/mtd/ssfdc.c static void ssfdcr_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
mtd               290 drivers/mtd/ssfdc.c 	if (!mtd_type_is_nand(mtd) || mtd->oobsize != OOB_SIZE ||
mtd               291 drivers/mtd/ssfdc.c 	    mtd->size > UINT_MAX)
mtd               295 drivers/mtd/ssfdc.c 	cis_sector = get_valid_cis_sector(mtd);
mtd               303 drivers/mtd/ssfdc.c 	ssfdc->mbd.mtd = mtd;
mtd               308 drivers/mtd/ssfdc.c 	ssfdc->cis_block = cis_sector / (mtd->erasesize >> SECTOR_SHIFT);
mtd               309 drivers/mtd/ssfdc.c 	ssfdc->erase_size = mtd->erasesize;
mtd               310 drivers/mtd/ssfdc.c 	ssfdc->map_len = (u32)mtd->size / mtd->erasesize;
mtd               319 drivers/mtd/ssfdc.c 	get_chs(mtd->size, NULL, &ssfdc->heads, &ssfdc->sectors);
mtd               320 drivers/mtd/ssfdc.c 	ssfdc->cylinders = (unsigned short)(((u32)mtd->size >> SECTOR_SHIFT) /
mtd               349 drivers/mtd/ssfdc.c 		ssfdc->mbd.devnum + 'a', mtd->index, mtd->name);
mtd               397 drivers/mtd/ssfdc.c 		if (read_physical_sector(ssfdc->mbd.mtd, buf, sect_no) < 0)
mtd                10 drivers/mtd/tests/mtd_test.c int mtdtest_erase_eraseblock(struct mtd_info *mtd, unsigned int ebnum)
mtd                14 drivers/mtd/tests/mtd_test.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd                18 drivers/mtd/tests/mtd_test.c 	ei.len  = mtd->erasesize;
mtd                20 drivers/mtd/tests/mtd_test.c 	err = mtd_erase(mtd, &ei);
mtd                29 drivers/mtd/tests/mtd_test.c static int is_block_bad(struct mtd_info *mtd, unsigned int ebnum)
mtd                32 drivers/mtd/tests/mtd_test.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd                34 drivers/mtd/tests/mtd_test.c 	ret = mtd_block_isbad(mtd, addr);
mtd                41 drivers/mtd/tests/mtd_test.c int mtdtest_scan_for_bad_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
mtd                46 drivers/mtd/tests/mtd_test.c 	if (!mtd_can_have_bb(mtd))
mtd                51 drivers/mtd/tests/mtd_test.c 		bbt[i] = is_block_bad(mtd, eb + i) ? 1 : 0;
mtd                61 drivers/mtd/tests/mtd_test.c int mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
mtd                70 drivers/mtd/tests/mtd_test.c 		err = mtdtest_erase_eraseblock(mtd, eb + i);
mtd                79 drivers/mtd/tests/mtd_test.c int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf)
mtd                84 drivers/mtd/tests/mtd_test.c 	err = mtd_read(mtd, addr, size, &read, buf);
mtd                96 drivers/mtd/tests/mtd_test.c int mtdtest_write(struct mtd_info *mtd, loff_t addr, size_t size,
mtd               102 drivers/mtd/tests/mtd_test.c 	err = mtd_write(mtd, addr, size, &written, buf);
mtd                16 drivers/mtd/tests/mtd_test.h int mtdtest_erase_eraseblock(struct mtd_info *mtd, unsigned int ebnum);
mtd                17 drivers/mtd/tests/mtd_test.h int mtdtest_scan_for_bad_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
mtd                19 drivers/mtd/tests/mtd_test.h int mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
mtd                22 drivers/mtd/tests/mtd_test.h int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf);
mtd                23 drivers/mtd/tests/mtd_test.h int mtdtest_write(struct mtd_info *mtd, loff_t addr, size_t size,
mtd                67 drivers/mtd/tests/nandbiterrs.c static struct mtd_info *mtd;   /* MTD device */
mtd                95 drivers/mtd/tests/nandbiterrs.c 	return mtdtest_write(mtd, offset, mtd->writesize, wbuffer);
mtd               108 drivers/mtd/tests/nandbiterrs.c 	ops.len       = mtd->writesize;
mtd               116 drivers/mtd/tests/nandbiterrs.c 	err = mtd_write_oob(mtd, offset, &ops);
mtd               117 drivers/mtd/tests/nandbiterrs.c 	if (err || ops.retlen != mtd->writesize) {
mtd               138 drivers/mtd/tests/nandbiterrs.c 	memcpy(&oldstats, &mtd->ecc_stats, sizeof(oldstats));
mtd               140 drivers/mtd/tests/nandbiterrs.c 	err = mtd_read(mtd, offset, mtd->writesize, &read, rbuffer);
mtd               142 drivers/mtd/tests/nandbiterrs.c 		err = mtd->ecc_stats.corrected - oldstats.corrected;
mtd               144 drivers/mtd/tests/nandbiterrs.c 	if (err < 0 || read != mtd->writesize) {
mtd               161 drivers/mtd/tests/nandbiterrs.c 	for (i = 0; i < mtd->writesize; i++) {
mtd               184 drivers/mtd/tests/nandbiterrs.c 	while (byte < mtd->writesize) {
mtd               208 drivers/mtd/tests/nandbiterrs.c 	for (i = 0; i < mtd->writesize; i++)
mtd               271 drivers/mtd/tests/nandbiterrs.c 	for (i = 0; i < mtd->writesize; i++)
mtd               336 drivers/mtd/tests/nandbiterrs.c 	mtd = get_mtd_device(NULL, dev);
mtd               337 drivers/mtd/tests/nandbiterrs.c 	if (IS_ERR(mtd)) {
mtd               338 drivers/mtd/tests/nandbiterrs.c 		err = PTR_ERR(mtd);
mtd               343 drivers/mtd/tests/nandbiterrs.c 	if (!mtd_type_is_nand(mtd)) {
mtd               350 drivers/mtd/tests/nandbiterrs.c 		(unsigned long long)mtd->size, mtd->erasesize,
mtd               351 drivers/mtd/tests/nandbiterrs.c 		mtd->writesize, mtd->oobsize);
mtd               353 drivers/mtd/tests/nandbiterrs.c 	subsize  = mtd->writesize >> mtd->subpage_sft;
mtd               354 drivers/mtd/tests/nandbiterrs.c 	subcount = mtd->writesize / subsize;
mtd               358 drivers/mtd/tests/nandbiterrs.c 	offset     = (loff_t)page_offset * mtd->writesize;
mtd               359 drivers/mtd/tests/nandbiterrs.c 	eraseblock = mtd_div_by_eb(offset, mtd);
mtd               364 drivers/mtd/tests/nandbiterrs.c 	wbuffer = kmalloc(mtd->writesize, GFP_KERNEL);
mtd               370 drivers/mtd/tests/nandbiterrs.c 	rbuffer = kmalloc(mtd->writesize, GFP_KERNEL);
mtd               376 drivers/mtd/tests/nandbiterrs.c 	err = mtdtest_erase_eraseblock(mtd, eraseblock);
mtd               389 drivers/mtd/tests/nandbiterrs.c 	err = mtdtest_erase_eraseblock(mtd, eraseblock);
mtd               404 drivers/mtd/tests/nandbiterrs.c 	put_mtd_device(mtd);
mtd                31 drivers/mtd/tests/oobtest.c static struct mtd_info *mtd;
mtd                61 drivers/mtd/tests/oobtest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd                64 drivers/mtd/tests/oobtest.c 	for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) {
mtd                73 drivers/mtd/tests/oobtest.c 		err = mtd_write_oob(mtd, addr, &ops);
mtd               170 drivers/mtd/tests/oobtest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd               174 drivers/mtd/tests/oobtest.c 	for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) {
mtd               183 drivers/mtd/tests/oobtest.c 		err = mtd_read_oob(mtd, addr, &ops);
mtd               209 drivers/mtd/tests/oobtest.c 		if (use_offset != 0 || use_len < mtd->oobavail) {
mtd               215 drivers/mtd/tests/oobtest.c 			ops.ooblen    = mtd->oobavail;
mtd               220 drivers/mtd/tests/oobtest.c 			err = mtd_read_oob(mtd, addr, &ops);
mtd               224 drivers/mtd/tests/oobtest.c 			if (err || ops.oobretlen != mtd->oobavail) {
mtd               241 drivers/mtd/tests/oobtest.c 					      mtd->oobavail - k);
mtd               265 drivers/mtd/tests/oobtest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd               266 drivers/mtd/tests/oobtest.c 	size_t len = mtd->oobavail * pgcnt;
mtd               267 drivers/mtd/tests/oobtest.c 	size_t oobavail = mtd->oobavail;
mtd               282 drivers/mtd/tests/oobtest.c 	err = mtd_read_oob(mtd, addr, &ops);
mtd               294 drivers/mtd/tests/oobtest.c 	for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) {
mtd               355 drivers/mtd/tests/oobtest.c 	mtd = get_mtd_device(NULL, dev);
mtd               356 drivers/mtd/tests/oobtest.c 	if (IS_ERR(mtd)) {
mtd               357 drivers/mtd/tests/oobtest.c 		err = PTR_ERR(mtd);
mtd               362 drivers/mtd/tests/oobtest.c 	if (!mtd_type_is_nand(mtd)) {
mtd               367 drivers/mtd/tests/oobtest.c 	tmp = mtd->size;
mtd               368 drivers/mtd/tests/oobtest.c 	do_div(tmp, mtd->erasesize);
mtd               370 drivers/mtd/tests/oobtest.c 	pgcnt = mtd->erasesize / mtd->writesize;
mtd               375 drivers/mtd/tests/oobtest.c 	       (unsigned long long)mtd->size, mtd->erasesize,
mtd               376 drivers/mtd/tests/oobtest.c 	       mtd->writesize, ebcnt, pgcnt, mtd->oobsize);
mtd               379 drivers/mtd/tests/oobtest.c 	readbuf = kmalloc(mtd->erasesize, GFP_KERNEL);
mtd               382 drivers/mtd/tests/oobtest.c 	writebuf = kmalloc(mtd->erasesize, GFP_KERNEL);
mtd               389 drivers/mtd/tests/oobtest.c 	err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               394 drivers/mtd/tests/oobtest.c 	use_len = mtd->oobavail;
mtd               395 drivers/mtd/tests/oobtest.c 	use_len_max = mtd->oobavail;
mtd               401 drivers/mtd/tests/oobtest.c 	err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               421 drivers/mtd/tests/oobtest.c 	err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               454 drivers/mtd/tests/oobtest.c 	err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               460 drivers/mtd/tests/oobtest.c 	use_len = mtd->oobavail;
mtd               461 drivers/mtd/tests/oobtest.c 	use_len_max = mtd->oobavail;
mtd               471 drivers/mtd/tests/oobtest.c 	use_len = mtd->oobavail;
mtd               472 drivers/mtd/tests/oobtest.c 	use_len_max = mtd->oobavail;
mtd               480 drivers/mtd/tests/oobtest.c 	use_len = mtd->oobavail;
mtd               481 drivers/mtd/tests/oobtest.c 	use_len_max = mtd->oobavail;
mtd               487 drivers/mtd/tests/oobtest.c 	err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               493 drivers/mtd/tests/oobtest.c 		addr0 += mtd->erasesize;
mtd               501 drivers/mtd/tests/oobtest.c 	ops.ooboffs   = mtd->oobavail;
mtd               506 drivers/mtd/tests/oobtest.c 	err = mtd_write_oob(mtd, addr0, &ops);
mtd               521 drivers/mtd/tests/oobtest.c 	ops.ooboffs   = mtd->oobavail;
mtd               526 drivers/mtd/tests/oobtest.c 	err = mtd_read_oob(mtd, addr0, &ops);
mtd               546 drivers/mtd/tests/oobtest.c 		ops.ooblen    = mtd->oobavail + 1;
mtd               553 drivers/mtd/tests/oobtest.c 		err = mtd_write_oob(mtd, mtd->size - mtd->writesize, &ops);
mtd               566 drivers/mtd/tests/oobtest.c 		ops.ooblen    = mtd->oobavail + 1;
mtd               573 drivers/mtd/tests/oobtest.c 		err = mtd_read_oob(mtd, mtd->size - mtd->writesize, &ops);
mtd               585 drivers/mtd/tests/oobtest.c 		err = mtdtest_erase_eraseblock(mtd, ebcnt - 1);
mtd               593 drivers/mtd/tests/oobtest.c 		ops.ooblen    = mtd->oobavail;
mtd               600 drivers/mtd/tests/oobtest.c 		err = mtd_write_oob(mtd, mtd->size - mtd->writesize, &ops);
mtd               613 drivers/mtd/tests/oobtest.c 		ops.ooblen    = mtd->oobavail;
mtd               620 drivers/mtd/tests/oobtest.c 		err = mtd_read_oob(mtd, mtd->size - mtd->writesize, &ops);
mtd               637 drivers/mtd/tests/oobtest.c 	err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               647 drivers/mtd/tests/oobtest.c 		size_t sz = mtd->oobavail;
mtd               650 drivers/mtd/tests/oobtest.c 		addr = (loff_t)(i + 1) * mtd->erasesize - mtd->writesize;
mtd               661 drivers/mtd/tests/oobtest.c 			err = mtd_write_oob(mtd, addr, &ops);
mtd               671 drivers/mtd/tests/oobtest.c 			addr += mtd->writesize;
mtd               682 drivers/mtd/tests/oobtest.c 		prandom_bytes_state(&rnd_state, writebuf, mtd->oobavail * 2);
mtd               683 drivers/mtd/tests/oobtest.c 		addr = (loff_t)(i + 1) * mtd->erasesize - mtd->writesize;
mtd               687 drivers/mtd/tests/oobtest.c 		ops.ooblen    = mtd->oobavail * 2;
mtd               692 drivers/mtd/tests/oobtest.c 		err = mtd_read_oob(mtd, addr, &ops);
mtd               699 drivers/mtd/tests/oobtest.c 			       mtd->oobavail * 2)) {
mtd               722 drivers/mtd/tests/oobtest.c 	put_mtd_device(mtd);
mtd                28 drivers/mtd/tests/pagetest.c static struct mtd_info *mtd;
mtd                43 drivers/mtd/tests/pagetest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd                45 drivers/mtd/tests/pagetest.c 	prandom_bytes_state(&rnd_state, writebuf, mtd->erasesize);
mtd                47 drivers/mtd/tests/pagetest.c 	return mtdtest_write(mtd, addr, mtd->erasesize, writebuf);
mtd                55 drivers/mtd/tests/pagetest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd                59 drivers/mtd/tests/pagetest.c 		addr0 += mtd->erasesize;
mtd                61 drivers/mtd/tests/pagetest.c 	addrn = mtd->size;
mtd                63 drivers/mtd/tests/pagetest.c 		addrn -= mtd->erasesize;
mtd                65 drivers/mtd/tests/pagetest.c 	prandom_bytes_state(&rnd_state, writebuf, mtd->erasesize);
mtd                68 drivers/mtd/tests/pagetest.c 		err = mtdtest_read(mtd, addr0, bufsize, twopages);
mtd                71 drivers/mtd/tests/pagetest.c 		err = mtdtest_read(mtd, addrn - bufsize, bufsize, twopages);
mtd                75 drivers/mtd/tests/pagetest.c 		err = mtdtest_read(mtd, addr, bufsize, twopages);
mtd                89 drivers/mtd/tests/pagetest.c 		err = mtdtest_read(mtd, addr0, bufsize, twopages);
mtd                92 drivers/mtd/tests/pagetest.c 		err = mtdtest_read(mtd, addrn - bufsize, bufsize, twopages);
mtd                96 drivers/mtd/tests/pagetest.c 		err = mtdtest_read(mtd, addr, bufsize, twopages);
mtd                99 drivers/mtd/tests/pagetest.c 		memcpy(boundary, writebuf + mtd->erasesize - pgsize, pgsize);
mtd               127 drivers/mtd/tests/pagetest.c 		addr0 += mtd->erasesize;
mtd               129 drivers/mtd/tests/pagetest.c 	addrn = mtd->size;
mtd               131 drivers/mtd/tests/pagetest.c 		addrn -= mtd->erasesize;
mtd               135 drivers/mtd/tests/pagetest.c 	err = mtdtest_read(mtd, addr, pgsize, pp1);
mtd               143 drivers/mtd/tests/pagetest.c 	err = mtdtest_read(mtd, addr, pgsize, pp1);
mtd               152 drivers/mtd/tests/pagetest.c 	err = mtdtest_read(mtd, addr, pgsize, pp2);
mtd               161 drivers/mtd/tests/pagetest.c 	err = mtdtest_read(mtd, addr, pgsize, pp3);
mtd               170 drivers/mtd/tests/pagetest.c 	err = mtdtest_read(mtd, addr, pgsize, pp4);
mtd               199 drivers/mtd/tests/pagetest.c 		addr0 += mtd->erasesize;
mtd               208 drivers/mtd/tests/pagetest.c 	err = mtdtest_erase_eraseblock(mtd, ebnum);
mtd               215 drivers/mtd/tests/pagetest.c 	err = mtdtest_write(mtd, addr0, pgsize, writebuf);
mtd               221 drivers/mtd/tests/pagetest.c 	err = mtdtest_read(mtd, addr0, pgsize, readbuf);
mtd               233 drivers/mtd/tests/pagetest.c 	err = mtdtest_erase_eraseblock(mtd, ebnum);
mtd               240 drivers/mtd/tests/pagetest.c 	err = mtdtest_write(mtd, addr0, pgsize, writebuf);
mtd               245 drivers/mtd/tests/pagetest.c 	err = mtdtest_erase_eraseblock(mtd, ebnum2);
mtd               251 drivers/mtd/tests/pagetest.c 	err = mtdtest_read(mtd, addr0, pgsize, readbuf);
mtd               277 drivers/mtd/tests/pagetest.c 		addr0 += mtd->erasesize;
mtd               282 drivers/mtd/tests/pagetest.c 	err = mtdtest_erase_eraseblock(mtd, ebnum);
mtd               288 drivers/mtd/tests/pagetest.c 	err = mtdtest_write(mtd, addr0, pgsize, writebuf);
mtd               293 drivers/mtd/tests/pagetest.c 	err = mtdtest_erase_eraseblock(mtd, ebnum);
mtd               298 drivers/mtd/tests/pagetest.c 	err = mtdtest_read(mtd, addr0, pgsize, twopages);
mtd               336 drivers/mtd/tests/pagetest.c 	mtd = get_mtd_device(NULL, dev);
mtd               337 drivers/mtd/tests/pagetest.c 	if (IS_ERR(mtd)) {
mtd               338 drivers/mtd/tests/pagetest.c 		err = PTR_ERR(mtd);
mtd               343 drivers/mtd/tests/pagetest.c 	if (!mtd_type_is_nand(mtd)) {
mtd               348 drivers/mtd/tests/pagetest.c 	tmp = mtd->size;
mtd               349 drivers/mtd/tests/pagetest.c 	do_div(tmp, mtd->erasesize);
mtd               351 drivers/mtd/tests/pagetest.c 	pgcnt = mtd->erasesize / mtd->writesize;
mtd               352 drivers/mtd/tests/pagetest.c 	pgsize = mtd->writesize;
mtd               357 drivers/mtd/tests/pagetest.c 	       (unsigned long long)mtd->size, mtd->erasesize,
mtd               358 drivers/mtd/tests/pagetest.c 	       pgsize, ebcnt, pgcnt, mtd->oobsize);
mtd               362 drivers/mtd/tests/pagetest.c 	writebuf = kmalloc(mtd->erasesize, GFP_KERNEL);
mtd               375 drivers/mtd/tests/pagetest.c 	err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               381 drivers/mtd/tests/pagetest.c 	err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               445 drivers/mtd/tests/pagetest.c 	put_mtd_device(mtd);
mtd                26 drivers/mtd/tests/readtest.c static struct mtd_info *mtd;
mtd                38 drivers/mtd/tests/readtest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd                44 drivers/mtd/tests/readtest.c 		ret = mtdtest_read(mtd, addr, pgsize, buf);
mtd                49 drivers/mtd/tests/readtest.c 		if (mtd->oobsize) {
mtd                55 drivers/mtd/tests/readtest.c 			ops.ooblen    = mtd->oobsize;
mtd                60 drivers/mtd/tests/readtest.c 			ret = mtd_read_oob(mtd, addr, &ops);
mtd                62 drivers/mtd/tests/readtest.c 					ops.oobretlen != mtd->oobsize) {
mtd                70 drivers/mtd/tests/readtest.c 			oobbuf += mtd->oobsize;
mtd                86 drivers/mtd/tests/readtest.c 	n = mtd->erasesize;
mtd                96 drivers/mtd/tests/readtest.c 	if (!mtd->oobsize)
mtd                99 drivers/mtd/tests/readtest.c 	n = mtd->oobsize;
mtd               128 drivers/mtd/tests/readtest.c 	mtd = get_mtd_device(NULL, dev);
mtd               129 drivers/mtd/tests/readtest.c 	if (IS_ERR(mtd)) {
mtd               130 drivers/mtd/tests/readtest.c 		err = PTR_ERR(mtd);
mtd               135 drivers/mtd/tests/readtest.c 	if (mtd->writesize == 1) {
mtd               140 drivers/mtd/tests/readtest.c 		pgsize = mtd->writesize;
mtd               142 drivers/mtd/tests/readtest.c 	tmp = mtd->size;
mtd               143 drivers/mtd/tests/readtest.c 	do_div(tmp, mtd->erasesize);
mtd               145 drivers/mtd/tests/readtest.c 	pgcnt = mtd->erasesize / pgsize;
mtd               150 drivers/mtd/tests/readtest.c 	       (unsigned long long)mtd->size, mtd->erasesize,
mtd               151 drivers/mtd/tests/readtest.c 	       pgsize, ebcnt, pgcnt, mtd->oobsize);
mtd               154 drivers/mtd/tests/readtest.c 	iobuf = kmalloc(mtd->erasesize, GFP_KERNEL);
mtd               157 drivers/mtd/tests/readtest.c 	iobuf1 = kmalloc(mtd->erasesize, GFP_KERNEL);
mtd               164 drivers/mtd/tests/readtest.c 	err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               199 drivers/mtd/tests/readtest.c 	put_mtd_device(mtd);
mtd                33 drivers/mtd/tests/speedtest.c static struct mtd_info *mtd;
mtd                47 drivers/mtd/tests/speedtest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd                51 drivers/mtd/tests/speedtest.c 	ei.len  = mtd->erasesize * blocks;
mtd                53 drivers/mtd/tests/speedtest.c 	err = mtd_erase(mtd, &ei);
mtd                65 drivers/mtd/tests/speedtest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd                67 drivers/mtd/tests/speedtest.c 	return mtdtest_write(mtd, addr, mtd->erasesize, iobuf);
mtd                73 drivers/mtd/tests/speedtest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd                77 drivers/mtd/tests/speedtest.c 		err = mtdtest_write(mtd, addr, pgsize, buf);
mtd                91 drivers/mtd/tests/speedtest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd                95 drivers/mtd/tests/speedtest.c 		err = mtdtest_write(mtd, addr, sz, buf);
mtd               102 drivers/mtd/tests/speedtest.c 		err = mtdtest_write(mtd, addr, pgsize, buf);
mtd               109 drivers/mtd/tests/speedtest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd               111 drivers/mtd/tests/speedtest.c 	return mtdtest_read(mtd, addr, mtd->erasesize, iobuf);
mtd               117 drivers/mtd/tests/speedtest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd               121 drivers/mtd/tests/speedtest.c 		err = mtdtest_read(mtd, addr, pgsize, buf);
mtd               135 drivers/mtd/tests/speedtest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd               139 drivers/mtd/tests/speedtest.c 		err = mtdtest_read(mtd, addr, sz, buf);
mtd               146 drivers/mtd/tests/speedtest.c 		err = mtdtest_read(mtd, addr, pgsize, buf);
mtd               169 drivers/mtd/tests/speedtest.c 	k = (uint64_t)goodebcnt * (mtd->erasesize / 1024) * 1000;
mtd               194 drivers/mtd/tests/speedtest.c 	mtd = get_mtd_device(NULL, dev);
mtd               195 drivers/mtd/tests/speedtest.c 	if (IS_ERR(mtd)) {
mtd               196 drivers/mtd/tests/speedtest.c 		err = PTR_ERR(mtd);
mtd               201 drivers/mtd/tests/speedtest.c 	if (mtd->writesize == 1) {
mtd               206 drivers/mtd/tests/speedtest.c 		pgsize = mtd->writesize;
mtd               208 drivers/mtd/tests/speedtest.c 	tmp = mtd->size;
mtd               209 drivers/mtd/tests/speedtest.c 	do_div(tmp, mtd->erasesize);
mtd               211 drivers/mtd/tests/speedtest.c 	pgcnt = mtd->erasesize / pgsize;
mtd               216 drivers/mtd/tests/speedtest.c 	       (unsigned long long)mtd->size, mtd->erasesize,
mtd               217 drivers/mtd/tests/speedtest.c 	       pgsize, ebcnt, pgcnt, mtd->oobsize);
mtd               223 drivers/mtd/tests/speedtest.c 	iobuf = kmalloc(mtd->erasesize, GFP_KERNEL);
mtd               227 drivers/mtd/tests/speedtest.c 	prandom_bytes(iobuf, mtd->erasesize);
mtd               232 drivers/mtd/tests/speedtest.c 	err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               240 drivers/mtd/tests/speedtest.c 	err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               280 drivers/mtd/tests/speedtest.c 	err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               320 drivers/mtd/tests/speedtest.c 	err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               363 drivers/mtd/tests/speedtest.c 	err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               403 drivers/mtd/tests/speedtest.c 	put_mtd_device(mtd);
mtd                32 drivers/mtd/tests/stresstest.c static struct mtd_info *mtd;
mtd                82 drivers/mtd/tests/stresstest.c 		if (offs >= mtd->erasesize)
mtd                83 drivers/mtd/tests/stresstest.c 			offs -= mtd->erasesize;
mtd                84 drivers/mtd/tests/stresstest.c 		if (offs + len > mtd->erasesize)
mtd                85 drivers/mtd/tests/stresstest.c 			len = mtd->erasesize - offs;
mtd                87 drivers/mtd/tests/stresstest.c 	addr = (loff_t)eb * mtd->erasesize + offs;
mtd                88 drivers/mtd/tests/stresstest.c 	return mtdtest_read(mtd, addr, len, readbuf);
mtd                97 drivers/mtd/tests/stresstest.c 	if (offs >= mtd->erasesize) {
mtd                98 drivers/mtd/tests/stresstest.c 		err = mtdtest_erase_eraseblock(mtd, eb);
mtd               105 drivers/mtd/tests/stresstest.c 	if (offs + len > mtd->erasesize) {
mtd               107 drivers/mtd/tests/stresstest.c 			len = mtd->erasesize - offs;
mtd               109 drivers/mtd/tests/stresstest.c 			err = mtdtest_erase_eraseblock(mtd, eb + 1);
mtd               115 drivers/mtd/tests/stresstest.c 	addr = (loff_t)eb * mtd->erasesize + offs;
mtd               116 drivers/mtd/tests/stresstest.c 	err = mtdtest_write(mtd, addr, len, writebuf);
mtd               120 drivers/mtd/tests/stresstest.c 	while (offs > mtd->erasesize) {
mtd               121 drivers/mtd/tests/stresstest.c 		offsets[eb++] = mtd->erasesize;
mtd               122 drivers/mtd/tests/stresstest.c 		offs -= mtd->erasesize;
mtd               153 drivers/mtd/tests/stresstest.c 	mtd = get_mtd_device(NULL, dev);
mtd               154 drivers/mtd/tests/stresstest.c 	if (IS_ERR(mtd)) {
mtd               155 drivers/mtd/tests/stresstest.c 		err = PTR_ERR(mtd);
mtd               160 drivers/mtd/tests/stresstest.c 	if (mtd->writesize == 1) {
mtd               165 drivers/mtd/tests/stresstest.c 		pgsize = mtd->writesize;
mtd               167 drivers/mtd/tests/stresstest.c 	tmp = mtd->size;
mtd               168 drivers/mtd/tests/stresstest.c 	do_div(tmp, mtd->erasesize);
mtd               170 drivers/mtd/tests/stresstest.c 	pgcnt = mtd->erasesize / pgsize;
mtd               175 drivers/mtd/tests/stresstest.c 	       (unsigned long long)mtd->size, mtd->erasesize,
mtd               176 drivers/mtd/tests/stresstest.c 	       pgsize, ebcnt, pgcnt, mtd->oobsize);
mtd               185 drivers/mtd/tests/stresstest.c 	bufsize = mtd->erasesize * 2;
mtd               194 drivers/mtd/tests/stresstest.c 		offsets[i] = mtd->erasesize;
mtd               200 drivers/mtd/tests/stresstest.c 	err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               225 drivers/mtd/tests/stresstest.c 	put_mtd_device(mtd);
mtd                26 drivers/mtd/tests/subpagetest.c static struct mtd_info *mtd;
mtd                47 drivers/mtd/tests/subpagetest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd                50 drivers/mtd/tests/subpagetest.c 	err = mtd_write(mtd, addr, subpgsize, &written, writebuf);
mtd                64 drivers/mtd/tests/subpagetest.c 	err = mtd_write(mtd, addr, subpgsize, &written, writebuf);
mtd                82 drivers/mtd/tests/subpagetest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd                85 drivers/mtd/tests/subpagetest.c 		if (addr + (subpgsize * k) > (loff_t)(ebnum + 1) * mtd->erasesize)
mtd                88 drivers/mtd/tests/subpagetest.c 		err = mtd_write(mtd, addr, subpgsize * k, &written, writebuf);
mtd               121 drivers/mtd/tests/subpagetest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd               125 drivers/mtd/tests/subpagetest.c 	err = mtd_read(mtd, addr, subpgsize, &read, readbuf);
mtd               152 drivers/mtd/tests/subpagetest.c 	err = mtd_read(mtd, addr, subpgsize, &read, readbuf);
mtd               182 drivers/mtd/tests/subpagetest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd               185 drivers/mtd/tests/subpagetest.c 		if (addr + (subpgsize * k) > (loff_t)(ebnum + 1) * mtd->erasesize)
mtd               189 drivers/mtd/tests/subpagetest.c 		err = mtd_read(mtd, addr, subpgsize * k, &read, readbuf);
mtd               217 drivers/mtd/tests/subpagetest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd               220 drivers/mtd/tests/subpagetest.c 	for (j = 0; j < mtd->erasesize / subpgsize; ++j) {
mtd               222 drivers/mtd/tests/subpagetest.c 		err = mtd_read(mtd, addr, subpgsize, &read, readbuf);
mtd               285 drivers/mtd/tests/subpagetest.c 	mtd = get_mtd_device(NULL, dev);
mtd               286 drivers/mtd/tests/subpagetest.c 	if (IS_ERR(mtd)) {
mtd               287 drivers/mtd/tests/subpagetest.c 		err = PTR_ERR(mtd);
mtd               292 drivers/mtd/tests/subpagetest.c 	if (!mtd_type_is_nand(mtd)) {
mtd               297 drivers/mtd/tests/subpagetest.c 	subpgsize = mtd->writesize >> mtd->subpage_sft;
mtd               298 drivers/mtd/tests/subpagetest.c 	tmp = mtd->size;
mtd               299 drivers/mtd/tests/subpagetest.c 	do_div(tmp, mtd->erasesize);
mtd               301 drivers/mtd/tests/subpagetest.c 	pgcnt = mtd->erasesize / mtd->writesize;
mtd               306 drivers/mtd/tests/subpagetest.c 	       (unsigned long long)mtd->size, mtd->erasesize,
mtd               307 drivers/mtd/tests/subpagetest.c 	       mtd->writesize, subpgsize, ebcnt, pgcnt, mtd->oobsize);
mtd               321 drivers/mtd/tests/subpagetest.c 	err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               325 drivers/mtd/tests/subpagetest.c 	err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               363 drivers/mtd/tests/subpagetest.c 	err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               407 drivers/mtd/tests/subpagetest.c 	err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt);
mtd               421 drivers/mtd/tests/subpagetest.c 	put_mtd_device(mtd);
mtd                57 drivers/mtd/tests/torturetest.c static struct mtd_info *mtd;
mtd                93 drivers/mtd/tests/torturetest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd                94 drivers/mtd/tests/torturetest.c 	size_t len = mtd->erasesize;
mtd                97 drivers/mtd/tests/torturetest.c 		addr = (loff_t)(ebnum + 1) * mtd->erasesize - pgcnt * pgsize;
mtd               102 drivers/mtd/tests/torturetest.c 	err = mtd_read(mtd, addr, len, &read, check_buf);
mtd               147 drivers/mtd/tests/torturetest.c 	loff_t addr = (loff_t)ebnum * mtd->erasesize;
mtd               148 drivers/mtd/tests/torturetest.c 	size_t len = mtd->erasesize;
mtd               151 drivers/mtd/tests/torturetest.c 		addr = (loff_t)(ebnum + 1) * mtd->erasesize - pgcnt * pgsize;
mtd               154 drivers/mtd/tests/torturetest.c 	err = mtd_write(mtd, addr, len, &written, buf);
mtd               193 drivers/mtd/tests/torturetest.c 	mtd = get_mtd_device(NULL, dev);
mtd               194 drivers/mtd/tests/torturetest.c 	if (IS_ERR(mtd)) {
mtd               195 drivers/mtd/tests/torturetest.c 		err = PTR_ERR(mtd);
mtd               200 drivers/mtd/tests/torturetest.c 	if (mtd->writesize == 1) {
mtd               205 drivers/mtd/tests/torturetest.c 		pgsize = mtd->writesize;
mtd               207 drivers/mtd/tests/torturetest.c 	if (pgcnt && (pgcnt > mtd->erasesize / pgsize || pgcnt < 0)) {
mtd               213 drivers/mtd/tests/torturetest.c 	patt_5A5 = kmalloc(mtd->erasesize, GFP_KERNEL);
mtd               217 drivers/mtd/tests/torturetest.c 	patt_A5A = kmalloc(mtd->erasesize, GFP_KERNEL);
mtd               221 drivers/mtd/tests/torturetest.c 	patt_FF = kmalloc(mtd->erasesize, GFP_KERNEL);
mtd               225 drivers/mtd/tests/torturetest.c 	check_buf = kmalloc(mtd->erasesize, GFP_KERNEL);
mtd               236 drivers/mtd/tests/torturetest.c 	memset(patt_FF, 0xFF, mtd->erasesize);
mtd               237 drivers/mtd/tests/torturetest.c 	for (i = 0; i < mtd->erasesize / pgsize; i++) {
mtd               247 drivers/mtd/tests/torturetest.c 	err = mtdtest_scan_for_bad_eraseblocks(mtd, bad_ebs, eb, ebcnt);
mtd               256 drivers/mtd/tests/torturetest.c 		err = mtdtest_erase_good_eraseblocks(mtd, bad_ebs, eb, ebcnt);
mtd               349 drivers/mtd/tests/torturetest.c 	put_mtd_device(mtd);
mtd               378 drivers/mtd/tests/torturetest.c 	size_t check_len = mtd->erasesize;
mtd               407 drivers/mtd/tests/torturetest.c 		       (mtd->erasesize - check_len + i) / pgsize,
mtd              1566 drivers/mtd/ubi/attach.c 	if ((int)mtd_div_by_eb(ubi->mtd->size, ubi->mtd) <= UBI_FM_MAX_START) {
mtd               378 drivers/mtd/ubi/build.c 		ret = sprintf(buf, "%d\n", ubi->mtd->index);
mtd               532 drivers/mtd/ubi/build.c 		limit = mtd_max_bad_blocks(ubi->mtd, 0, ubi->mtd->size);
mtd               547 drivers/mtd/ubi/build.c 	device_size = mtd_get_device_size(ubi->mtd);
mtd               548 drivers/mtd/ubi/build.c 	device_pebs = mtd_div_by_eb(device_size, ubi->mtd);
mtd               579 drivers/mtd/ubi/build.c 	if (ubi->mtd->numeraseregions != 0) {
mtd               601 drivers/mtd/ubi/build.c 	ubi->peb_size   = ubi->mtd->erasesize;
mtd               602 drivers/mtd/ubi/build.c 	ubi->peb_count  = mtd_div_by_eb(ubi->mtd->size, ubi->mtd);
mtd               603 drivers/mtd/ubi/build.c 	ubi->flash_size = ubi->mtd->size;
mtd               605 drivers/mtd/ubi/build.c 	if (mtd_can_have_bb(ubi->mtd)) {
mtd               610 drivers/mtd/ubi/build.c 	if (ubi->mtd->type == MTD_NORFLASH) {
mtd               611 drivers/mtd/ubi/build.c 		ubi_assert(ubi->mtd->writesize == 1);
mtd               615 drivers/mtd/ubi/build.c 	ubi->min_io_size = ubi->mtd->writesize;
mtd               616 drivers/mtd/ubi/build.c 	ubi->hdrs_min_io_size = ubi->mtd->writesize >> ubi->mtd->subpage_sft;
mtd               633 drivers/mtd/ubi/build.c 	ubi->max_write_size = ubi->mtd->writebufsize;
mtd               714 drivers/mtd/ubi/build.c 	if (!(ubi->mtd->flags & MTD_WRITEABLE)) {
mtd               716 drivers/mtd/ubi/build.c 			ubi->mtd->index);
mtd               804 drivers/mtd/ubi/build.c int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
mtd               824 drivers/mtd/ubi/build.c 		if (ubi && mtd->index == ubi->mtd->index) {
mtd               826 drivers/mtd/ubi/build.c 				mtd->index, i);
mtd               839 drivers/mtd/ubi/build.c 	if (mtd->type == MTD_UBIVOLUME) {
mtd               841 drivers/mtd/ubi/build.c 			mtd->index);
mtd               850 drivers/mtd/ubi/build.c 	if (mtd->type == MTD_MLCNANDFLASH) {
mtd               852 drivers/mtd/ubi/build.c 			mtd->index);
mtd               886 drivers/mtd/ubi/build.c 	ubi->mtd = mtd;
mtd               899 drivers/mtd/ubi/build.c 	ubi->fm_pool.max_size = min(((int)mtd_div_by_eb(ubi->mtd->size,
mtd               900 drivers/mtd/ubi/build.c 		ubi->mtd) / 100) * 5, UBI_FM_MAX_POOL_SIZE);
mtd               909 drivers/mtd/ubi/build.c 	if (!ubi->fm_disabled && (int)mtd_div_by_eb(ubi->mtd->size, ubi->mtd)
mtd               929 drivers/mtd/ubi/build.c 	ubi_msg(ubi, "attaching mtd%d", mtd->index);
mtd               949 drivers/mtd/ubi/build.c 			mtd->index, err);
mtd               979 drivers/mtd/ubi/build.c 		mtd->index, mtd->name, ubi->flash_size >> 20);
mtd              1066 drivers/mtd/ubi/build.c 	ubi_msg(ubi, "detaching mtd%d", ubi->mtd->index);
mtd              1093 drivers/mtd/ubi/build.c 	ubi_msg(ubi, "mtd%d is detached", ubi->mtd->index);
mtd              1094 drivers/mtd/ubi/build.c 	put_mtd_device(ubi->mtd);
mtd              1151 drivers/mtd/ubi/build.c 	struct mtd_info *mtd;
mtd              1161 drivers/mtd/ubi/build.c 		mtd = get_mtd_device_nm(mtd_dev);
mtd              1162 drivers/mtd/ubi/build.c 		if (IS_ERR(mtd) && PTR_ERR(mtd) == -ENODEV)
mtd              1164 drivers/mtd/ubi/build.c 			mtd = open_mtd_by_chdev(mtd_dev);
mtd              1166 drivers/mtd/ubi/build.c 		mtd = get_mtd_device(NULL, mtd_num);
mtd              1168 drivers/mtd/ubi/build.c 	return mtd;
mtd              1212 drivers/mtd/ubi/build.c 		struct mtd_info *mtd;
mtd              1216 drivers/mtd/ubi/build.c 		mtd = open_mtd_device(p->name);
mtd              1217 drivers/mtd/ubi/build.c 		if (IS_ERR(mtd)) {
mtd              1218 drivers/mtd/ubi/build.c 			err = PTR_ERR(mtd);
mtd              1228 drivers/mtd/ubi/build.c 		err = ubi_attach_mtd_dev(mtd, p->ubi_num,
mtd              1233 drivers/mtd/ubi/build.c 			       mtd->index);
mtd              1234 drivers/mtd/ubi/build.c 			put_mtd_device(mtd);
mtd              1431 drivers/mtd/ubi/build.c module_param_call(mtd, ubi_mtd_param_parse, NULL, NULL, 0400);
mtd              1432 drivers/mtd/ubi/build.c MODULE_PARM_DESC(mtd, "MTD devices to attach. Parameter format: mtd=<name|num|path>[,<vid_hdr_offs>[,max_beb_per1024[,ubi_num]]].\n"
mtd              1017 drivers/mtd/ubi/cdev.c 		struct mtd_info *mtd;
mtd              1032 drivers/mtd/ubi/cdev.c 		mtd = get_mtd_device(NULL, req.mtd_num);
mtd              1033 drivers/mtd/ubi/cdev.c 		if (IS_ERR(mtd)) {
mtd              1034 drivers/mtd/ubi/cdev.c 			err = PTR_ERR(mtd);
mtd              1043 drivers/mtd/ubi/cdev.c 		err = ubi_attach_mtd_dev(mtd, req.ubi_num, req.vid_hdr_offset,
mtd              1047 drivers/mtd/ubi/cdev.c 			put_mtd_device(mtd);
mtd                32 drivers/mtd/ubi/debug.c 	err = mtd_read(ubi->mtd, addr, len, &read, buf);
mtd                44 drivers/mtd/ubi/gluebi.c 	struct mtd_info mtd;
mtd                84 drivers/mtd/ubi/gluebi.c static int gluebi_get_device(struct mtd_info *mtd)
mtd                89 drivers/mtd/ubi/gluebi.c 	if (mtd->flags & MTD_WRITEABLE)
mtd                92 drivers/mtd/ubi/gluebi.c 	gluebi = container_of(mtd, struct gluebi_device, mtd);
mtd               130 drivers/mtd/ubi/gluebi.c static void gluebi_put_device(struct mtd_info *mtd)
mtd               134 drivers/mtd/ubi/gluebi.c 	gluebi = container_of(mtd, struct gluebi_device, mtd);
mtd               153 drivers/mtd/ubi/gluebi.c static int gluebi_read(struct mtd_info *mtd, loff_t from, size_t len,
mtd               159 drivers/mtd/ubi/gluebi.c 	gluebi = container_of(mtd, struct gluebi_device, mtd);
mtd               160 drivers/mtd/ubi/gluebi.c 	lnum = div_u64_rem(from, mtd->erasesize, &offs);
mtd               163 drivers/mtd/ubi/gluebi.c 		size_t to_read = mtd->erasesize - offs;
mtd               193 drivers/mtd/ubi/gluebi.c static int gluebi_write(struct mtd_info *mtd, loff_t to, size_t len,
mtd               199 drivers/mtd/ubi/gluebi.c 	gluebi = container_of(mtd, struct gluebi_device, mtd);
mtd               200 drivers/mtd/ubi/gluebi.c 	lnum = div_u64_rem(to, mtd->erasesize, &offs);
mtd               202 drivers/mtd/ubi/gluebi.c 	if (len % mtd->writesize || offs % mtd->writesize)
mtd               207 drivers/mtd/ubi/gluebi.c 		size_t to_write = mtd->erasesize - offs;
mtd               234 drivers/mtd/ubi/gluebi.c static int gluebi_erase(struct mtd_info *mtd, struct erase_info *instr)
mtd               239 drivers/mtd/ubi/gluebi.c 	if (mtd_mod_by_ws(instr->addr, mtd) || mtd_mod_by_ws(instr->len, mtd))
mtd               242 drivers/mtd/ubi/gluebi.c 	lnum = mtd_div_by_eb(instr->addr, mtd);
mtd               243 drivers/mtd/ubi/gluebi.c 	count = mtd_div_by_eb(instr->len, mtd);
mtd               244 drivers/mtd/ubi/gluebi.c 	gluebi = container_of(mtd, struct gluebi_device, mtd);
mtd               265 drivers/mtd/ubi/gluebi.c 	instr->fail_addr = (long long)lnum * mtd->erasesize;
mtd               282 drivers/mtd/ubi/gluebi.c 	struct mtd_info *mtd;
mtd               288 drivers/mtd/ubi/gluebi.c 	mtd = &gluebi->mtd;
mtd               289 drivers/mtd/ubi/gluebi.c 	mtd->name = kmemdup(vi->name, vi->name_len + 1, GFP_KERNEL);
mtd               290 drivers/mtd/ubi/gluebi.c 	if (!mtd->name) {
mtd               297 drivers/mtd/ubi/gluebi.c 	mtd->type = MTD_UBIVOLUME;
mtd               299 drivers/mtd/ubi/gluebi.c 		mtd->flags = MTD_WRITEABLE;
mtd               300 drivers/mtd/ubi/gluebi.c 	mtd->owner      = THIS_MODULE;
mtd               301 drivers/mtd/ubi/gluebi.c 	mtd->writesize  = di->min_io_size;
mtd               302 drivers/mtd/ubi/gluebi.c 	mtd->erasesize  = vi->usable_leb_size;
mtd               303 drivers/mtd/ubi/gluebi.c 	mtd->_read       = gluebi_read;
mtd               304 drivers/mtd/ubi/gluebi.c 	mtd->_write      = gluebi_write;
mtd               305 drivers/mtd/ubi/gluebi.c 	mtd->_erase      = gluebi_erase;
mtd               306 drivers/mtd/ubi/gluebi.c 	mtd->_get_device = gluebi_get_device;
mtd               307 drivers/mtd/ubi/gluebi.c 	mtd->_put_device = gluebi_put_device;
mtd               315 drivers/mtd/ubi/gluebi.c 		mtd->size = (unsigned long long)vi->usable_leb_size * vi->size;
mtd               317 drivers/mtd/ubi/gluebi.c 		mtd->size = vi->used_bytes;
mtd               324 drivers/mtd/ubi/gluebi.c 			g->mtd.index, vi->ubi_num, vi->vol_id);
mtd               327 drivers/mtd/ubi/gluebi.c 	if (mtd_device_register(mtd, NULL, 0)) {
mtd               329 drivers/mtd/ubi/gluebi.c 		kfree(mtd->name);
mtd               351 drivers/mtd/ubi/gluebi.c 	struct mtd_info *mtd;
mtd               368 drivers/mtd/ubi/gluebi.c 	mtd = &gluebi->mtd;
mtd               369 drivers/mtd/ubi/gluebi.c 	err = mtd_device_unregister(mtd);
mtd               372 drivers/mtd/ubi/gluebi.c 			mtd->index, gluebi->ubi_num, gluebi->vol_id, err);
mtd               379 drivers/mtd/ubi/gluebi.c 	kfree(mtd->name);
mtd               408 drivers/mtd/ubi/gluebi.c 		gluebi->mtd.size = vi->used_bytes;
mtd               433 drivers/mtd/ubi/gluebi.c 	gluebi->mtd.size = vi->used_bytes;
mtd               483 drivers/mtd/ubi/gluebi.c 		struct mtd_info *mtd = &gluebi->mtd;
mtd               485 drivers/mtd/ubi/gluebi.c 		err = mtd_device_unregister(mtd);
mtd               488 drivers/mtd/ubi/gluebi.c 				err, mtd->index, gluebi->ubi_num,
mtd               490 drivers/mtd/ubi/gluebi.c 		kfree(mtd->name);
mtd               154 drivers/mtd/ubi/io.c 	err = mtd_read(ubi->mtd, addr, len, &read, buf);
mtd               271 drivers/mtd/ubi/io.c 	err = mtd_write(ubi->mtd, addr, len, &written, buf);
mtd               326 drivers/mtd/ubi/io.c 	err = mtd_erase(ubi->mtd, &ei);
mtd               478 drivers/mtd/ubi/io.c 		err = mtd_write(ubi->mtd, addr, 4, &written, (void *)&data);
mtd               490 drivers/mtd/ubi/io.c 		err = mtd_write(ubi->mtd, addr, 4, &written, (void *)&data);
mtd               567 drivers/mtd/ubi/io.c 	struct mtd_info *mtd = ubi->mtd;
mtd               574 drivers/mtd/ubi/io.c 		ret = mtd_block_isbad(mtd, (loff_t)pnum * ubi->peb_size);
mtd               597 drivers/mtd/ubi/io.c 	struct mtd_info *mtd = ubi->mtd;
mtd               609 drivers/mtd/ubi/io.c 	err = mtd_block_markbad(mtd, (loff_t)pnum * ubi->peb_size);
mtd              1306 drivers/mtd/ubi/io.c 	err = mtd_read(ubi->mtd, addr, len, &read, buf1);
mtd              1370 drivers/mtd/ubi/io.c 	err = mtd_read(ubi->mtd, addr, len, &read, buf);
mtd               767 drivers/mtd/ubi/kapi.c 	mtd_sync(ubi->mtd);
mtd               647 drivers/mtd/ubi/ubi.h 	struct mtd_info *mtd;
mtd               939 drivers/mtd/ubi/ubi.h int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
mtd              6111 drivers/net/ethernet/sfc/ef10.c 	part->common.mtd.type = MTD_NORFLASH;
mtd              6112 drivers/net/ethernet/sfc/ef10.c 	part->common.mtd.flags = MTD_CAP_NORFLASH;
mtd              6113 drivers/net/ethernet/sfc/ef10.c 	part->common.mtd.size = size;
mtd              6114 drivers/net/ethernet/sfc/ef10.c 	part->common.mtd.erasesize = erase_size;
mtd              6117 drivers/net/ethernet/sfc/ef10.c 		part->common.mtd.flags |= MTD_NO_ERASE;
mtd               654 drivers/net/ethernet/sfc/falcon/falcon.c #define to_falcon_mtd_partition(mtd)				\
mtd               655 drivers/net/ethernet/sfc/falcon/falcon.c 	container_of(mtd, struct falcon_mtd_partition, common.mtd)
mtd               743 drivers/net/ethernet/sfc/falcon/falcon.c 	struct ef4_nic *efx = part->common.mtd.priv;
mtd               807 drivers/net/ethernet/sfc/falcon/falcon.c 	struct ef4_nic *efx = part->common.mtd.priv;
mtd               853 drivers/net/ethernet/sfc/falcon/falcon.c 	struct ef4_nic *efx = part->mtd.priv;
mtd               859 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_mtd_read(struct mtd_info *mtd, loff_t start,
mtd               862 drivers/net/ethernet/sfc/falcon/falcon.c 	struct falcon_mtd_partition *part = to_falcon_mtd_partition(mtd);
mtd               863 drivers/net/ethernet/sfc/falcon/falcon.c 	struct ef4_nic *efx = mtd->priv;
mtd               876 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len)
mtd               878 drivers/net/ethernet/sfc/falcon/falcon.c 	struct falcon_mtd_partition *part = to_falcon_mtd_partition(mtd);
mtd               879 drivers/net/ethernet/sfc/falcon/falcon.c 	struct ef4_nic *efx = mtd->priv;
mtd               891 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_mtd_write(struct mtd_info *mtd, loff_t start,
mtd               894 drivers/net/ethernet/sfc/falcon/falcon.c 	struct falcon_mtd_partition *part = to_falcon_mtd_partition(mtd);
mtd               895 drivers/net/ethernet/sfc/falcon/falcon.c 	struct ef4_nic *efx = mtd->priv;
mtd               908 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_mtd_sync(struct mtd_info *mtd)
mtd               910 drivers/net/ethernet/sfc/falcon/falcon.c 	struct falcon_mtd_partition *part = to_falcon_mtd_partition(mtd);
mtd               911 drivers/net/ethernet/sfc/falcon/falcon.c 	struct ef4_nic *efx = mtd->priv;
mtd               943 drivers/net/ethernet/sfc/falcon/falcon.c 		parts[n_parts].common.mtd.type = MTD_NORFLASH;
mtd               944 drivers/net/ethernet/sfc/falcon/falcon.c 		parts[n_parts].common.mtd.flags = MTD_CAP_NORFLASH;
mtd               945 drivers/net/ethernet/sfc/falcon/falcon.c 		parts[n_parts].common.mtd.size = spi->size - FALCON_FLASH_BOOTCODE_START;
mtd               946 drivers/net/ethernet/sfc/falcon/falcon.c 		parts[n_parts].common.mtd.erasesize = spi->erase_size;
mtd               956 drivers/net/ethernet/sfc/falcon/falcon.c 		parts[n_parts].common.mtd.type = MTD_RAM;
mtd               957 drivers/net/ethernet/sfc/falcon/falcon.c 		parts[n_parts].common.mtd.flags = MTD_CAP_RAM;
mtd               958 drivers/net/ethernet/sfc/falcon/falcon.c 		parts[n_parts].common.mtd.size =
mtd               961 drivers/net/ethernet/sfc/falcon/falcon.c 		parts[n_parts].common.mtd.erasesize = spi->erase_size;
mtd                16 drivers/net/ethernet/sfc/falcon/mtd.c #define to_ef4_mtd_partition(mtd)				\
mtd                17 drivers/net/ethernet/sfc/falcon/mtd.c 	container_of(mtd, struct ef4_mtd_partition, mtd)
mtd                21 drivers/net/ethernet/sfc/falcon/mtd.c static int ef4_mtd_erase(struct mtd_info *mtd, struct erase_info *erase)
mtd                23 drivers/net/ethernet/sfc/falcon/mtd.c 	struct ef4_nic *efx = mtd->priv;
mtd                25 drivers/net/ethernet/sfc/falcon/mtd.c 	return efx->type->mtd_erase(mtd, erase->addr, erase->len);
mtd                28 drivers/net/ethernet/sfc/falcon/mtd.c static void ef4_mtd_sync(struct mtd_info *mtd)
mtd                30 drivers/net/ethernet/sfc/falcon/mtd.c 	struct ef4_mtd_partition *part = to_ef4_mtd_partition(mtd);
mtd                31 drivers/net/ethernet/sfc/falcon/mtd.c 	struct ef4_nic *efx = mtd->priv;
mtd                34 drivers/net/ethernet/sfc/falcon/mtd.c 	rc = efx->type->mtd_sync(mtd);
mtd                45 drivers/net/ethernet/sfc/falcon/mtd.c 		rc = mtd_device_unregister(&part->mtd);
mtd                64 drivers/net/ethernet/sfc/falcon/mtd.c 		part->mtd.writesize = 1;
mtd                66 drivers/net/ethernet/sfc/falcon/mtd.c 		part->mtd.owner = THIS_MODULE;
mtd                67 drivers/net/ethernet/sfc/falcon/mtd.c 		part->mtd.priv = efx;
mtd                68 drivers/net/ethernet/sfc/falcon/mtd.c 		part->mtd.name = part->name;
mtd                69 drivers/net/ethernet/sfc/falcon/mtd.c 		part->mtd._erase = ef4_mtd_erase;
mtd                70 drivers/net/ethernet/sfc/falcon/mtd.c 		part->mtd._read = efx->type->mtd_read;
mtd                71 drivers/net/ethernet/sfc/falcon/mtd.c 		part->mtd._write = efx->type->mtd_write;
mtd                72 drivers/net/ethernet/sfc/falcon/mtd.c 		part->mtd._sync = ef4_mtd_sync;
mtd                76 drivers/net/ethernet/sfc/falcon/mtd.c 		if (mtd_device_register(&part->mtd, NULL, 0))
mtd               916 drivers/net/ethernet/sfc/falcon/net_driver.h 	struct mtd_info mtd;
mtd              1131 drivers/net/ethernet/sfc/falcon/net_driver.h 	int (*mtd_read)(struct mtd_info *mtd, loff_t start, size_t len,
mtd              1133 drivers/net/ethernet/sfc/falcon/net_driver.h 	int (*mtd_erase)(struct mtd_info *mtd, loff_t start, size_t len);
mtd              1134 drivers/net/ethernet/sfc/falcon/net_driver.h 	int (*mtd_write)(struct mtd_info *mtd, loff_t start, size_t len,
mtd              1136 drivers/net/ethernet/sfc/falcon/net_driver.h 	int (*mtd_sync)(struct mtd_info *mtd);
mtd              2201 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_mtd_read(struct mtd_info *mtd, loff_t start,
mtd              2204 drivers/net/ethernet/sfc/mcdi.c 	struct efx_mcdi_mtd_partition *part = to_efx_mcdi_mtd_partition(mtd);
mtd              2205 drivers/net/ethernet/sfc/mcdi.c 	struct efx_nic *efx = mtd->priv;
mtd              2207 drivers/net/ethernet/sfc/mcdi.c 	loff_t end = min_t(loff_t, start + len, mtd->size);
mtd              2225 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len)
mtd              2227 drivers/net/ethernet/sfc/mcdi.c 	struct efx_mcdi_mtd_partition *part = to_efx_mcdi_mtd_partition(mtd);
mtd              2228 drivers/net/ethernet/sfc/mcdi.c 	struct efx_nic *efx = mtd->priv;
mtd              2229 drivers/net/ethernet/sfc/mcdi.c 	loff_t offset = start & ~((loff_t)(mtd->erasesize - 1));
mtd              2230 drivers/net/ethernet/sfc/mcdi.c 	loff_t end = min_t(loff_t, start + len, mtd->size);
mtd              2231 drivers/net/ethernet/sfc/mcdi.c 	size_t chunk = part->common.mtd.erasesize;
mtd              2255 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_mtd_write(struct mtd_info *mtd, loff_t start,
mtd              2258 drivers/net/ethernet/sfc/mcdi.c 	struct efx_mcdi_mtd_partition *part = to_efx_mcdi_mtd_partition(mtd);
mtd              2259 drivers/net/ethernet/sfc/mcdi.c 	struct efx_nic *efx = mtd->priv;
mtd              2261 drivers/net/ethernet/sfc/mcdi.c 	loff_t end = min_t(loff_t, start + len, mtd->size);
mtd              2286 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_mtd_sync(struct mtd_info *mtd)
mtd              2288 drivers/net/ethernet/sfc/mcdi.c 	struct efx_mcdi_mtd_partition *part = to_efx_mcdi_mtd_partition(mtd);
mtd              2289 drivers/net/ethernet/sfc/mcdi.c 	struct efx_nic *efx = mtd->priv;
mtd              2304 drivers/net/ethernet/sfc/mcdi.c 	struct efx_nic *efx = part->mtd.priv;
mtd               110 drivers/net/ethernet/sfc/mcdi.h #define to_efx_mcdi_mtd_partition(mtd)				\
mtd               111 drivers/net/ethernet/sfc/mcdi.h 	container_of(mtd, struct efx_mcdi_mtd_partition, common.mtd)
mtd               374 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_mtd_read(struct mtd_info *mtd, loff_t start, size_t len,
mtd               376 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len);
mtd               377 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_mtd_write(struct mtd_info *mtd, loff_t start, size_t len,
mtd               379 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_mtd_sync(struct mtd_info *mtd);
mtd                16 drivers/net/ethernet/sfc/mtd.c #define to_efx_mtd_partition(mtd)				\
mtd                17 drivers/net/ethernet/sfc/mtd.c 	container_of(mtd, struct efx_mtd_partition, mtd)
mtd                21 drivers/net/ethernet/sfc/mtd.c static int efx_mtd_erase(struct mtd_info *mtd, struct erase_info *erase)
mtd                23 drivers/net/ethernet/sfc/mtd.c 	struct efx_nic *efx = mtd->priv;
mtd                25 drivers/net/ethernet/sfc/mtd.c 	return efx->type->mtd_erase(mtd, erase->addr, erase->len);
mtd                28 drivers/net/ethernet/sfc/mtd.c static void efx_mtd_sync(struct mtd_info *mtd)
mtd                30 drivers/net/ethernet/sfc/mtd.c 	struct efx_mtd_partition *part = to_efx_mtd_partition(mtd);
mtd                31 drivers/net/ethernet/sfc/mtd.c 	struct efx_nic *efx = mtd->priv;
mtd                34 drivers/net/ethernet/sfc/mtd.c 	rc = efx->type->mtd_sync(mtd);
mtd                45 drivers/net/ethernet/sfc/mtd.c 		rc = mtd_device_unregister(&part->mtd);
mtd                64 drivers/net/ethernet/sfc/mtd.c 		part->mtd.writesize = 1;
mtd                66 drivers/net/ethernet/sfc/mtd.c 		if (!(part->mtd.flags & MTD_NO_ERASE))
mtd                67 drivers/net/ethernet/sfc/mtd.c 			part->mtd.flags |= MTD_WRITEABLE;
mtd                69 drivers/net/ethernet/sfc/mtd.c 		part->mtd.owner = THIS_MODULE;
mtd                70 drivers/net/ethernet/sfc/mtd.c 		part->mtd.priv = efx;
mtd                71 drivers/net/ethernet/sfc/mtd.c 		part->mtd.name = part->name;
mtd                72 drivers/net/ethernet/sfc/mtd.c 		part->mtd._erase = efx_mtd_erase;
mtd                73 drivers/net/ethernet/sfc/mtd.c 		part->mtd._read = efx->type->mtd_read;
mtd                74 drivers/net/ethernet/sfc/mtd.c 		part->mtd._write = efx->type->mtd_write;
mtd                75 drivers/net/ethernet/sfc/mtd.c 		part->mtd._sync = efx_mtd_sync;
mtd                79 drivers/net/ethernet/sfc/mtd.c 		if (mtd_device_register(&part->mtd, NULL, 0))
mtd              1107 drivers/net/ethernet/sfc/net_driver.h 	struct mtd_info mtd;
mtd              1376 drivers/net/ethernet/sfc/net_driver.h 	int (*mtd_read)(struct mtd_info *mtd, loff_t start, size_t len,
mtd              1378 drivers/net/ethernet/sfc/net_driver.h 	int (*mtd_erase)(struct mtd_info *mtd, loff_t start, size_t len);
mtd              1379 drivers/net/ethernet/sfc/net_driver.h 	int (*mtd_write)(struct mtd_info *mtd, loff_t start, size_t len,
mtd              1381 drivers/net/ethernet/sfc/net_driver.h 	int (*mtd_sync)(struct mtd_info *mtd);
mtd               875 drivers/net/ethernet/sfc/siena.c 	part->common.mtd.type = MTD_NORFLASH;
mtd               876 drivers/net/ethernet/sfc/siena.c 	part->common.mtd.flags = MTD_CAP_NORFLASH;
mtd               877 drivers/net/ethernet/sfc/siena.c 	part->common.mtd.size = size;
mtd               878 drivers/net/ethernet/sfc/siena.c 	part->common.mtd.erasesize = erase_size;
mtd                17 drivers/net/wireless/mediatek/mt76/eeprom.c 	struct mtd_info *mtd;
mtd                45 drivers/net/wireless/mediatek/mt76/eeprom.c 	mtd = get_mtd_device_nm(part);
mtd                46 drivers/net/wireless/mediatek/mt76/eeprom.c 	if (IS_ERR(mtd)) {
mtd                47 drivers/net/wireless/mediatek/mt76/eeprom.c 		ret =  PTR_ERR(mtd);
mtd                57 drivers/net/wireless/mediatek/mt76/eeprom.c 	ret = mtd_read(mtd, offset, len, &retlen, dev->eeprom.data);
mtd                58 drivers/net/wireless/mediatek/mt76/eeprom.c 	put_mtd_device(mtd);
mtd                45 fs/jffs2/background.c 	tsk = kthread_run(jffs2_garbage_collect_thread, c, "jffs2_gcd_mtd%d", c->mtd->index);
mtd                65 fs/jffs2/erase.c 	ret = mtd_erase(c->mtd, instr);
mtd               321 fs/jffs2/erase.c 	ret = mtd_point(c->mtd, jeb->offset, c->sector_size, &retlen,
mtd               332 fs/jffs2/erase.c 			mtd_unpoint(c->mtd, jeb->offset, retlen);
mtd               341 fs/jffs2/erase.c 		mtd_unpoint(c->mtd, jeb->offset, c->sector_size);
mtd               367 fs/jffs2/erase.c 		ret = mtd_read(c->mtd, ofs, readlen, &retlen, ebuf);
mtd               221 fs/jffs2/fs.c  	buf->f_fsid.val[1] = c->mtd->index;
mtd               523 fs/jffs2/fs.c  	if (c->mtd->type == MTD_MLCNANDFLASH)
mtd               527 fs/jffs2/fs.c  	if (c->mtd->type == MTD_NANDFLASH) {
mtd               531 fs/jffs2/fs.c  	if (c->mtd->type == MTD_DATAFLASH) {
mtd               537 fs/jffs2/fs.c  	c->flash_size = c->mtd->size;
mtd               538 fs/jffs2/fs.c  	c->sector_size = c->mtd->erasesize;
mtd                49 fs/jffs2/jffs2_fs_sb.h 	struct mtd_info *mtd;
mtd                80 fs/jffs2/os-linux.h #define jffs2_flash_read(c, ofs, len, retlen, buf) (mtd_read((c)->mtd, ofs, len, retlen, buf))
mtd               108 fs/jffs2/os-linux.h #define jffs2_can_mark_obsolete(c) (c->mtd->flags & (MTD_BIT_WRITEABLE))
mtd               111 fs/jffs2/os-linux.h #define jffs2_cleanmarker_oob(c) (c->mtd->type == MTD_NANDFLASH)
mtd               130 fs/jffs2/os-linux.h #define jffs2_dataflash(c) (c->mtd->type == MTD_DATAFLASH)
mtd               133 fs/jffs2/os-linux.h #define jffs2_ubivol(c) (c->mtd->type == MTD_UBIVOLUME)
mtd               137 fs/jffs2/os-linux.h #define jffs2_nor_wbuf_flash(c) (c->mtd->type == MTD_NORFLASH && ! (c->mtd->flags & MTD_BIT_WRITEABLE))
mtd                67 fs/jffs2/readinode.c 	err = mtd_point(c->mtd, ofs, len, &retlen, (void **)&buffer, NULL);
mtd                70 fs/jffs2/readinode.c 		mtd_unpoint(c->mtd, ofs, retlen);
mtd               104 fs/jffs2/readinode.c 		mtd_unpoint(c->mtd, ofs, len);
mtd               140 fs/jffs2/readinode.c 		mtd_unpoint(c->mtd, ofs, len);
mtd               101 fs/jffs2/scan.c 	ret = mtd_point(c->mtd, 0, c->mtd->size, &pointlen,
mtd               103 fs/jffs2/scan.c 	if (!ret && pointlen < c->mtd->size) {
mtd               107 fs/jffs2/scan.c 		mtd_unpoint(c->mtd, 0, pointlen);
mtd               124 fs/jffs2/scan.c 		flashbuf = mtd_kmalloc_up_to(c->mtd, &try_size);
mtd               281 fs/jffs2/scan.c 		mtd_unpoint(c->mtd, 0, c->mtd->size);
mtd               465 fs/jffs2/scan.c 		if (mtd_block_isbad(c->mtd, jeb->offset))
mtd               212 fs/jffs2/super.c 		if (opt > c->mtd->size)
mtd               214 fs/jffs2/super.c 				      c->mtd->size / 1024);
mtd               255 fs/jffs2/super.c 	c->mtd = sb->s_mtd;
mtd               325 fs/jffs2/super.c 	mtd_sync(c->mtd);
mtd               237 fs/jffs2/wbuf.c 	ret = mtd_read(c->mtd, ofs, c->wbuf_pagesize, &retlen, c->wbuf_verify);
mtd               288 fs/jffs2/wbuf.c 	if (c->wbuf_ofs % c->mtd->erasesize)
mtd               348 fs/jffs2/wbuf.c 		ret = mtd_read(c->mtd, start, c->wbuf_ofs - start, &retlen,
mtd               425 fs/jffs2/wbuf.c 			mtd_write(c->mtd, ofs, towrite, &retlen, brokenbuf);
mtd               429 fs/jffs2/wbuf.c 			ret = mtd_write(c->mtd, ofs, towrite, &retlen,
mtd               632 fs/jffs2/wbuf.c 		mtd_write(c->mtd, c->wbuf_ofs, c->wbuf_pagesize, &retlen,
mtd               638 fs/jffs2/wbuf.c 		ret = mtd_write(c->mtd, c->wbuf_ofs, c->wbuf_pagesize,
mtd               876 fs/jffs2/wbuf.c 			ret = mtd_write(c->mtd, outvec_to, PAGE_DIV(vlen),
mtd               963 fs/jffs2/wbuf.c 		return mtd_read(c->mtd, ofs, len, retlen, buf);
mtd               967 fs/jffs2/wbuf.c 	ret = mtd_read(c->mtd, ofs, len, retlen, buf);
mtd              1046 fs/jffs2/wbuf.c 	ret = mtd_read_oob(c->mtd, jeb->offset, &ops);
mtd              1088 fs/jffs2/wbuf.c 	ret = mtd_read_oob(c->mtd, jeb->offset, &ops);
mtd              1113 fs/jffs2/wbuf.c 	ret = mtd_write_oob(c->mtd, jeb->offset, &ops);
mtd              1142 fs/jffs2/wbuf.c 	ret = mtd_block_markbad(c->mtd, bad_offset);
mtd              1186 fs/jffs2/wbuf.c 	if (!c->mtd->oobsize)
mtd              1192 fs/jffs2/wbuf.c 	if (c->mtd->oobavail == 0) {
mtd              1199 fs/jffs2/wbuf.c 	c->oobavail = c->mtd->oobavail;
mtd              1204 fs/jffs2/wbuf.c 	c->wbuf_pagesize = c->mtd->writesize;
mtd              1243 fs/jffs2/wbuf.c 	c->wbuf_pagesize =  c->mtd->erasesize;
mtd              1253 fs/jffs2/wbuf.c 	c->sector_size = 8 * c->mtd->erasesize;
mtd              1260 fs/jffs2/wbuf.c 	c->flash_size = c->mtd->size;
mtd              1296 fs/jffs2/wbuf.c 	c->cleanmarker_size = max(16u, c->mtd->writesize);
mtd              1302 fs/jffs2/wbuf.c 	c->wbuf_pagesize = c->mtd->writesize;
mtd              1329 fs/jffs2/wbuf.c 	if (c->mtd->writesize == 1)
mtd              1336 fs/jffs2/wbuf.c 	c->wbuf_pagesize =  c->mtd->writesize;
mtd                29 fs/jffs2/writev.c 	return mtd_writev(c->mtd, vecs, count, to, retlen);
mtd                36 fs/jffs2/writev.c 	ret = mtd_write(c->mtd, ofs, len, retlen, buf);
mtd                25 fs/romfs/mmap-nommu.c 	struct mtd_info *mtd = inode->i_sb->s_mtd;
mtd                29 fs/romfs/mmap-nommu.c 	if (!mtd)
mtd                44 fs/romfs/mmap-nommu.c 	if (len > mtd->size || pgoff >= (mtd->size >> PAGE_SHIFT))
mtd                48 fs/romfs/mmap-nommu.c 	if (offset >= mtd->size)
mtd                51 fs/romfs/mmap-nommu.c 	if ((offset + len) > mtd->size)
mtd                52 fs/romfs/mmap-nommu.c 		len = mtd->size - offset;
mtd                54 fs/romfs/mmap-nommu.c 	ret = mtd_get_unmapped_area(mtd, len, offset, flags);
mtd                71 fs/romfs/mmap-nommu.c 	struct mtd_info *mtd = file_inode(file)->i_sb->s_mtd;
mtd                73 fs/romfs/mmap-nommu.c 	if (!mtd)
mtd                75 fs/romfs/mmap-nommu.c 	return mtd_mmap_capabilities(mtd);
mtd               132 include/linux/mtd/bbm.h 	int (*isbad_bbt)(struct mtd_info *mtd, loff_t ofs, int allowbbt);
mtd               141 include/linux/mtd/bbm.h extern int onenand_default_bbt(struct mtd_info *mtd);
mtd                22 include/linux/mtd/blktrans.h 	struct mtd_info *mtd;
mtd                66 include/linux/mtd/blktrans.h 	void (*add_mtd)(struct mtd_blktrans_ops *tr, struct mtd_info *mtd);
mtd               352 include/linux/mtd/cfi.h 	void (*fixup)(struct mtd_info *mtd);
mtd               377 include/linux/mtd/cfi.h void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups);
mtd               382 include/linux/mtd/cfi.h int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob,
mtd                17 include/linux/mtd/concat.h void mtd_concat_destroy(struct mtd_info *mtd);
mtd                28 include/linux/mtd/hyperbus.h 	struct mtd_info *mtd;
mtd                56 include/linux/mtd/inftl.h int inftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len,
mtd                58 include/linux/mtd/inftl.h int inftl_write_oob(struct mtd_info *mtd, loff_t offs, size_t len,
mtd               251 include/linux/mtd/map.h void map_destroy(struct mtd_info *mtd);
mtd               101 include/linux/mtd/mtd.h 	int (*ecc)(struct mtd_info *mtd, int section,
mtd               103 include/linux/mtd/mtd.h 	int (*free)(struct mtd_info *mtd, int section,
mtd               177 include/linux/mtd/mtd.h 	int (*get_info)(struct mtd_info *mtd, int wunit,
mtd               179 include/linux/mtd/mtd.h 	int (*get_wunit)(struct mtd_info *mtd,
mtd               276 include/linux/mtd/mtd.h 	int (*_erase) (struct mtd_info *mtd, struct erase_info *instr);
mtd               277 include/linux/mtd/mtd.h 	int (*_point) (struct mtd_info *mtd, loff_t from, size_t len,
mtd               279 include/linux/mtd/mtd.h 	int (*_unpoint) (struct mtd_info *mtd, loff_t from, size_t len);
mtd               280 include/linux/mtd/mtd.h 	int (*_read) (struct mtd_info *mtd, loff_t from, size_t len,
mtd               282 include/linux/mtd/mtd.h 	int (*_write) (struct mtd_info *mtd, loff_t to, size_t len,
mtd               284 include/linux/mtd/mtd.h 	int (*_panic_write) (struct mtd_info *mtd, loff_t to, size_t len,
mtd               286 include/linux/mtd/mtd.h 	int (*_read_oob) (struct mtd_info *mtd, loff_t from,
mtd               288 include/linux/mtd/mtd.h 	int (*_write_oob) (struct mtd_info *mtd, loff_t to,
mtd               290 include/linux/mtd/mtd.h 	int (*_get_fact_prot_info) (struct mtd_info *mtd, size_t len,
mtd               292 include/linux/mtd/mtd.h 	int (*_read_fact_prot_reg) (struct mtd_info *mtd, loff_t from,
mtd               294 include/linux/mtd/mtd.h 	int (*_get_user_prot_info) (struct mtd_info *mtd, size_t len,
mtd               296 include/linux/mtd/mtd.h 	int (*_read_user_prot_reg) (struct mtd_info *mtd, loff_t from,
mtd               298 include/linux/mtd/mtd.h 	int (*_write_user_prot_reg) (struct mtd_info *mtd, loff_t to,
mtd               300 include/linux/mtd/mtd.h 	int (*_lock_user_prot_reg) (struct mtd_info *mtd, loff_t from,
mtd               302 include/linux/mtd/mtd.h 	int (*_writev) (struct mtd_info *mtd, const struct kvec *vecs,
mtd               304 include/linux/mtd/mtd.h 	void (*_sync) (struct mtd_info *mtd);
mtd               305 include/linux/mtd/mtd.h 	int (*_lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd               306 include/linux/mtd/mtd.h 	int (*_unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd               307 include/linux/mtd/mtd.h 	int (*_is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd               308 include/linux/mtd/mtd.h 	int (*_block_isreserved) (struct mtd_info *mtd, loff_t ofs);
mtd               309 include/linux/mtd/mtd.h 	int (*_block_isbad) (struct mtd_info *mtd, loff_t ofs);
mtd               310 include/linux/mtd/mtd.h 	int (*_block_markbad) (struct mtd_info *mtd, loff_t ofs);
mtd               311 include/linux/mtd/mtd.h 	int (*_max_bad_blocks) (struct mtd_info *mtd, loff_t ofs, size_t len);
mtd               312 include/linux/mtd/mtd.h 	int (*_suspend) (struct mtd_info *mtd);
mtd               313 include/linux/mtd/mtd.h 	void (*_resume) (struct mtd_info *mtd);
mtd               314 include/linux/mtd/mtd.h 	void (*_reboot) (struct mtd_info *mtd);
mtd               319 include/linux/mtd/mtd.h 	int (*_get_device) (struct mtd_info *mtd);
mtd               320 include/linux/mtd/mtd.h 	void (*_put_device) (struct mtd_info *mtd);
mtd               344 include/linux/mtd/mtd.h int mtd_ooblayout_ecc(struct mtd_info *mtd, int section,
mtd               346 include/linux/mtd/mtd.h int mtd_ooblayout_find_eccregion(struct mtd_info *mtd, int eccbyte,
mtd               349 include/linux/mtd/mtd.h int mtd_ooblayout_get_eccbytes(struct mtd_info *mtd, u8 *eccbuf,
mtd               351 include/linux/mtd/mtd.h int mtd_ooblayout_set_eccbytes(struct mtd_info *mtd, const u8 *eccbuf,
mtd               353 include/linux/mtd/mtd.h int mtd_ooblayout_free(struct mtd_info *mtd, int section,
mtd               355 include/linux/mtd/mtd.h int mtd_ooblayout_get_databytes(struct mtd_info *mtd, u8 *databuf,
mtd               357 include/linux/mtd/mtd.h int mtd_ooblayout_set_databytes(struct mtd_info *mtd, const u8 *databuf,
mtd               359 include/linux/mtd/mtd.h int mtd_ooblayout_count_freebytes(struct mtd_info *mtd);
mtd               360 include/linux/mtd/mtd.h int mtd_ooblayout_count_eccbytes(struct mtd_info *mtd);
mtd               362 include/linux/mtd/mtd.h static inline void mtd_set_ooblayout(struct mtd_info *mtd,
mtd               365 include/linux/mtd/mtd.h 	mtd->ooblayout = ooblayout;
mtd               368 include/linux/mtd/mtd.h static inline void mtd_set_pairing_scheme(struct mtd_info *mtd,
mtd               371 include/linux/mtd/mtd.h 	mtd->pairing = pairing;
mtd               374 include/linux/mtd/mtd.h static inline void mtd_set_of_node(struct mtd_info *mtd,
mtd               377 include/linux/mtd/mtd.h 	mtd->dev.of_node = np;
mtd               378 include/linux/mtd/mtd.h 	if (!mtd->name)
mtd               379 include/linux/mtd/mtd.h 		of_property_read_string(np, "label", &mtd->name);
mtd               382 include/linux/mtd/mtd.h static inline struct device_node *mtd_get_of_node(struct mtd_info *mtd)
mtd               384 include/linux/mtd/mtd.h 	return dev_of_node(&mtd->dev);
mtd               387 include/linux/mtd/mtd.h static inline u32 mtd_oobavail(struct mtd_info *mtd, struct mtd_oob_ops *ops)
mtd               389 include/linux/mtd/mtd.h 	return ops->mode == MTD_OPS_AUTO_OOB ? mtd->oobavail : mtd->oobsize;
mtd               392 include/linux/mtd/mtd.h static inline int mtd_max_bad_blocks(struct mtd_info *mtd,
mtd               395 include/linux/mtd/mtd.h 	if (!mtd->_max_bad_blocks)
mtd               398 include/linux/mtd/mtd.h 	if (mtd->size < (len + ofs) || ofs < 0)
mtd               401 include/linux/mtd/mtd.h 	return mtd->_max_bad_blocks(mtd, ofs, len);
mtd               404 include/linux/mtd/mtd.h int mtd_wunit_to_pairing_info(struct mtd_info *mtd, int wunit,
mtd               406 include/linux/mtd/mtd.h int mtd_pairing_info_to_wunit(struct mtd_info *mtd,
mtd               408 include/linux/mtd/mtd.h int mtd_pairing_groups(struct mtd_info *mtd);
mtd               409 include/linux/mtd/mtd.h int mtd_erase(struct mtd_info *mtd, struct erase_info *instr);
mtd               410 include/linux/mtd/mtd.h int mtd_point(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen,
mtd               412 include/linux/mtd/mtd.h int mtd_unpoint(struct mtd_info *mtd, loff_t from, size_t len);
mtd               413 include/linux/mtd/mtd.h unsigned long mtd_get_unmapped_area(struct mtd_info *mtd, unsigned long len,
mtd               415 include/linux/mtd/mtd.h int mtd_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen,
mtd               417 include/linux/mtd/mtd.h int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
mtd               419 include/linux/mtd/mtd.h int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
mtd               422 include/linux/mtd/mtd.h int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops);
mtd               423 include/linux/mtd/mtd.h int mtd_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops);
mtd               425 include/linux/mtd/mtd.h int mtd_get_fact_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen,
mtd               427 include/linux/mtd/mtd.h int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from, size_t len,
mtd               429 include/linux/mtd/mtd.h int mtd_get_user_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen,
mtd               431 include/linux/mtd/mtd.h int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len,
mtd               433 include/linux/mtd/mtd.h int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to, size_t len,
mtd               435 include/linux/mtd/mtd.h int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len);
mtd               437 include/linux/mtd/mtd.h int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
mtd               440 include/linux/mtd/mtd.h static inline void mtd_sync(struct mtd_info *mtd)
mtd               442 include/linux/mtd/mtd.h 	if (mtd->_sync)
mtd               443 include/linux/mtd/mtd.h 		mtd->_sync(mtd);
mtd               446 include/linux/mtd/mtd.h int mtd_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd               447 include/linux/mtd/mtd.h int mtd_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd               448 include/linux/mtd/mtd.h int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len);
mtd               449 include/linux/mtd/mtd.h int mtd_block_isreserved(struct mtd_info *mtd, loff_t ofs);
mtd               450 include/linux/mtd/mtd.h int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs);
mtd               451 include/linux/mtd/mtd.h int mtd_block_markbad(struct mtd_info *mtd, loff_t ofs);
mtd               453 include/linux/mtd/mtd.h static inline int mtd_suspend(struct mtd_info *mtd)
mtd               455 include/linux/mtd/mtd.h 	return mtd->_suspend ? mtd->_suspend(mtd) : 0;
mtd               458 include/linux/mtd/mtd.h static inline void mtd_resume(struct mtd_info *mtd)
mtd               460 include/linux/mtd/mtd.h 	if (mtd->_resume)
mtd               461 include/linux/mtd/mtd.h 		mtd->_resume(mtd);
mtd               464 include/linux/mtd/mtd.h static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd)
mtd               466 include/linux/mtd/mtd.h 	if (mtd->erasesize_shift)
mtd               467 include/linux/mtd/mtd.h 		return sz >> mtd->erasesize_shift;
mtd               468 include/linux/mtd/mtd.h 	do_div(sz, mtd->erasesize);
mtd               472 include/linux/mtd/mtd.h static inline uint32_t mtd_mod_by_eb(uint64_t sz, struct mtd_info *mtd)
mtd               474 include/linux/mtd/mtd.h 	if (mtd->erasesize_shift)
mtd               475 include/linux/mtd/mtd.h 		return sz & mtd->erasesize_mask;
mtd               476 include/linux/mtd/mtd.h 	return do_div(sz, mtd->erasesize);
mtd               488 include/linux/mtd/mtd.h static inline void mtd_align_erase_req(struct mtd_info *mtd,
mtd               493 include/linux/mtd/mtd.h 	if (WARN_ON(!mtd->erasesize))
mtd               496 include/linux/mtd/mtd.h 	mod = mtd_mod_by_eb(req->addr, mtd);
mtd               502 include/linux/mtd/mtd.h 	mod = mtd_mod_by_eb(req->addr + req->len, mtd);
mtd               504 include/linux/mtd/mtd.h 		req->len += mtd->erasesize - mod;
mtd               507 include/linux/mtd/mtd.h static inline uint32_t mtd_div_by_ws(uint64_t sz, struct mtd_info *mtd)
mtd               509 include/linux/mtd/mtd.h 	if (mtd->writesize_shift)
mtd               510 include/linux/mtd/mtd.h 		return sz >> mtd->writesize_shift;
mtd               511 include/linux/mtd/mtd.h 	do_div(sz, mtd->writesize);
mtd               515 include/linux/mtd/mtd.h static inline uint32_t mtd_mod_by_ws(uint64_t sz, struct mtd_info *mtd)
mtd               517 include/linux/mtd/mtd.h 	if (mtd->writesize_shift)
mtd               518 include/linux/mtd/mtd.h 		return sz & mtd->writesize_mask;
mtd               519 include/linux/mtd/mtd.h 	return do_div(sz, mtd->writesize);
mtd               522 include/linux/mtd/mtd.h static inline int mtd_wunit_per_eb(struct mtd_info *mtd)
mtd               524 include/linux/mtd/mtd.h 	return mtd->erasesize / mtd->writesize;
mtd               527 include/linux/mtd/mtd.h static inline int mtd_offset_to_wunit(struct mtd_info *mtd, loff_t offs)
mtd               529 include/linux/mtd/mtd.h 	return mtd_div_by_ws(mtd_mod_by_eb(offs, mtd), mtd);
mtd               532 include/linux/mtd/mtd.h static inline loff_t mtd_wunit_to_offset(struct mtd_info *mtd, loff_t base,
mtd               535 include/linux/mtd/mtd.h 	return base + (wunit * mtd->writesize);
mtd               539 include/linux/mtd/mtd.h static inline int mtd_has_oob(const struct mtd_info *mtd)
mtd               541 include/linux/mtd/mtd.h 	return mtd->_read_oob && mtd->_write_oob;
mtd               544 include/linux/mtd/mtd.h static inline int mtd_type_is_nand(const struct mtd_info *mtd)
mtd               546 include/linux/mtd/mtd.h 	return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH;
mtd               549 include/linux/mtd/mtd.h static inline int mtd_can_have_bb(const struct mtd_info *mtd)
mtd               551 include/linux/mtd/mtd.h 	return !!mtd->_block_isbad;
mtd               559 include/linux/mtd/mtd.h extern int mtd_device_parse_register(struct mtd_info *mtd,
mtd               567 include/linux/mtd/mtd.h extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num);
mtd               568 include/linux/mtd/mtd.h extern int __get_mtd_device(struct mtd_info *mtd);
mtd               569 include/linux/mtd/mtd.h extern void __put_mtd_device(struct mtd_info *mtd);
mtd               571 include/linux/mtd/mtd.h extern void put_mtd_device(struct mtd_info *mtd);
mtd               575 include/linux/mtd/mtd.h 	void (*add)(struct mtd_info *mtd);
mtd               576 include/linux/mtd/mtd.h 	void (*remove)(struct mtd_info *mtd);
mtd               583 include/linux/mtd/mtd.h void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size);
mtd               597 include/linux/mtd/mtd.h unsigned mtd_mmap_capabilities(struct mtd_info *mtd);
mtd                 6 include/linux/mtd/mtdram.h int mtdram_init_device(struct mtd_info *mtd, void *mapped_address,
mtd               180 include/linux/mtd/nand.h 	struct mtd_info mtd;
mtd               212 include/linux/mtd/nand.h static inline struct nand_device *mtd_to_nanddev(struct mtd_info *mtd)
mtd               214 include/linux/mtd/nand.h 	return container_of(mtd, struct nand_device, mtd);
mtd               225 include/linux/mtd/nand.h 	return &nand->mtd;
mtd               402 include/linux/mtd/nand.h 	return mtd_device_register(&nand->mtd, NULL, 0);
mtd               417 include/linux/mtd/nand.h 	return mtd_device_unregister(&nand->mtd);
mtd               430 include/linux/mtd/nand.h 	mtd_set_of_node(&nand->mtd, np);
mtd               441 include/linux/mtd/nand.h 	return mtd_get_of_node(&nand->mtd);
mtd               630 include/linux/mtd/nand.h 	struct mtd_info *mtd = nanddev_to_mtd(nand);
mtd               635 include/linux/mtd/nand.h 	iter->oobbytes_per_page = mtd_oobavail(mtd, req);
mtd               760 include/linux/mtd/nand.h int nanddev_mtd_erase(struct mtd_info *mtd, struct erase_info *einfo);
mtd               761 include/linux/mtd/nand.h int nanddev_mtd_max_bad_blocks(struct mtd_info *mtd, loff_t offs, size_t len);
mtd                33 include/linux/mtd/nand_bch.h struct nand_bch_control *nand_bch_init(struct mtd_info *mtd);
mtd                57 include/linux/mtd/nand_bch.h static inline struct nand_bch_control *nand_bch_init(struct mtd_info *mtd)
mtd                44 include/linux/mtd/nftl.h int nftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len,
mtd                46 include/linux/mtd/nftl.h int nftl_write_oob(struct mtd_info *mtd, loff_t offs, size_t len,
mtd                22 include/linux/mtd/onenand.h extern int onenand_scan(struct mtd_info *mtd, int max_chips);
mtd                24 include/linux/mtd/onenand.h extern void onenand_release(struct mtd_info *mtd);
mtd               104 include/linux/mtd/onenand.h 	int (*command)(struct mtd_info *mtd, int cmd, loff_t address, size_t len);
mtd               105 include/linux/mtd/onenand.h 	int (*wait)(struct mtd_info *mtd, int state);
mtd               106 include/linux/mtd/onenand.h 	int (*bbt_wait)(struct mtd_info *mtd, int state);
mtd               107 include/linux/mtd/onenand.h 	void (*unlock_all)(struct mtd_info *mtd);
mtd               108 include/linux/mtd/onenand.h 	int (*read_bufferram)(struct mtd_info *mtd, int area,
mtd               110 include/linux/mtd/onenand.h 	int (*write_bufferram)(struct mtd_info *mtd, int area,
mtd               114 include/linux/mtd/onenand.h 	void (*mmcontrol)(struct mtd_info *mtd, int sync_read);
mtd               115 include/linux/mtd/onenand.h 	int (*chip_probe)(struct mtd_info *mtd);
mtd               116 include/linux/mtd/onenand.h 	int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
mtd               117 include/linux/mtd/onenand.h 	int (*scan_bbt)(struct mtd_info *mtd);
mtd               118 include/linux/mtd/onenand.h 	int (*enable)(struct mtd_info *mtd);
mtd               119 include/linux/mtd/onenand.h 	int (*disable)(struct mtd_info *mtd);
mtd               224 include/linux/mtd/onenand.h int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from,
mtd               228 include/linux/mtd/onenand.h int flexonenand_region(struct mtd_info *mtd, loff_t addr);
mtd               233 include/linux/mtd/onenand.h 	void		(*mmcontrol)(struct mtd_info *mtd, int sync_read);
mtd               234 include/linux/mtd/onenand.h 	int		(*read_bufferram)(struct mtd_info *mtd, int area,
mtd               108 include/linux/mtd/partitions.h int mtd_is_partition(const struct mtd_info *mtd);
mtd               112 include/linux/mtd/partitions.h uint64_t mtd_get_device_size(const struct mtd_info *mtd);
mtd              1144 include/linux/mtd/rawnand.h static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd)
mtd              1146 include/linux/mtd/rawnand.h 	return container_of(mtd, struct nand_chip, base.mtd);
mtd              1151 include/linux/mtd/rawnand.h 	return &chip->base.mtd;
mtd               572 include/linux/mtd/spi-nor.h 	struct mtd_info		mtd;
mtd               640 include/linux/mtd/spi-nor.h 	mtd_set_of_node(&nor->mtd, np);
mtd               645 include/linux/mtd/spi-nor.h 	return mtd_get_of_node(&nor->mtd);
mtd               402 include/linux/mtd/spinand.h static inline struct spinand_device *mtd_to_spinand(struct mtd_info *mtd)
mtd               404 include/linux/mtd/spinand.h 	return container_of(mtd_to_nanddev(mtd), struct spinand_device, base);
mtd               280 include/uapi/mtd/mtd-abi.h static inline int mtd_type_is_nand_user(const struct mtd_info_user *mtd)
mtd               282 include/uapi/mtd/mtd-abi.h 	return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH;