The patch titled mtd: unify mtd partition/device registration has been removed from the -mm tree. Its filename was mtd-unify-mtd-partition-device-registration.patch This patch was dropped because an updated version will be merged The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: mtd: unify mtd partition/device registration From: Mike Frysinger <vapier@xxxxxxxxxx> Rather than having every map/mtd driver doing the same sequence of registering partitions and/or devices, implement common parse_mtd(). Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx> Cc: Atsushi Nemoto <anemo@xxxxxxxxxxxxx> Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/mtd/mtdcore.c | 37 +++++++++++++++++++++++++++++++++++++ include/linux/mtd/mtd.h | 3 +++ 2 files changed, 40 insertions(+) diff -puN drivers/mtd/mtdcore.c~mtd-unify-mtd-partition-device-registration drivers/mtd/mtdcore.c --- a/drivers/mtd/mtdcore.c~mtd-unify-mtd-partition-device-registration +++ a/drivers/mtd/mtdcore.c @@ -292,6 +292,43 @@ void put_mtd_device(struct mtd_info *mtd module_put(mtd->owner); } +#include <linux/mtd/partitions.h> + +/** + * parse_mtd - add partitions / devices + * + * If partitioning support is enabled, attempt to call parse_mtd_partitions() + * and add_mtd_partitions() with all available parsers. Otherwise just add + * the MTD device. + */ + +int parse_mtd(struct mtd_info *mtd, const char **probe_types, + struct mtd_partition *parts, int nr_parts) +{ +#ifdef CONFIG_MTD_PARTITIONS + const char *default_part_probe_types[] = { + "cmdlinepart", + "RedBoot", + NULL + }; + int ret; + + if (!probe_types) + probe_types = default_part_probe_types; + + ret = parse_mtd_partitions(mtd, probe_types, &parts, 0); + if (ret > 0) { + ret = add_mtd_partitions(mtd, parts, ret); + kfree(parts); + return ret; + } else if (nr_parts) + return add_mtd_partitions(mtd, parts, nr_parts); +#endif + + return add_mtd_device(mtd); +} +EXPORT_SYMBOL(parse_mtd); + /* default_mtd_writev - default mtd writev method for MTD devices that * don't implement their own */ diff -puN include/linux/mtd/mtd.h~mtd-unify-mtd-partition-device-registration include/linux/mtd/mtd.h --- a/include/linux/mtd/mtd.h~mtd-unify-mtd-partition-device-registration +++ a/include/linux/mtd/mtd.h @@ -232,6 +232,9 @@ extern struct mtd_info *get_mtd_device_n extern void put_mtd_device(struct mtd_info *mtd); +struct mtd_partition; +int parse_mtd(struct mtd_info *mtd, const char **probe_types, + struct mtd_partition *parts, int nr_parts); struct mtd_notifier { void (*add)(struct mtd_info *mtd); _ Patches currently in -mm which might be from vapier@xxxxxxxxxx are origin.patch linux-next.patch linux-timexh-cleanup-for-userspace.patch m25p80-fix-detection-of-spi-parts.patch m25p80-fix-detection-of-m25p16-flashes.patch mtd-unify-mtd-partition-device-registration.patch mtd-unify-mtd-partition-device-registration-fix.patch mtd-physmap-use-parse_mtd.patch mtd-bfin-async-flash-use-parse_mtd.patch linux-serialh-touchup-for-userspace.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html