Re: [PATCH] mtd: unify mtd partition/device registration

From: Andrew Morton
Date: Fri Nov 14 2008 - 16:40:54 EST


On Wed, 12 Nov 2008 18:38:53 -0500
Mike Frysinger <vapier@xxxxxxxxxx> wrote:

> +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);
> +}

look:

From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

text data bss dec hex filename
before: 2488 88 132 2708 a94 drivers/mtd/mtdcore.o
after: 2456 100 132 2688 a80 drivers/mtd/mtdcore.o

Cc: Atsushi Nemoto <anemo@xxxxxxxxxxxxx>
Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
Cc: Mike Frysinger <vapier@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

drivers/mtd/mtdcore.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/mtd/mtdcore.c~mtd-unify-mtd-partition-device-registration-fix drivers/mtd/mtdcore.c
--- a/drivers/mtd/mtdcore.c~mtd-unify-mtd-partition-device-registration-fix
+++ a/drivers/mtd/mtdcore.c
@@ -306,7 +306,7 @@ int parse_mtd(struct mtd_info *mtd, cons
struct mtd_partition *parts, int nr_parts)
{
#ifdef CONFIG_MTD_PARTITIONS
- const char *default_part_probe_types[] = {
+ static const char *default_part_probe_types[] = {
"cmdlinepart",
"RedBoot",
NULL
_

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/