Lines Matching defs:mtd
16 #include <linux/mtd/mtd.h>
17 #include <linux/mtd/partitions.h>
28 static inline void free_partition(struct mtd_info *mtd)
30 kfree(mtd->name);
31 kfree(mtd);
109 printk(KERN_ERR "mtd partition \"%s\" doesn't have enough space: %#llx < %#llx, disabled\n",
131 printk(KERN_ERR"mtd: partition \"%s\" is out of reach -- disabled\n",
137 printk(KERN_WARNING"mtd: partition \"%s\" extends beyond the end of device \"%s\" -- size truncated to %#llx\n",
182 printk(KERN_WARNING"mtd: partition \"%s\" doesn't start on an erase/write block boundary -- force read-only\n",
190 printk(KERN_WARNING"mtd: partition \"%s\" doesn't end on an erase/write block -- force read-only\n",
218 struct mtd_info *mtd = dev_get_drvdata(dev);
220 return snprintf(buf, PAGE_SIZE, "%lld\n", mtd->part.offset);
235 "mtd: failed to create partition attrs, err=%d\n", ret);
299 static int __mtd_del_partition(struct mtd_info *mtd)
304 list_for_each_entry_safe(child, next, &mtd->partitions, part.node) {
310 sysfs_remove_files(&mtd->dev.kobj, mtd_partition_attrs);
312 err = del_mtd_device(mtd);
316 list_del(&mtd->part.node);
317 free_partition(mtd);
326 static int __del_mtd_partitions(struct mtd_info *mtd)
332 list_for_each_entry_safe(child, next, &mtd->partitions, part.node) {
352 int del_mtd_partitions(struct mtd_info *mtd)
354 struct mtd_info *master = mtd_get_master(mtd);
357 pr_info("Deleting MTD partitions on \"%s\":\n", mtd->name);
360 ret = __del_mtd_partitions(mtd);
366 int mtd_del_partition(struct mtd_info *mtd, int partno)
368 struct mtd_info *child, *master = mtd_get_master(mtd);
372 list_for_each_entry(child, &mtd->partitions, part.node) {
712 uint64_t mtd_get_device_size(const struct mtd_info *mtd)
714 struct mtd_info *master = mtd_get_master((struct mtd_info *)mtd);