Lines Matching refs:mtd_info
59 struct mtd_info mtd_info; member
70 static void blkmtd_sync(struct mtd_info *mtd);
410 static int blkmtd_erase(struct mtd_info *mtd, struct erase_info *instr) in blkmtd_erase()
479 static int blkmtd_read(struct mtd_info *mtd, loff_t from, size_t len, in blkmtd_read()
549 static int blkmtd_write(struct mtd_info *mtd, loff_t to, size_t len, in blkmtd_write()
588 static void blkmtd_sync(struct mtd_info *mtd) in blkmtd_sync()
657 dev->mtd_info.index, in blkmtd_proc_read()
678 del_mtd_device(&dev->mtd_info); in free_device()
679 info("mtd%d: [%s] removed", dev->mtd_info.index, in free_device()
680 dev->mtd_info.name + strlen("blkmtd: ")); in free_device()
681 if(dev->mtd_info.eraseregions) in free_device()
682 kfree(dev->mtd_info.eraseregions); in free_device()
683 if(dev->mtd_info.name) in free_device()
684 kfree(dev->mtd_info.name); in free_device()
884 dev->mtd_info.size = dev->binding->bd_inode->i_size & PAGE_MASK; in add_device()
888 dev->mtd_info.name = kmalloc(sizeof("blkmtd: ") + strlen(devname), GFP_KERNEL); in add_device()
889 if(dev->mtd_info.name == NULL) in add_device()
892 sprintf(dev->mtd_info.name, "blkmtd: %s", devname); in add_device()
893 dev->mtd_info.eraseregions = calc_erase_regions(erase_size, dev->mtd_info.size, in add_device()
894 &dev->mtd_info.numeraseregions); in add_device()
895 if(dev->mtd_info.eraseregions == NULL) in add_device()
898 dev->mtd_info.erasesize = dev->mtd_info.eraseregions->erasesize; in add_device()
900 dev->mtd_info.numeraseregions); in add_device()
903 dev->mtd_info.type = MTD_ROM; in add_device()
904 dev->mtd_info.flags = MTD_CAP_ROM; in add_device()
906 dev->mtd_info.type = MTD_RAM; in add_device()
907 dev->mtd_info.flags = MTD_CAP_RAM; in add_device()
909 dev->mtd_info.erase = blkmtd_erase; in add_device()
910 dev->mtd_info.read = blkmtd_read; in add_device()
911 dev->mtd_info.write = blkmtd_write; in add_device()
912 dev->mtd_info.sync = blkmtd_sync; in add_device()
913 dev->mtd_info.point = 0; in add_device()
914 dev->mtd_info.unpoint = 0; in add_device()
915 dev->mtd_info.priv = dev; in add_device()
916 dev->mtd_info.module = THIS_MODULE; in add_device()
919 if (add_mtd_device(&dev->mtd_info)) { in add_device()
926 dev->mtd_info.index, dev->mtd_info.name + strlen("blkmtd: "), in add_device()
927 dev->mtd_info.erasesize >> 10, in add_device()
953 blkmtd_sync(&dev->mtd_info); in cleanup_blkmtd()