public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] cmdlinepart: Missing partition info is not an error
@ 2008-02-14 16:00 Peter Korsgaard
  2008-05-07  2:52 ` Kyungmin Park
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Korsgaard @ 2008-02-14 16:00 UTC (permalink / raw)
  To: linux-mtd, dwmw2; +Cc: sr

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@sunsite.dk>
Acked-by: Stefan Roese <sr@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;
 }
 
 
-- 
debian.1.5.3.7.1-dirty


-- 
Bye, Peter Korsgaard

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cmdlinepart: Missing partition info is not an error
  2008-02-14 16:00 [PATCH] cmdlinepart: Missing partition info is not an error Peter Korsgaard
@ 2008-05-07  2:52 ` Kyungmin Park
  0 siblings, 0 replies; 2+ messages in thread
From: Kyungmin Park @ 2008-05-07  2:52 UTC (permalink / raw)
  To: David Woodhouse; +Cc: sr, linux-mtd

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@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@sunsite.dk>
>  Acked-by: Stefan Roese <sr@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;
>   }
>
>
>  --

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-07  2:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-14 16:00 [PATCH] cmdlinepart: Missing partition info is not an error Peter Korsgaard
2008-05-07  2:52 ` Kyungmin Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox