On Tue, 2011-12-20 at 10:42 -0800, Mike Dunn wrote: > + /* > + * For unpartitioned devices, create a single "partition" that > + * spans the entire device, so that driver methods go through > + * partition wrappers in all cases. > + */ > + struct mtd_partition single_part = { > + .name = (char *)mtd->name, > + .offset = 0, > + .size = mtd->size, > + .mask_flags = 0, > + .ecclayout = mtd->ecclayout, > + }; > + err = add_mtd_partitions(mtd, &single_part, 1); > } There is a problem with this approach :-( Look at the 'mtd_blkpg_ioctl()' function which is used to re-partition MTD device from user-space. It is a bit strange, but we use block device for re-partition in order to not invent new ioctls. This function has this code: /* Only master mtd device must be used to add partitions */ if (mtd_is_partition(mtd)) return -EINVAL; and your patch will brake re-partitioning. So I guess we should go back to your first patch where you just change the ->read() / ->read_oob() interface. Or: 1. Rework whole MTD interface from ->read()/->write()/etc (pointers to functions) to mtd_read(mtd, ...)/mtd_write(mtd, ...)/etc. 2. In the new functions you may do the stuff you do at patch 2. For me the second approach is more plausible. -- Best Regards, Artem Bityutskiy