[PATCH] cmdlinepart: Missing partition info is not an error

Kyungmin Park kmpark at infradead.org
Tue May 6 22:52:10 EDT 2008


Hi David,

After commit this patch, we can't register the mtd partitions in case
of OneNAND.
In previous time it expects the negative value (-EINVAL) if not found.
Now it returns 0 if not found.

#ifdef CONFIG_MTD_PARTITIONS
        err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0);
        if (err > 0)
                /* If cmdline found */
                add_mtd_partitions(&info->mtd, info->parts, err);
        else if (err < 0 && pdata->parts)
                /* not found but we have parts info */
                add_mtd_partitions(&info->mtd, pdata->parts, pdata->nr_parts);
        else
#endif
                err = add_mtd_device(&info->mtd);

Well I will send the related patches.

Thank you,
Kyungmin Park


On Fri, Feb 15, 2008 at 1:00 AM, Peter Korsgaard <jacmet at sunsite.dk> wrote:
> Return 0 partitions instead of -EINVAL on no mtdpart= argument in kernel
>  cmdline or missing partition info for device.
>
>  Signed-off-by: Peter Korsgaard <jacmet at sunsite.dk>
>  Acked-by: Stefan Roese <sr at denx.de>
>  ---
>   drivers/mtd/cmdlinepart.c |    5 +----
>   1 files changed, 1 insertions(+), 4 deletions(-)
>
>  diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
>  index b44292a..08b82c9 100644
>  --- a/drivers/mtd/cmdlinepart.c
>  +++ b/drivers/mtd/cmdlinepart.c
>  @@ -308,9 +308,6 @@ static int parse_cmdline_partitions(struct mtd_info *master,
>         struct cmdline_mtd_partition *part;
>         char *mtd_id = master->name;
>
>  -       if(!cmdline)
>  -               return -EINVAL;
>  -
>         /* parse command line */
>         if (!cmdline_parsed)
>                 mtdpart_setup_real(cmdline);
>  @@ -341,7 +338,7 @@ static int parse_cmdline_partitions(struct mtd_info *master,
>                         return part->num_parts;
>                 }
>         }
>  -       return -EINVAL;
>  +       return 0;
>   }
>
>
>  --



More information about the linux-mtd mailing list