Skip to contentSkip to conversation

cmdlinepart: Missing partition info is not an error

PATCH In review Peter Korsgaard 2 participants 2 messages Feb 14, 2008 – May 7, 2008 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmdlinepart: Missing partition info is not an error

Return 0 partitions instead of -EINVAL on no mtdpart= argument in kernel cmdline or missing partition info for device.

---
 drivers/mtd/cmdlinepart.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/mtd/cmdlinepart.c +1 -4
index b44292a..08b82c9 100644
@@ -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;
 }
 
 
Signature · 5 lines
debian.1.5.3.7.1-dirty


-- 
Bye, Peter Korsgaard
#1 lore raw

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

Quoted 33 lines · Peter Korsgaard

Return 0 partitions instead of -EINVAL on no mtdpart= argument in kernel
cmdline or missing partition info for device.

---

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

--