Lines Matching defs:mtd
16 #include <linux/mtd/mtd.h>
17 #include <linux/mtd/partitions.h>
29 static inline void free_partition(struct mtd_info *mtd)
31 kfree(mtd->name);
32 kfree(mtd);
35 void release_mtd_partition(struct mtd_info *mtd)
37 WARN_ON(!list_empty(&mtd->part.node));
38 free_partition(mtd);
116 printk(KERN_ERR "mtd partition \"%s\" doesn't have enough space: %#llx < %#llx, disabled\n",
138 printk(KERN_ERR"mtd: partition \"%s\" is out of reach -- disabled\n",
144 printk(KERN_WARNING"mtd: partition \"%s\" extends beyond the end of device \"%s\" -- size truncated to %#llx\n",
189 printk(KERN_WARNING"mtd: partition \"%s\" doesn't start on an erase/write block boundary -- force read-only\n",
197 printk(KERN_WARNING"mtd: partition \"%s\" doesn't end on an erase/write block -- force read-only\n",
225 struct mtd_info *mtd = dev_get_drvdata(dev);
227 return sysfs_emit(buf, "%lld\n", mtd->part.offset);
229 static DEVICE_ATTR_RO(offset); /* mtd partition offset */
241 "mtd: failed to create partition attrs, err=%d\n", ret);
301 * @mtd: MTD structure to be deleted
305 static int __mtd_del_partition(struct mtd_info *mtd)
310 list_for_each_entry_safe(child, next, &mtd->partitions, part.node) {
316 sysfs_remove_files(&mtd->dev.kobj, mtd_partition_attrs);
318 list_del_init(&mtd->part.node);
319 err = del_mtd_device(mtd);
330 static int __del_mtd_partitions(struct mtd_info *mtd)
335 list_for_each_entry_safe(child, next, &mtd->partitions, part.node) {
353 int del_mtd_partitions(struct mtd_info *mtd)
355 struct mtd_info *master = mtd_get_master(mtd);
358 pr_info("Deleting MTD partitions on \"%s\":\n", mtd->name);
361 ret = __del_mtd_partitions(mtd);
367 int mtd_del_partition(struct mtd_info *mtd, int partno)
369 struct mtd_info *child, *master = mtd_get_master(mtd);
373 list_for_each_entry(child, &mtd->partitions, part.node) {
731 uint64_t mtd_get_device_size(const struct mtd_info *mtd)
733 struct mtd_info *master = mtd_get_master((struct mtd_info *)mtd);