Lines Matching defs:mtd
18 #include <linux/mtd/mtd.h>
19 #include <linux/mtd/partitions.h>
35 struct mtd_info mtd;
58 #define to_mchp48l640_flash(x) container_of(x, struct mchp48l640_flash, mtd)
167 static int mchp48l640_write_page(struct mtd_info *mtd, loff_t to, size_t len,
170 struct mchp48l640_flash *flash = to_mchp48l640_flash(mtd);
209 static int mchp48l640_write(struct mtd_info *mtd, loff_t to, size_t len,
212 struct mchp48l640_flash *flash = to_mchp48l640_flash(mtd);
225 ret = mchp48l640_write_page(mtd, woff, ws, retlen, &buf[wlen]);
235 static int mchp48l640_read_page(struct mtd_info *mtd, loff_t from, size_t len,
238 struct mchp48l640_flash *flash = to_mchp48l640_flash(mtd);
267 static int mchp48l640_read(struct mtd_info *mtd, loff_t from, size_t len,
270 struct mchp48l640_flash *flash = to_mchp48l640_flash(mtd);
283 ret = mchp48l640_read_page(mtd, woff, ws, retlen, &buf[wlen]);
327 mtd_set_of_node(&flash->mtd, spi->dev.of_node);
328 flash->mtd.dev.parent = &spi->dev;
329 flash->mtd.type = MTD_RAM;
330 flash->mtd.flags = MTD_CAP_RAM;
331 flash->mtd.writesize = flash->caps->page_size;
332 flash->mtd.size = flash->caps->size;
333 flash->mtd._read = mchp48l640_read;
334 flash->mtd._write = mchp48l640_write;
336 err = mtd_device_register(&flash->mtd, data ? data->parts : NULL,
348 WARN_ON(mtd_device_unregister(&flash->mtd));