Lines Matching refs:mtd
15 #include <linux/mtd/map.h>
33 struct mtd_info *mtd;
38 mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
39 if (!mtd)
42 memset(mtd, 0, sizeof(*mtd));
45 mtd->priv = map;
46 mtd->name = map->name;
47 mtd->type = MTD_RAM;
48 mtd->size = map->size;
49 mtd->erase = mapram_erase;
50 mtd->read = mapram_read;
51 mtd->write = mapram_write;
52 mtd->sync = mapram_nop;
53 mtd->flags = MTD_CAP_RAM | MTD_VOLATILE;
55 mtd->erasesize = PAGE_SIZE;
56 while(mtd->size & (mtd->erasesize - 1))
57 mtd->erasesize >>= 1;
60 return mtd;
64 static int mapram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
66 struct map_info *map = (struct map_info *)mtd->priv;
73 static int mapram_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
75 struct map_info *map = (struct map_info *)mtd->priv;
82 static int mapram_erase (struct mtd_info *mtd, struct erase_info *instr)
86 struct map_info *map = (struct map_info *)mtd->priv;
98 static void mapram_nop(struct mtd_info *mtd)