Lines Matching refs:mtd
16 #include <linux/mtd/mtd.h>
17 #include <linux/mtd/map.h>
23 static int maprom_erase (struct mtd_info *mtd, struct erase_info *info);
24 static int maprom_point (struct mtd_info *mtd, loff_t from, size_t len,
26 static int maprom_unpoint(struct mtd_info *mtd, loff_t from, size_t len);
46 struct mtd_info *mtd;
48 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
49 if (!mtd)
53 mtd->priv = map;
54 mtd->name = map->name;
55 mtd->type = MTD_ROM;
56 mtd->size = map->size;
57 mtd->_point = maprom_point;
58 mtd->_unpoint = maprom_unpoint;
59 mtd->_read = maprom_read;
60 mtd->_write = maprom_write;
61 mtd->_sync = maprom_nop;
62 mtd->_erase = maprom_erase;
63 mtd->flags = MTD_CAP_ROM;
64 mtd->erasesize = default_erasesize(map);
65 mtd->writesize = 1;
66 mtd->writebufsize = 1;
69 return mtd;
73 static int maprom_point(struct mtd_info *mtd, loff_t from, size_t len,
76 struct map_info *map = mtd->priv;
87 static int maprom_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
92 static int maprom_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
94 struct map_info *map = mtd->priv;
101 static void maprom_nop(struct mtd_info *mtd)
106 static int maprom_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
111 static int maprom_erase (struct mtd_info *mtd, struct erase_info *info)